com.metamatrix.toolbox.ui.callback
Class DialogFactoryCallbackHandler

java.lang.Object
  extended by com.metamatrix.toolbox.ui.callback.DialogFactoryCallbackHandler
All Implemented Interfaces:
CallbackHandler
Direct Known Subclasses:
CDKCallbackHandler

public class DialogFactoryCallbackHandler
extends java.lang.Object
implements CallbackHandler

An application implements a CallbackHandler and passes it to underlying security services so that they may interact with the application to retrieve specific authentication data, such as usernames and passwords, or to display certain information, such as error and warning messages.

CallbackHandlers are implemented in an application-dependent fashion. For example, implementations for an application with a graphical user interface (GUI) may pop up windows to prompt for requested information or to display error messages. An implementation may also choose to obtain requested information from an alternate source without asking the end user.


Constructor Summary
DialogFactoryCallbackHandler()
           
 
Method Summary
protected  javax.swing.JPanel createCallbackPanel(Callback callback, PropertyDefinitionGroup definitionGroup, PropertiedObject object, PropertiedObjectEditor editor)
          Create a JPanel to edit the specified callback containing a PropertyDefinitionGroup for the specified PropertiedObject.
protected  javax.swing.JPanel createCallbackPanel(Callback callback, java.lang.String prompt, PropertiedObject object, PropertiedObjectEditor editor)
          Create a JPanel to edit the specified callback containing a PropertiedObject.
protected  void dialogDismissed()
          called by cancel/dismiss listeners to indicate that the user dismissed the dialog without making a choice.
 void handle(Callback callback, java.lang.Object source)
          Retrieve or display the requested information in the Callback object.
protected  DialogPanel processPropertiedObjectCallback(Callback callback)
          create a DialogPanel to process the specified callback.
protected  void setChoice(int index)
          set the specified choice as the callback response.
 void setDefaultDialogSize(java.awt.Dimension size)
          set the Size for this handler to use for all dialogs.
 void setParentFrameSupplier(ParentFrameSupplier supplier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogFactoryCallbackHandler

public DialogFactoryCallbackHandler()
Method Detail

setParentFrameSupplier

public void setParentFrameSupplier(ParentFrameSupplier supplier)

setDefaultDialogSize

public void setDefaultDialogSize(java.awt.Dimension size)
set the Size for this handler to use for all dialogs. if this method is not called, or called with a null size, the handler will use pack() to set dialog size.


handle

public void handle(Callback callback,
                   java.lang.Object source)
            throws java.io.IOException
Retrieve or display the requested information in the Callback object.

The implementation should process all callback objects before returning, since the caller of this method is free to retrieve the requested information from the callback objects immediately after this method returns.

Specified by:
handle in interface CallbackHandler
Parameters:
callbacks - an array of Callback objects provided by the method caller, and which contain the information requested to be retrieved or displayed.
source - the object that is considered the source of the callbacks.
Throws:
java.io.IOException - if an input or output error occurs does not support one or more of the Callbacks specified in the callbacks parameter

processPropertiedObjectCallback

protected DialogPanel processPropertiedObjectCallback(Callback callback)
create a DialogPanel to process the specified callback. This method is designed to be used and/or overridden by subclasses to build custom DialogPanels for specific callbacks or to obtain the default DialogPanel built by this method and add/remove features.


createCallbackPanel

protected javax.swing.JPanel createCallbackPanel(Callback callback,
                                                 PropertyDefinitionGroup definitionGroup,
                                                 PropertiedObject object,
                                                 PropertiedObjectEditor editor)
Create a JPanel to edit the specified callback containing a PropertyDefinitionGroup for the specified PropertiedObject. This method is designed to be used and/or overridden by subclasses to generate customized panels for specific PropertyDefinitionGroups.


createCallbackPanel

protected javax.swing.JPanel createCallbackPanel(Callback callback,
                                                 java.lang.String prompt,
                                                 PropertiedObject object,
                                                 PropertiedObjectEditor editor)
Create a JPanel to edit the specified callback containing a PropertiedObject.


dialogDismissed

protected void dialogDismissed()
called by cancel/dismiss listeners to indicate that the user dismissed the dialog without making a choice.


setChoice

protected void setChoice(int index)
set the specified choice as the callback response.



Copyright © 2009. All Rights Reserved.