org.wings
Class SDialog

java.lang.Object
  extended by org.wings.SComponent
      extended by org.wings.SContainer
          extended by org.wings.SForm
              extended by org.wings.SWindow
                  extended by org.wings.SDialog
All Implemented Interfaces:
Serializable, Cloneable, LowLevelEventListener, Renderable
Direct Known Subclasses:
SOptionPane

public class SDialog
extends SWindow

Top-level window with a title and a border that is typically used to take some form of input from the user.

As opposed to Swing, wingS dialogs are non modal. However, the dismission of the dialog is propagated by means of ActionEvents. The action command of the event tells, what kind of user activity caused the dialog to dismiss.

Author:
Holger Engels, Roman Rädle
See Also:
Serialized Form

Field Summary
static String CLOSE_ACTION
          Action command if dialog window was closed
static String DEFAULT_ACTION
          Action command if user hit return
protected  boolean draggable
           
protected  SIcon icon
           
protected  boolean modal
           
protected  String title
          The Title of the Dialog Frame
 
Fields inherited from class org.wings.SWindow
owner, x, y
 
Fields inherited from class org.wings.SForm
actionCommand, ENC_TYPE_MULTIPART_FORM, ENC_TYPE_TEXT_PLAIN, listenerList, URL_ENCODING
 
Fields inherited from class org.wings.SComponent
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME
 
Constructor Summary
SDialog()
          Creates a Dialog without parent SFrame or SDialog and without Title
SDialog(SFrame owner)
          Creates a dialog with the specifed parent SFrame as its owner.
SDialog(SFrame owner, boolean modal)
          Creates a modal or non-modal dialog without a title and with the specified owner Frame.
SDialog(SFrame owner, String title)
          Creates a dialog with the specified title and the specified owner frame.
SDialog(SFrame owner, String title, boolean modal)
          Creates a modal or non-modal dialog with the specified title and the specified owner Frame.
 
Method Summary
 SIcon getIcon()
           
 String getTitle()
          Gets the title of the dialog.
 void hide()
          Remove this window from its frame.
 boolean isClosable()
           
 boolean isDraggable()
           
 boolean isModal()
           
 void setCG(DialogCG cg)
           
 void setClosable(boolean v)
           
 void setDraggable(boolean draggable)
           
 void setIcon(SIcon i)
           
 void setModal(boolean modal)
           
 void setTitle(String t)
          Sets the title of the dialog.
 
Methods inherited from class org.wings.SWindow
dispose, getOwner, getX, getY, processLowLevelEvent, setVisible, setX, setY, show
 
Methods inherited from class org.wings.SForm
addActionListener, addArmedComponent, addComponent, clearArmedComponents, fireActionPerformed, fireEvents, fireFinalEvents, fireIntermediateEvents, getAction, getActionCommand, getCG, getDefaultButton, getEncodingType, getRequestURL, isEpochCheckEnabled, isPostMethod, registerFileChooser, removeActionListener, setAction, setActionCommand, setCG, setDefaultButton, setEncodingType, setEpochCheckEnabled, setPostMethod, unregisterFileChooser
 
Methods inherited from class org.wings.SContainer
add, add, add, add, addComponent, addComponent, addComponent, addContainerListener, addNotify, clone, fireContainerEvent, getComponent, getComponentCount, getComponentList, getComponents, getConstraintAt, getConstraintList, getLayout, invite, inviteEachComponent, isShowingChildren, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCG, setLayout, setParentFrame, updateCG
 
Methods inherited from class org.wings.SComponent
addComponentListener, addDynamicStyle, addEventListener, addParentFrameListener, addPropertyChangeListener, addPropertyChangeListener, addRenderListener, addScriptListener, addStyle, fireComponentChangeEvent, fireKeyEvents, fireRenderEvent, getActionMap, getBackground, getBorder, getClientProperty, getComponentPopupMenu, getDynamicStyle, getDynamicStyles, getFocusTraversalIndex, getFont, getForeground, getHorizontalAlignment, getInputMap, getInputMap, getListenerCount, getListenerList, getListeners, getLowLevelEventId, getName, getParent, getParentFrame, getPreferredSize, getResidesInForm, getScriptListenerList, getScriptListeners, getSession, getShowAsFormComponent, getStyle, getToolTipText, getVerticalAlignment, isDifferent, isEnabled, isFocusOwner, isRecursivelyVisible, isReloadForced, isUpdatePossible, isVisible, paramString, processComponentEvent, processKeyEvents, putClientProperty, reload, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, removeComponentListener, removeDynamicStyle, removeEventListener, removeParentFrameListener, removePropertyChangeListener, removePropertyChangeListener, removeRenderListener, removeScriptListener, removeStyle, requestFocus, scrollRectToVisible, setActionMap, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setBackground, setBorder, setCG, setComponentPopupMenu, setDynamicStyles, setEnabled, setFocusTraversalIndex, setFont, setForeground, setHorizontalAlignment, setInputMap, setInputMap, setName, setNameRaw, setParent, setPreferredSize, setReloadForced, setShowAsFormComponent, setStyle, setToolTipText, setVerticalAlignment, toString, update, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.wings.LowLevelEventListener
fireFinalEvents, fireIntermediateEvents, getLowLevelEventId, getName, isEnabled, isEpochCheckEnabled
 

Field Detail

CLOSE_ACTION

public static final String CLOSE_ACTION
Action command if dialog window was closed

See Also:
Constant Field Values

DEFAULT_ACTION

public static final String DEFAULT_ACTION
Action command if user hit return

See Also:
Constant Field Values

title

protected String title
The Title of the Dialog Frame


icon

protected SIcon icon

modal

protected boolean modal

draggable

protected boolean draggable
Constructor Detail

SDialog

public SDialog()
Creates a Dialog without parent SFrame or SDialog and without Title


SDialog

public SDialog(SFrame owner)
Creates a dialog with the specifed parent SFrame as its owner.

Parameters:
owner - the parent SFrame

SDialog

public SDialog(SFrame owner,
               boolean modal)
Creates a modal or non-modal dialog without a title and with the specified owner Frame. If owner is null, a shared, hidden frame will be set as the owner of the dialog.

This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale.

Parameters:
owner - the Frame from which the dialog is displayed
modal - true for a modal dialog, false for one that allows others windows to be active at the same time returns true.

SDialog

public SDialog(SFrame owner,
               String title)
Creates a dialog with the specified title and the specified owner frame.

Parameters:
owner - the parent SFrame
title - the String to display as titke

SDialog

public SDialog(SFrame owner,
               String title,
               boolean modal)
Creates a modal or non-modal dialog with the specified title and the specified owner Frame. If owner is null, a shared, hidden frame will be set as the owner of this dialog. All constructors defer to this one.

NOTE: Any popup components (JComboBox, JPopupMenu, JMenuBar) created within a modal dialog will be forced to be lightweight.

This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale.

Parameters:
owner - the Frame from which the dialog is displayed
title - the String to display in the dialog's title bar
modal - true for a modal dialog, false for one that allows other windows to be active at the same time returns true.
Method Detail

setTitle

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

Parameters:
t - the title displayed in the dialog's border; a null value results in an empty title

getTitle

public String getTitle()
Gets the title of the dialog. The title is displayed in the dialog's border.

Returns:
the title of this dialog window. The title may be null.

setIcon

public void setIcon(SIcon i)

getIcon

public SIcon getIcon()

isModal

public boolean isModal()

setModal

public void setModal(boolean modal)

isDraggable

public boolean isDraggable()

setDraggable

public void setDraggable(boolean draggable)

hide

public void hide()
Description copied from class: SWindow
Remove this window from its frame.

Overrides:
hide in class SWindow

setClosable

public void setClosable(boolean v)

isClosable

public boolean isClosable()

setCG

public void setCG(DialogCG cg)


wingS Swings ;-)