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.AccessibleJDialog
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
protected JPanel
protected ArrayList
protected boolean
protected JButton
protected JPanel
protected Gripper
protected Dimension
protected JCheckBox
protected JPanel
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields 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 specifiedFrame
owner.Creates a non-modal dialog without a title with the specifedDialog
as 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 specifedFrame
as 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 TypeMethodDescriptionvoid
Adds the specified button to the right most position on the button panel which is at the bottom of the dialog.protected static ResourceBundle
void
Hides the help button on the dialog.protected void
initPFCDialog
(JPanel topPanel, JPanel mainPanel) protected void
boolean
Returns whether the "Save As Default" check box is being checked.protected void
protected void
void
Displays a Help button at the left most position of the button panel which displays a help page for the specified help ID.void
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.void
setMainPanel
(JPanel mainPanel) Sets the main panel in the dialog to be displayed.protected void
protected void
void
Displays a "Save as default" check box in between the help button and the button group.void
setTopPanel
(JPanel topPanel) Sets the top panel in the dialog to be displayed.void
setVisible
(boolean b) static int
showConfirmDialog
(Component owner, String title, JPanel topPanel, JComponent mainPanel) Convenience wrapper that manages the button display automatically.static int
showConfirmDialog
(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, update
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
Methods 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, 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, 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, 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, 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 specifedDialog
as its owner.- Parameters:
owner
- theDialog
from which the dialog is displayed
-
PFCDialog
Creates a modal or non-modal dialog without a title and with the specified owner dialog.- Parameters:
owner
- theDialog
from 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
- theDialog
from which the dialog is displayedtitle
- theString
to 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
- theDialog
from which the dialog is displayedtitle
- theString
to 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
- theDialog
from which the dialog is displayedtitle
- theString
to display in the dialog's title barmainPanel
- theJPanel
to 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
- theDialog
from which the dialog is displayedtitle
- theString
to display in the dialog's title bartopPanel
- theJPanel
to display in the dialog's top areamainPanel
- theJPanel
to 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 specifiedFrame
owner. A shared, hidden frame will be set as the owner of the dialog. -
PFCDialog
Creates a non-modal dialog without a title with the specifedFrame
as its owner.- Parameters:
owner
- theFrame
from which the dialog is displayed
-
PFCDialog
Creates a modal or non-modal dialog without a title and with the specified ownerFrame
.- Parameters:
owner
- theFrame
from 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
- theFrame
from which the dialog is displayedtitle
- theString
to 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
- theFrame
from which the dialog is displayedtitle
- theString
to 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
- theFrame
from which the dialog is displayedtitle
- theString
to display in the dialog's title barmainPanel
- theJPanel
to 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
- theFrame
from which the dialog is displayedtitle
- theString
to display in the dialog's title bartopPanel
- theJPanel
to display in the dialog's top areamainPanel
- theJPanel
to 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
- theFrame
from which the dialog is displayedtitle
- theString
to display in the dialog's title bartopPanel
- theJPanel
to display in the dialog's top areamainPanel
- theJPanel
to 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
- theComponent
on which to center this dialog. This component should be in a JFrametitle
- theString
to display in the dialog's title bartopPanel
- theJPanel
to display in the dialog's top areamainPanel
- theJPanel
to 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:
setVisible
in 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
-