com.ezware.dialog.task
Class TaskDialog

java.lang.Object
  extended by com.ezware.common.SwingBean
      extended by com.ezware.dialog.task.TaskDialog

public class TaskDialog
extends SwingBean


Nested Class Summary
static interface TaskDialog.Command
          Task Dialog Command
static class TaskDialog.CommandTag
          Standard Command Tags, correspond directly to button tags in MigLayout
static interface TaskDialog.Details
          Task Dialog Details
static interface TaskDialog.Footer
          Task Dialog Footer
static class TaskDialog.StandardCommand
          Set of standard task dialog commands
static class TaskDialog.StandardIcon
          Set of standard dialog icons.
 
Constructor Summary
TaskDialog(java.lang.String title)
          Creates a task dialog.
Automatically pick up currently active window as a parent window
 
Method Summary
 java.util.Collection<TaskDialog.Command> getCommands()
           
 TaskDialog.Details getDetails()
           
 javax.swing.JComponent getFixedComponent()
          Returns dialog's component
 TaskDialog.Footer getFooter()
           
 javax.swing.Icon getIcon()
          Returns dialog's icon
static TaskDialog getInstance(java.awt.Component source)
          Returns task dialog instance associated with source component
 java.lang.String getInstruction()
          Returns dialog instruction
 java.util.Locale getLocale()
          Gets the Locale object that is associated with this window, if the locale has been set.
 java.lang.String getLocalizedString(java.lang.String key)
          Returns a string localized using currently set locale
 java.awt.Dialog.ModalityType getModalityType()
           
 TaskDialog.Command getResult()
           
 java.lang.String getString(java.lang.String text)
          Tries to use text as a key to get localized text.
 java.lang.String getText()
          Returns Dialog text
 java.lang.String getTitle()
          Returns the title of the dialog
 boolean isCommandsVisible()
           
static boolean isDebugMode()
          True if debug mode is set.
 boolean isResizable()
           
 boolean isVisible()
          Determines whether this component should be visible when its parent is visible.
static java.lang.String makeKey(java.lang.String text)
          Makes resource bundle key based on the provided text
 void setCommands(java.util.Collection<TaskDialog.Command> commands)
           
 void setCommands(TaskDialog.Command... commands)
           
 void setCommandsVisible(boolean visible)
           
static void setDebugMode(boolean debug)
          Sets debug mode for task dialog framework.
 void setFixedComponent(javax.swing.JComponent c)
          Sets Dialog component
 void setIcon(javax.swing.Icon icon)
          Sets icon for the dialog
 void setInstruction(java.lang.String instruction)
          Sets dialog's instruction
 void setLocale(java.util.Locale locale)
          Sets locale which will be used as dialog's locale
 void setModalityType(java.awt.Dialog.ModalityType modalityType)
           
 void setResizable(boolean resizable)
           
 void setResult(TaskDialog.Command result)
           
 void setText(java.lang.String text)
          Sets dialog text
 void setTitle(java.lang.String title)
          Sets the title of the dialog
 void setVisible(boolean visible)
          Shows or hides this Dialog depending on the value of parameter
 TaskDialog.Command show()
          Shows the dialog
 java.lang.String toString()
           
 
Methods inherited from class com.ezware.common.SwingBean
addPropertyListener, addPropertyListener, firePropertyChange, removePropertyListener, removePropertyListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TaskDialog

public TaskDialog(java.lang.String title)
Creates a task dialog.
Automatically pick up currently active window as a parent window

Parameters:
title -
Method Detail

makeKey

public static final java.lang.String makeKey(java.lang.String text)
Makes resource bundle key based on the provided text

Parameters:
text -
Returns:

getInstance

public static final TaskDialog getInstance(java.awt.Component source)
Returns task dialog instance associated with source component

Parameters:
source -
Returns:
task dialog instance associated with source component or null if none

setDebugMode

public static final void setDebugMode(boolean debug)
Sets debug mode for task dialog framework.

Parameters:
debug -

isDebugMode

public static final boolean isDebugMode()
True if debug mode is set. In debug mode component bounds and grid cells are outlined. This helps with debugging overall appearance of task dialog UI.

Returns:
true if debug mode is set

getModalityType

public java.awt.Dialog.ModalityType getModalityType()

setModalityType

public void setModalityType(java.awt.Dialog.ModalityType modalityType)

isResizable

public boolean isResizable()

setResizable

public void setResizable(boolean resizable)

getLocale

public java.util.Locale getLocale()
Gets the Locale object that is associated with this window, if the locale has been set. If no locale has been set, then the default locale is returned.

Returns:
the locale that is set for this dialog

setLocale

public void setLocale(java.util.Locale locale)
Sets locale which will be used as dialog's locale

Parameters:
newLocale - null is allowed and will be interpreted as default locale

getLocalizedString

public java.lang.String getLocalizedString(java.lang.String key)
Returns a string localized using currently set locale

Parameters:
key -
Returns:

getString

public java.lang.String getString(java.lang.String text)
Tries to use text as a key to get localized text. If not found the text itself is returned

Parameters:
text -
Returns:

setVisible

public void setVisible(boolean visible)
Shows or hides this Dialog depending on the value of parameter

Parameters:
visible - if true dialog is shown

isVisible

public boolean isVisible()
Determines whether this component should be visible when its parent is visible.

Returns:
true if visible

getResult

public TaskDialog.Command getResult()

setResult

public void setResult(TaskDialog.Command result)

show

public TaskDialog.Command show()
Shows the dialog

Returns:
dialog result

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTitle

public java.lang.String getTitle()
Returns the title of the dialog

Returns:

setTitle

public void setTitle(java.lang.String title)
Sets the title of the dialog

Parameters:
title -

setIcon

public void setIcon(javax.swing.Icon icon)
Sets icon for the dialog

Parameters:
icon -

getIcon

public javax.swing.Icon getIcon()
Returns dialog's icon

Returns:

setInstruction

public void setInstruction(java.lang.String instruction)
Sets dialog's instruction

Parameters:
instruction -

getInstruction

public java.lang.String getInstruction()
Returns dialog instruction

Returns:

setText

public void setText(java.lang.String text)
Sets dialog text

Parameters:
text -

getText

public java.lang.String getText()
Returns Dialog text

Returns:

setFixedComponent

public void setFixedComponent(javax.swing.JComponent c)
Sets Dialog component

Parameters:
c -

getFixedComponent

public javax.swing.JComponent getFixedComponent()
Returns dialog's component

Returns:

getDetails

public TaskDialog.Details getDetails()

getFooter

public TaskDialog.Footer getFooter()

setCommands

public void setCommands(java.util.Collection<TaskDialog.Command> commands)

setCommands

public void setCommands(TaskDialog.Command... commands)

getCommands

public java.util.Collection<TaskDialog.Command> getCommands()

isCommandsVisible

public boolean isCommandsVisible()

setCommandsVisible

public void setCommandsVisible(boolean visible)


Copyright © 2010 ezware. All Rights Reserved.