com.togethersoft.openapi.util.ui
Class AbstractDialog


public abstract class AbstractDialog
implements ActionListener

Presents abstract dialog

Author:
TogetherSoft
Since: Together 5.0

Field Summary
 protected JDialogmyDialog
           
 protected JButtonmyOkButton
           
 private WindowAdaptermyWindowAdapter
           

Constructor Summary
 AbstractDialog()
          Creates new AbstractDialog
 protected AbstractDialog(boolean withoutInit)
          Only for children

Method Summary
 voidactionPerformed(ActionEvent evt)
          Works actions:
IdeButtonType.CANCEL calls cancelAction()
IdeButtonType.OK calls okAction()
IdeButtonType.HELP calls IdeAccess.getIdeManager ().openApplicationHelp (getHelpLocation (), myDialog)
 protected voidaddWindowAdapter()
           
 voidcancelAction()
          Cancel actions handler.
 protected JPanelcreateButtonPane()
          Use setupOkButton() if you override this function.
 protected abstract JComponentcreateContentPane()
          Creates content Panel.
 voiddispose()
          Disposes AbstractDialog.
 protected voiddoCancel()
          Does something by Cancel actions
 protected abstract voiddoOk()
          Does something by Ok actions
 protected StringgetHelpLocation()
          Returns string contain help locatin.
 protected StringgetOkButtonText()
          Returns type of Ok button.
 protected StringgetOkButtonType()
          Returns type of Ok button.
 protected voidinit()
           
 booleanisOkEnabled()
          Returns is Ok button enabled;
 voidokAction()
          Ok actions handler.
 private voidprintFocusOwnerIerarchy()
           
 protected voidremoveWindowAdapter()
           
 voidsetModal(boolean val)
          Sets modal mode of dialog
 voidsetOkEnabled(boolean satate)
          Sets Returns is Ok button enabled;
 voidsetTitle(String title)
          Sets title for AbstractDialog
 protected JButtonsetupOkButton(JButton b)
          Setups Ok button.
 voidshow()
          Does pack() and sets setVisible( true)

Field Detail

myDialog

protected JDialog myDialog

myOkButton

protected JButton myOkButton

myWindowAdapter

private WindowAdapter myWindowAdapter
Constructor Detail

AbstractDialog

public AbstractDialog()
Creates new AbstractDialog

AbstractDialog

protected AbstractDialog(boolean withoutInit)
Only for children
Method Detail

actionPerformed

public void actionPerformed(ActionEvent evt)
Works actions:
IdeButtonType.CANCEL calls cancelAction()
IdeButtonType.OK calls okAction()
IdeButtonType.HELP calls IdeAccess.getIdeManager ().openApplicationHelp (getHelpLocation (), myDialog)

addWindowAdapter

protected void addWindowAdapter()

cancelAction

public void cancelAction()
Cancel actions handler. Disposes dialog,
calls doCancel() and calls dispose()

createButtonPane

protected JPanel createButtonPane()
Use setupOkButton() if you override this function.

createContentPane

protected abstract JComponent createContentPane()
Creates content Panel.

dispose

public void dispose()
Disposes AbstractDialog.
If You owerwrite this function You should call super.dispose();

doCancel

protected void doCancel()
Does something by Cancel actions

doOk

protected abstract void doOk()
Does something by Ok actions

getHelpLocation

protected String getHelpLocation()
Returns string contain help locatin.

getOkButtonText

protected String getOkButtonText()
Returns type of Ok button.
Overwrite this function only if IdeButtonType don't contain your button.
Returns: null

getOkButtonType

protected String getOkButtonType()
Returns type of Ok button.
Overwrite this function if your button differ from Ok
Returns: IdeButtonType.OK

init

protected void init()

isOkEnabled

public boolean isOkEnabled()
Returns is Ok button enabled;

okAction

public void okAction()
Ok actions handler. If Ok button enabled - disposes dialog,
calls doOk() and calls dispose()

printFocusOwnerIerarchy

private void printFocusOwnerIerarchy()

removeWindowAdapter

protected void removeWindowAdapter()

setModal

public void setModal(boolean val)
Sets modal mode of dialog

setOkEnabled

public void setOkEnabled(boolean satate)
Sets Returns is Ok button enabled;

setTitle

public void setTitle(String title)
Sets title for AbstractDialog

setupOkButton

protected JButton setupOkButton(JButton b)
Setups Ok button. Calls setupStandardButton() with type from getOkButtonType(),
sets action command = IdeButtonType.OK, action listener and
text from getOkButtonText() if not null.
Use this function if you override createButtonPane().
Returns: prepared button.

show

public void show()
Does pack() and sets setVisible( true)

Association Links

to Class javax.swing.JButton

to Class javax.swing.JDialog

to Class java.awt.event.WindowAdapter