org.tbee.swing.glasspane
Class GlassOptionDialog
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.tbee.swing.glasspane.GlassPanel
org.tbee.swing.glasspane.GlassWindow
org.tbee.swing.glasspane.GlassFrame
org.tbee.swing.glasspane.GlassDialog
org.tbee.swing.glasspane.GlassOptionDialog
- All Implemented Interfaces:
- ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
public class GlassOptionDialog
- extends GlassDialog
- implements ActionListener
Default support for yes, no, cancel, etc buttons.
Use through the show methods.
- Version:
- $Revision: 1.12 $
- See Also:
- Serialized Form
|
Method Summary |
void |
actionPerformed(ActionEvent e)
|
void |
addActionListener(ActionListener actionListener)
ActionListener |
protected void |
closeIconClicked()
When close is clicked, there is no last button |
void |
fireActionListener(ActionEvent e)
|
boolean |
isCancel()
|
boolean |
isClose()
close was clicked, not any of the other buttons |
boolean |
isNo()
|
boolean |
isOk()
|
boolean |
isYes()
determine which button was clicked |
void |
removeActionListener(ActionListener actionListener)
|
protected void |
requestFocusOnButton(GlassOptionDialog.BUTTON_ID button)
|
void |
setButton(GlassOptionDialog.BUTTON_ID buttonId,
JButton button)
|
protected void |
showButtons(List<GlassOptionDialog.BUTTON_ID> buttons,
GlassOptionDialog.BUTTON_ID defaultButton)
|
static GlassOptionDialog |
showDialog(JFrame frame,
String title,
Icon icon,
Component component,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons)
|
static GlassOptionDialog |
showDialog(JFrame frame,
String title,
Icon icon,
Component component,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons,
GlassOptionDialog.BUTTON_ID defaultButton)
|
static GlassOptionDialog |
showDialog(JFrame frame,
String title,
Icon icon,
String text,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons)
|
static GlassOptionDialog |
showDialog(JFrame frame,
String title,
Icon icon,
String text,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons,
GlassOptionDialog.BUTTON_ID defaultButton)
|
static GlassOptionDialog |
showOk(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showOk(JFrame frame,
String title,
Icon icon,
String text)
|
static GlassOptionDialog |
showOkAndWait(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showOkAndWait(JFrame frame,
String title,
Icon icon,
String text)
|
static GlassOptionDialog |
showOkCancel(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showOkCancel(JFrame frame,
String title,
Icon icon,
String text)
|
static GlassOptionDialog |
showOkCancelAndWait(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showOkCancelAndWait(JFrame frame,
String title,
Icon icon,
String text)
|
static GlassOptionDialog |
showYesNo(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showYesNo(JFrame frame,
String title,
Icon icon,
String text)
|
static GlassOptionDialog |
showYesNoAndWait(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showYesNoAndWait(JFrame frame,
String title,
Icon icon,
String text)
|
static GlassOptionDialog |
showYesNoCancel(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showYesNoCancel(JFrame frame,
String title,
Icon icon,
String text)
|
static GlassOptionDialog |
showYesNoCancel(JFrame frame,
String title,
Icon icon,
String text,
GlassOptionDialog.BUTTON_ID defaultButton)
|
static GlassOptionDialog |
showYesNoCancelAndWait(JFrame frame,
String title,
Icon icon,
Component component)
|
static GlassOptionDialog |
showYesNoCancelAndWait(JFrame frame,
String title,
Icon icon,
String text)
|
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle |
SOURCECODE_VERSION
public static final String SOURCECODE_VERSION
- Standard variable for determining version of a class file.
- See Also:
- Constant Field Values
iResourceBundle
protected ResourceBundle iResourceBundle
GlassOptionDialog
protected GlassOptionDialog(JFrame frame,
String title)
- Parameters:
frame -
GlassOptionDialog
protected GlassOptionDialog(JFrame frame,
String title,
GlassOptionDialog.BUTTON_ID[] buttons)
- Parameters:
frame -
GlassOptionDialog
protected GlassOptionDialog(JFrame frame,
String title,
GlassOptionDialog.BUTTON_ID[] buttons,
GlassOptionDialog.BUTTON_ID defaultButton)
- Parameters:
frame -
isYes
public boolean isYes()
- determine which button was clicked
isOk
public boolean isOk()
isNo
public boolean isNo()
isCancel
public boolean isCancel()
isClose
public boolean isClose()
- close was clicked, not any of the other buttons
setButton
public void setButton(GlassOptionDialog.BUTTON_ID buttonId,
JButton button)
- Parameters:
buttonId - button -
showButtons
protected void showButtons(List<GlassOptionDialog.BUTTON_ID> buttons,
GlassOptionDialog.BUTTON_ID defaultButton)
requestFocusOnButton
protected void requestFocusOnButton(GlassOptionDialog.BUTTON_ID button)
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed in interface ActionListener
closeIconClicked
protected void closeIconClicked()
- When close is clicked, there is no last button
- Overrides:
closeIconClicked in class GlassFrame
addActionListener
public void addActionListener(ActionListener actionListener)
- ActionListener
removeActionListener
public void removeActionListener(ActionListener actionListener)
fireActionListener
public void fireActionListener(ActionEvent e)
showDialog
public static GlassOptionDialog showDialog(JFrame frame,
String title,
Icon icon,
Component component,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons,
GlassOptionDialog.BUTTON_ID defaultButton)
showDialog
public static GlassOptionDialog showDialog(JFrame frame,
String title,
Icon icon,
Component component,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons)
showDialog
public static GlassOptionDialog showDialog(JFrame frame,
String title,
Icon icon,
String text,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons)
showDialog
public static GlassOptionDialog showDialog(JFrame frame,
String title,
Icon icon,
String text,
boolean block,
GlassOptionDialog.BUTTON_ID[] buttons,
GlassOptionDialog.BUTTON_ID defaultButton)
showOk
public static GlassOptionDialog showOk(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showOk
public static GlassOptionDialog showOk(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - text -
- Returns:
showOkAndWait
public static GlassOptionDialog showOkAndWait(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showOkAndWait
public static GlassOptionDialog showOkAndWait(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - text -
- Returns:
showOkCancel
public static GlassOptionDialog showOkCancel(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showOkCancel
public static GlassOptionDialog showOkCancel(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - text -
- Returns:
showOkCancelAndWait
public static GlassOptionDialog showOkCancelAndWait(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showOkCancelAndWait
public static GlassOptionDialog showOkCancelAndWait(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - text -
- Returns:
showYesNo
public static GlassOptionDialog showYesNo(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showYesNo
public static GlassOptionDialog showYesNo(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - component -
- Returns:
showYesNoAndWait
public static GlassOptionDialog showYesNoAndWait(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showYesNoAndWait
public static GlassOptionDialog showYesNoAndWait(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - text -
- Returns:
showYesNoCancel
public static GlassOptionDialog showYesNoCancel(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showYesNoCancel
public static GlassOptionDialog showYesNoCancel(JFrame frame,
String title,
Icon icon,
String text,
GlassOptionDialog.BUTTON_ID defaultButton)
- Parameters:
frame - title - icon - text - defaultButton -
- Returns:
showYesNoCancel
public static GlassOptionDialog showYesNoCancel(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - text -
- Returns:
showYesNoCancelAndWait
public static GlassOptionDialog showYesNoCancelAndWait(JFrame frame,
String title,
Icon icon,
String text)
- Parameters:
frame - title - icon - text -
- Returns:
showYesNoCancelAndWait
public static GlassOptionDialog showYesNoCancelAndWait(JFrame frame,
String title,
Icon icon,
Component component)
- Parameters:
frame - title - icon - text -
- Returns:
Copyright © 2011 KnowledgePlaza. All Rights Reserved.