com.levigo.util.swing.messaging.dialog
Class DefaultDialogMessageListener

java.lang.Object
  extended by com.levigo.util.swing.messaging.dialog.DefaultDialogMessageListener
All Implemented Interfaces:
MessageListener, EventListener

public class DefaultDialogMessageListener
extends Object
implements MessageListener

Default Message Listener to be used with MessageManager.

If this listener receives a message event, it shows a standardized Dialog

Author:
Carolin Koehler
See Also:
to show the message. If the MessageEvent demands and Choice of the user, the result will be stored in MessageResult gained over MessageEvent.

Method Summary
 void displayMessage(MessageEvent e)
          Invoked when an message event occurs.
static DefaultDialogMessageListener getInstance()
          Gets the single instance of this class.
 void ignore(String messageType)
          Lets the user customize to what events he doesn't want to react by showing a message dialog.
 boolean isCenterOnParent()
          Returns whether the displayed message dialog should be centered on the parent frame of messageEvents source or on the screen.
 boolean isResizable()
          Returns whether the displayed message dialog can be resized.
 void setCenterOnParent(boolean centerOnParent)
          Sets a flag whether the displayed message dialog should be centered on the parent frame of messageEvents source or on the screen.
 void setResizable(boolean resizable)
          Sets a flag whether the displayed message dialog can be resized by the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DefaultDialogMessageListener getInstance()
Gets the single instance of this class. This instance will be registered at the "new" MessageManager to react to MessageEvents.


displayMessage

public void displayMessage(MessageEvent e)
Description copied from interface: MessageListener
Invoked when an message event occurs.

Note:
MessageEvent contains a MessageResult Object, if neccessary, put the result of displaying the message, into it.

Specified by:
displayMessage in interface MessageListener
Parameters:
e - MessageEvent containing the message to display and a messageResult to hold message display results
See Also:
MessageResult

isCenterOnParent

public boolean isCenterOnParent()
Returns whether the displayed message dialog should be centered on the parent frame of messageEvents source or on the screen.

Returns:
boolean true message dialog should be centered false message dialog should be centered on screen

setCenterOnParent

public void setCenterOnParent(boolean centerOnParent)
Sets a flag whether the displayed message dialog should be centered on the parent frame of messageEvents source or on the screen.

Parameters:
centerOnParent - true message dialog should be centered false message dialog should be centered on screen

ignore

public void ignore(String messageType)
Lets the user customize to what events he doesn't want to react by showing a message dialog.

Parameters:
messageType - One of Message.CHOICE, Message.DISPLAY, Message.CONFIRM or Message.INPUT

isResizable

public boolean isResizable()
Returns whether the displayed message dialog can be resized.

Returns:
boolean true when the message dialog can be resized, false otherwise.

setResizable

public void setResizable(boolean resizable)
Sets a flag whether the displayed message dialog can be resized by the user.

Parameters:
resizable - true message dialog will be resizable; false not resizable


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.