Package com.portal.pfc.ui
Class PFCDialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
com.portal.pfc.ui.PFCDialog
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,RootPaneContainer,WindowConstants
- Direct Known Subclasses:
AboutDialog
Wrapper around a JDialog that displays a dialog as prescribed by
the Portal UI guidelines. The appropriate borders, spacing, etc.
are automatically applied - you simply provide the contents.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected JPanelprotected ArrayListprotected booleanprotected JButtonprotected JPanelprotected Gripperprotected Dimensionprotected JCheckBoxprotected JPanelFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a non-modal dialog without a title and without a specifiedFrameowner.Creates a non-modal dialog without a title with the specifedDialogas its owner.Creates a modal or non-modal dialog without a title and with the specified owner dialog.Creates a non-modal dialog with the specified title and with the specified owner dialog.Creates a modal or non-modal dialog with the specified title and the specified owner frame.Creates a modal or non-modal dialog with the specified title, the specified owner frame and the specified main panel.Creates a modal or non-modal dialog with the specified title, the specified owner frame, the specified main panel and the specified top panel.Creates a non-modal dialog without a title with the specifedFrameas its owner.Creates a modal or non-modal dialog without a title and with the specified ownerFrame.Creates a non-modal dialog with the specified title and with the specified owner frame.Creates a modal or non-modal dialog with the specified title and the specified ownerFrame.Creates a modal or non-modal dialog with the specified title, the specified owner frame and the specified main panel.Creates a modal or non-modal dialog with the specified title, the specified owner frame, the specified main panel and the specified top panel. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified button to the right most position on the button panel which is at the bottom of the dialog.protected static ResourceBundlevoidHides the help button on the dialog.protected voidinitPFCDialog(JPanel topPanel, JPanel mainPanel) protected voidbooleanReturns whether the "Save As Default" check box is being checked.protected voidprotected voidvoidDisplays a Help button at the left most position of the button panel which displays a help page for the specified help ID.voidDisplays a Help button with the specified icon at the left most position of the button panel which displays a help page for the specified help ID.voidsetMainPanel(JPanel mainPanel) Sets the main panel in the dialog to be displayed.protected voidprotected voidvoidDisplays a "Save as default" check box in between the help button and the button group.voidsetTopPanel(JPanel topPanel) Sets the top panel in the dialog to be displayed.voidsetVisible(boolean b) static intshowConfirmDialog(Component owner, String title, JPanel topPanel, JComponent mainPanel) Convenience wrapper that manages the button display automatically.static intshowConfirmDialog(Component owner, String title, JPanel topPanel, JComponent mainPanel, JTextField tf) Convenience wrapper that manages the button display automatically.Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
mHelpButton
-
mSaveAsDefaultChkBox
-
mTopPanel
-
mMainPanel
-
mBtnPanel
-
mOuterPanel
-
mPreferredBtnSize
-
mButtonsArray
-
mDialogInitialized
protected boolean mDialogInitialized -
BUTTON_START_LOCATION
protected static final int BUTTON_START_LOCATION- See Also:
-
-
Constructor Details
-
PFCDialog
Creates a non-modal dialog without a title with the specifedDialogas its owner.- Parameters:
owner- theDialogfrom which the dialog is displayed
-
PFCDialog
Creates a modal or non-modal dialog without a title and with the specified owner dialog.- Parameters:
owner- theDialogfrom which the dialog is displayedmodal- true for a modal dialog, false for one that allows other windows to be active at the same time
-
PFCDialog
Creates a non-modal dialog with the specified title and with the specified owner dialog.- Parameters:
owner- theDialogfrom which the dialog is displayedtitle- theStringto display in the dialog's title bar
-
PFCDialog
Creates a modal or non-modal dialog with the specified title and the specified owner frame.- Parameters:
owner- theDialogfrom which the dialog is displayedtitle- theStringto display in the dialog's title barmodal- true for a modal dialog, false for one that allows other windows to be active at the same time
-
PFCDialog
Creates a modal or non-modal dialog with the specified title, the specified owner frame and the specified main panel.- Parameters:
owner- theDialogfrom which the dialog is displayedtitle- theStringto display in the dialog's title barmainPanel- theJPanelto display in the dialog's main areamodal- true for a modal dialog, false for one that allows other windows to be active at the same time
-
PFCDialog
Creates a modal or non-modal dialog with the specified title, the specified owner frame, the specified main panel and the specified top panel.- Parameters:
owner- theDialogfrom which the dialog is displayedtitle- theStringto display in the dialog's title bartopPanel- theJPanelto display in the dialog's top areamainPanel- theJPanelto display in the dialog's main areamodal- true for a modal dialog, false for one that allows other windows to be active at the same time
-
PFCDialog
public PFCDialog()Creates a non-modal dialog without a title and without a specifiedFrameowner. A shared, hidden frame will be set as the owner of the dialog. -
PFCDialog
Creates a non-modal dialog without a title with the specifedFrameas its owner.- Parameters:
owner- theFramefrom which the dialog is displayed
-
PFCDialog
Creates a modal or non-modal dialog without a title and with the specified ownerFrame.- Parameters:
owner- theFramefrom which the dialog is displayedmodal- true for a modal dialog, false for one that allows others windows to be active at the same time
-
PFCDialog
Creates a non-modal dialog with the specified title and with the specified owner frame.- Parameters:
owner- theFramefrom which the dialog is displayedtitle- theStringto display in the dialog's title bar
-
PFCDialog
Creates a modal or non-modal dialog with the specified title and the specified ownerFrame. All constructors defer to this one.NOTE: Any popup components (
JComboBox,JPopupMenu,JMenuBar) created within a modal dialog will be forced to be lightweight.- Parameters:
owner- theFramefrom which the dialog is displayedtitle- theStringto display in the dialog's title barmodal- true for a modal dialog, false for one that allows other windows to be active at the same time
-
PFCDialog
Creates a modal or non-modal dialog with the specified title, the specified owner frame and the specified main panel.- Parameters:
owner- theFramefrom which the dialog is displayedtitle- theStringto display in the dialog's title barmainPanel- theJPanelto display in the dialog's main areamodal- true for a modal dialog, false for one that allows other windows to be active at the same time
-
PFCDialog
Creates a modal or non-modal dialog with the specified title, the specified owner frame, the specified main panel and the specified top panel.- Parameters:
owner- theFramefrom which the dialog is displayedtitle- theStringto display in the dialog's title bartopPanel- theJPanelto display in the dialog's top areamainPanel- theJPanelto display in the dialog's main areamodal- true for a modal dialog, false for one that allows other windows to be active at the same time
-
-
Method Details
-
showConfirmDialog
public static int showConfirmDialog(Component owner, String title, JPanel topPanel, JComponent mainPanel) Convenience wrapper that manages the button display automatically. 2 buttons are displayed, OK and CANCEL.- Parameters:
owner- theFramefrom which the dialog is displayedtitle- theStringto display in the dialog's title bartopPanel- theJPanelto display in the dialog's top areamainPanel- theJPanelto display in the dialog's main area- Returns:
- One of JOptionPane.OK or JOptionPane.CANCEL
-
showConfirmDialog
public static int showConfirmDialog(Component owner, String title, JPanel topPanel, JComponent mainPanel, JTextField tf) Convenience wrapper that manages the button display automatically. 2 buttons are displayed, OK and CANCEL. If the textfield parameter is non-null, the assumption is that this textfield is contained within the dialog and the caller wants the user to be able to hit Enter and impact the OK button.- Parameters:
owner- theComponenton which to center this dialog. This component should be in a JFrametitle- theStringto display in the dialog's title bartopPanel- theJPanelto display in the dialog's top areamainPanel- theJPanelto display in the dialog's main areatf- JTextField contained in either the topPanel or mainPanel. Hitting the Enter key in the textfield will have the same effect as the user pressing the OK button.- Returns:
- One of JOptionPane.OK or JOptionPane.CANCEL
-
setTopPanel
Sets the top panel in the dialog to be displayed.- Parameters:
topPanel- the top panel to be displayed in this dialog
-
setMainPanel
Sets the main panel in the dialog to be displayed.- Parameters:
mainPanel- the main panel to be displayed in this dialog
-
setVisible
public void setVisible(boolean b) - Overrides:
setVisiblein classDialog
-
addButton
Adds the specified button to the right most position on the button panel which is at the bottom of the dialog.- Parameters:
button- the button will be added to the end of the button panel
-
setHelpID
Displays a Help button at the left most position of the button panel which displays a help page for the specified help ID.- Parameters:
helpID- the help ID to be associated with the help button.
-
setHelpID
Displays a Help button with the specified icon at the left most position of the button panel which displays a help page for the specified help ID.- Parameters:
helpIcon- the icon to be display on the help button.helpID- the help ID to be associated with the help button.
-
hideHelpButton
public void hideHelpButton()Hides the help button on the dialog. -
setSaveAsDefault
public void setSaveAsDefault()Displays a "Save as default" check box in between the help button and the button group. -
isSaveAsDefault
public boolean isSaveAsDefault()Returns whether the "Save As Default" check box is being checked. -
setCentered
protected void setCentered() -
initPFCDialog
-
getResourceBundle
-
initPFCDialogLayout
protected void initPFCDialogLayout() -
setPanelsLnF
protected void setPanelsLnF() -
setPreferredBtnSize
protected void setPreferredBtnSize() -
setColors
-