|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
dip.gui.dialog.XDialog
dip.gui.dialog.HeaderDialog
A Dialog with an HTML message header at the top, which may be of fixed height (or adjust to fit).
A configurable lower bar (usually for buttons) is also available. Components other than buttons may be added to this lower bar. Any component that implements JButton can be used as a default button, and/or close button. Components are added from the left to right.
All buttons must have an action command set if they call the close() method. Buttons created with the convenience methods will have an action command set.
Nested Class Summary | |
static class |
HeaderDialog.GradientXJEditorPane
A gradient-shaded background XJEditorPane with a stylish bottom separator. |
Nested classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static java.lang.String |
ACTION_ACCEPT
Accept button Action Command; constant across languages |
static java.lang.String |
ACTION_CANCEL
Cancel Button Action Command; constant across languages |
static java.lang.String |
ACTION_CLOSE
Close Button Action Command; constant across languages |
static java.lang.String |
ACTION_OK
OK Button Action Command; constant across languages |
static int |
BTN_BAR_BETWEEN
Default spacint between buttun bar buttons |
static int |
BTN_BAR_EDGE
Default margin between button bar edge and components |
protected javax.swing.JEditorPane |
header
|
Fields inherited from class dip.gui.dialog.XDialog |
TEXT_ACCEPT, TEXT_CANCEL, TEXT_CLOSE, TEXT_OK |
Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
HeaderDialog(javax.swing.JFrame parent,
java.lang.String title,
boolean isModal)
Create a Dialog with a HTML-aware Header |
Method Summary | |
void |
addSingleButton(javax.swing.JButton button)
Convenience method: for dialogs with ONE button, and no other components to be added to the button bar, adds the given button to the button bar, with the appropriate spacing. |
void |
addToButtonPanel(java.awt.Component component)
Add a component to the button bar (left to right) |
void |
addTwoButtons(javax.swing.JButton rightMost,
javax.swing.JButton leftMost,
boolean rightDefault,
boolean rightClose)
Convenience method: for dialogs with TWO buttons, and no other components to be added to the button bar, adds the given buttons to the button bar, with the appropriate spacing. |
protected void |
close()
Do not override this method! |
protected void |
close(java.lang.String actionCommand)
Called when the dialog is closing. |
void |
createDefaultContentBorder(javax.swing.JComponent comp)
Creates a default border around the given component, of BTN_BAR_EDGE size, except at bottom. |
javax.swing.JButton |
getButton(int i)
Get the JButton of the given index; throws an exception if index is out of bounds. |
java.awt.Container |
getContentPane()
Get the content panel |
javax.swing.JButton |
getDefaultButton()
Get the default button |
java.lang.String |
getReturnedActionCommand()
Get the returned JButton ActionCommand used to close the dialog. |
boolean |
isCloseOrCancel(java.lang.String actionCommand)
Convenience method: check if action command is Close or Cancel |
boolean |
isOKorAccept(java.lang.String actionCommand)
Convenience method: check if action command is OK or Accept |
javax.swing.JButton |
makeAcceptButton()
Make an "Accept" button (i18n); calls close with self. |
javax.swing.JButton |
makeButton(java.lang.String text,
java.lang.String actionCommand,
boolean doClose)
Make a button with the given text; calls close() with self if boolean flag is set to 'true'. |
javax.swing.JButton |
makeCancelButton()
Make an "Cancel" button (i18n); calls close with self. |
javax.swing.JButton |
makeCloseButton()
Make an "Close" button (i18n); calls close with self. |
static java.awt.Component |
makeGlue()
Make a glue component (takes up as much space as possible) |
javax.swing.JButton |
makeOKButton()
Make an "OK" button (i18n); calls close with self. |
static java.awt.Component |
makeSpacer(int width)
Make a spacer of the desired width in pixels |
void |
setContentPane(java.awt.Container container)
Set the dialog content; this may be called at any time. |
void |
setDefaultButton(javax.swing.JButton btn)
Set the button that is focus-selected by default |
void |
setDefaultCloseButton(javax.swing.JButton btn)
Sets the JButton that the close(actionCommand) method will have as its argument. |
void |
setHeaderText(java.lang.String text)
Set the header text |
void |
setHeaderVisible(boolean value)
Show or hide the header. |
void |
setSeparatorVisible(boolean value,
int horizontalMargin,
int verticalMargin)
Show or Hide the separator between the button and content panels. |
Methods inherited from class dip.gui.dialog.XDialog |
createRootPane, dialogInit, setDefaultCloseOperation, setHelpID |
Methods inherited from class javax.swing.JDialog |
addImpl, getAccessibleContext, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int BTN_BAR_EDGE
public static final int BTN_BAR_BETWEEN
public static final java.lang.String ACTION_OK
public static final java.lang.String ACTION_CLOSE
public static final java.lang.String ACTION_CANCEL
public static final java.lang.String ACTION_ACCEPT
protected javax.swing.JEditorPane header
Constructor Detail |
public HeaderDialog(javax.swing.JFrame parent, java.lang.String title, boolean isModal)
Method Detail |
public void setContentPane(java.awt.Container container)
public java.awt.Container getContentPane()
public void addToButtonPanel(java.awt.Component component)
public void setDefaultButton(javax.swing.JButton btn)
public javax.swing.JButton getDefaultButton()
public javax.swing.JButton getButton(int i)
Index 0 is the leftmost button.
public void setDefaultCloseButton(javax.swing.JButton btn)
protected void close(java.lang.String actionCommand)
protected final void close()
close
in class XDialog
public javax.swing.JButton makeOKButton()
public javax.swing.JButton makeCancelButton()
public javax.swing.JButton makeCloseButton()
public javax.swing.JButton makeAcceptButton()
public boolean isOKorAccept(java.lang.String actionCommand)
public boolean isCloseOrCancel(java.lang.String actionCommand)
public javax.swing.JButton makeButton(java.lang.String text, java.lang.String actionCommand, boolean doClose)
public static java.awt.Component makeSpacer(int width)
public static java.awt.Component makeGlue()
public void addSingleButton(javax.swing.JButton button)
public void addTwoButtons(javax.swing.JButton rightMost, javax.swing.JButton leftMost, boolean rightDefault, boolean rightClose)
Typically, the "cancel" button is the rightmost, and is the same as the default dialog close button.
public void createDefaultContentBorder(javax.swing.JComponent comp)
public void setSeparatorVisible(boolean value, int horizontalMargin, int verticalMargin)
public void setHeaderVisible(boolean value)
public java.lang.String getReturnedActionCommand()
public void setHeaderText(java.lang.String text)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |