public class MultiplePageDialog extends StandardDialog
StandardDialog.DefaultStandardDialogPane
JDialog.AccessibleJDialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
JTree |
_tree |
static int |
ICON_STYLE
Predefined style of multiple page dialog.
|
static int |
LIST_STYLE
Predefined style of multiple page dialog.
|
static int |
TAB_STYLE
Predefined style of multiple page dialog.
|
static int |
TREE_STYLE
Predefined style of multiple page dialog.
|
_propertyChangeListener, _standardDialogPane, RESULT_AFFIRMED, RESULT_CANCELLED
accessibleContext, rootPane, rootPaneCheckingEnabled
DEFAULT_MODALITY_TYPE
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
APPLY, BACK, BROWSE, CANCEL, CLEAR, CLOSE, DETAILS, EDIT, EXIT, FIND, FIND_NEXT, FINISH, FORWARD, HELP, NEW, NEXT, NO, OK, OPEN, PRINT, REPLACE, RESET, RETRY, RUN, SAVE, SAVE_AS, STOP, YES
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
MultiplePageDialog()
Creates a non-modal MultiplePageDialog without a title and without a specified
Frame owner. |
MultiplePageDialog(Dialog owner)
Creates a non-modal MultiplePageDialog without a title with the specified
Dialog as its owner. |
MultiplePageDialog(Dialog owner,
boolean modal)
Creates a modal or non-modal MultiplePageDialog without a title and with the specified owner
Dialog . |
MultiplePageDialog(Dialog owner,
boolean modal,
int style) |
MultiplePageDialog(Dialog owner,
int style) |
MultiplePageDialog(Dialog owner,
String title)
Creates a non-modal MultiplePageDialog with the specified title and with the specified owner frame.
|
MultiplePageDialog(Dialog owner,
String title,
boolean modal)
Creates a modal or non-modal dialog with the specified title and the specified owner
Dialog . |
MultiplePageDialog(Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc) |
MultiplePageDialog(Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc,
int style) |
MultiplePageDialog(Dialog owner,
String title,
boolean modal,
int style)
Creates a modal or non-modal MultiplePageDialog with the specified style, the specified title and the specified
owner
Dialog . |
MultiplePageDialog(Dialog owner,
String title,
int style) |
MultiplePageDialog(Frame owner)
Creates a non-modal MultiplePageDialog without a title with the specified
Frame as its owner. |
MultiplePageDialog(Frame owner,
boolean modal)
Creates a modal or non-modal MultiplePageDialog without a title and with the specified owner
Frame . |
MultiplePageDialog(Frame owner,
boolean modal,
int style) |
MultiplePageDialog(Frame owner,
int style) |
MultiplePageDialog(Frame owner,
String title)
Creates a non-modal MultiplePageDialog with the specified title and with the specified owner frame.
|
MultiplePageDialog(Frame owner,
String title,
boolean modal)
Creates a modal or non-modal dialog with the specified title and the specified owner
Frame . |
MultiplePageDialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc) |
MultiplePageDialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc,
int style) |
MultiplePageDialog(Frame owner,
String title,
boolean modal,
int style)
Creates a modal or non-modal MultiplePageDialog with the specified style, the specified title and the specified
owner
Frame . |
MultiplePageDialog(Frame owner,
String title,
int style) |
MultiplePageDialog(int style) |
MultiplePageDialog(Window owner) |
MultiplePageDialog(Window owner,
Dialog.ModalityType modalityType) |
MultiplePageDialog(Window owner,
Dialog.ModalityType modalityType,
int style) |
MultiplePageDialog(Window owner,
int style) |
MultiplePageDialog(Window owner,
String title) |
MultiplePageDialog(Window owner,
String title,
Dialog.ModalityType modalityType) |
MultiplePageDialog(Window owner,
String title,
Dialog.ModalityType modalityType,
GraphicsConfiguration gc) |
MultiplePageDialog(Window owner,
String title,
Dialog.ModalityType modalityType,
GraphicsConfiguration gc,
int style) |
MultiplePageDialog(Window owner,
String title,
Dialog.ModalityType modalityType,
int style) |
MultiplePageDialog(Window owner,
String title,
int style) |
Modifier and Type | Method and Description |
---|---|
protected void |
configureTree(JTree tree)
Configure the JTree used in TREE_STYLE dialog.
|
JComponent |
createBannerPanel()
Implements the method in StandardDialog.
|
ButtonPanel |
createButtonPanel()
Creates the button panel.
|
JComponent |
createContentPanel()
Implements the method in StandardDialog.
|
protected JideButton |
createIconButton(String title,
Icon icon)
Creates the button for each icon.
|
protected ButtonPanel |
createIconButtonPanel()
Creates the ButtonPanel used by IconPanel.
|
protected JComponent |
createIconPanel()
Creates the panel that contains several icons.
|
JComponent |
createIndexPanel()
Creates the index panel based on the style.
|
protected JList |
createList(DefaultListModel listModel)
Creates list that is used in LIST_STYLE dialog's index panel.
|
protected ListCellRenderer |
createListCellRenderer()
Creates a list cell renderer used by list in LIST_STYLE dialog's index panel.
|
protected JComponent |
createPagesPanel()
Creates the pages panel.
|
protected JTabbedPane |
createTabbedPane()
Creates the JTabbedPane used by TAB_STYLE dialog.
|
protected JTree |
createTree(DefaultMutableTreeNode root)
Creates tree that is used in TREE_STYLE dialog's index panel.
|
protected TreeCellRenderer |
createTreeCellRenderer()
Creates the tree cell renderer used by tree in TREE_STYLE dialog's index panel.
|
protected MutableTreeNode |
createTreeNode(AbstractDialogPage dialogPage)
Create tree node for TREE_STYLE pages.
|
JButton |
getApplyButton()
Gets the apply button.
|
JButton |
getCancelButton()
Gets the cancel button.
|
AbstractDialogPage |
getCurrentPage()
Gets the current selected page.
|
JComponent |
getIndexPanel()
Gets the index panel.
|
String |
getInitialPageTitle()
Gets the initial page title.
|
protected ListCellRenderer |
getListCellRenderer()
Gets the cell renderer used by the list.
|
JButton |
getOkButton()
Gets the OK Button only if you didn't override the createButtonPanel() and remove the OK button.
|
PageList |
getPageList()
Gets the page list of this dialog.
|
JComponent |
getPagesPanel()
Gets the pages panel.
|
int |
getStyle()
Gets the style of this dialog.
|
protected TreeCellRenderer |
getTreeCellRenderer()
Gets the cell renderer used by the tree.
|
protected void |
setCurrentPage(AbstractDialogPage currentPage) |
protected void |
setCurrentPage(AbstractDialogPage currentPage,
Object source) |
protected void |
setCurrentPage(String pageTitle) |
void |
setInitialPageTitle(String initialPageTitle)
Sets the initial page title.
|
void |
setListCellRenderer(ListCellRenderer listCellRenderer)
Sets the list cell renderer that will be used by JList when the style is LIST_STYLE.
|
void |
setPageList(PageList pageList)
Sets the page list of this dialog.
|
void |
setStyle(int style)
Sets the style of this dialog.
|
void |
setTreeCellRenderer(TreeCellRenderer treeCellRenderer)
Sets the tree cell renderer that will be used by JTree when the style is TREE_STYLE.
|
protected JComponent |
setupContentPanel(JComponent indexPanel,
JComponent pagesPanel)
Setups the content panel.
|
protected void |
showCurrentPage(AbstractDialogPage currentPage)
Displays the current page.
|
createOKCancelButtonPanel, createStandardDialogPane, getBannerPanel, getButtonPanel, getContentPanel, getDefaultAction, getDefaultCancelAction, getDialogResult, getInitFocusedComponent, getStandardDialogPane, initComponents, initialize, pack, setDefaultAction, setDefaultCancelAction, setDialogResult, setInitFocusedComponent, show
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
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, toBack
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, 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
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
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, 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, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int TAB_STYLE
public static final int TREE_STYLE
public static final int LIST_STYLE
public static final int ICON_STYLE
public JTree _tree
public MultiplePageDialog() throws HeadlessException
Frame
owner. A
shared, hidden frame will be set as the owner of the dialog. By default TAB_STYLE is used.HeadlessException
- if the page does not support mouse or key events.public MultiplePageDialog(Frame owner) throws HeadlessException
Frame
as its owner. If
owner
is null
, a shared, hidden frame will be set as the owner of the dialog. By
default TAB_STYLE is used.owner
- the owner of the dialogHeadlessException
- if the page does not support mouse or key events.public MultiplePageDialog(Frame owner, boolean modal) throws HeadlessException
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog. By
default TAB_STYLE is used.owner
- the Frame
from which the dialog is displayedmodal
- true for a modal dialog, false for one that allows others windows to be active at the same timeHeadlessException
- if the page does not support mouse or key events.public MultiplePageDialog(Frame owner, String title) throws HeadlessException
owner
is null
, a shared, hidden frame will be set as the owner of the dialog.owner
- the Frame
from which the dialog is displayedtitle
- the String
to display in the dialog's title barHeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
,
JComponent.getDefaultLocale()
public MultiplePageDialog(Frame owner, String title, boolean modal) throws HeadlessException
Frame
. If
owner
is null
, a shared, hidden frame will be set as the owner of this dialog.owner
- the Frame
from which the dialog is displayedtitle
- the String
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 timeHeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
,
JComponent.getDefaultLocale()
public MultiplePageDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc)
public MultiplePageDialog(Frame owner, String title, boolean modal, int style) throws HeadlessException
Frame
. If owner
is null
, a shared, hidden frame will be set as the
owner of this dialog. All constructors defer to this one.owner
- the Frame
from which the dialog is displayedtitle
- the String
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 timestyle
- the style. It must be one of the following: TAB_STYLE, ICON_STYLE, LIST_STYLE or TREE_STYLE.HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
,
JComponent.getDefaultLocale()
public MultiplePageDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc, int style)
public MultiplePageDialog(Dialog owner, int style)
public MultiplePageDialog(Dialog owner, boolean modal, int style)
public MultiplePageDialog(Dialog owner) throws HeadlessException
Dialog
as its owner. If
owner
is null
, a shared, hidden frame will be set as the owner of the dialog. By
default TAB_STYLE is used.owner
- the owner of the dialogHeadlessException
- if the page does not support mouse or key events.public MultiplePageDialog(Dialog owner, boolean modal) throws HeadlessException
Dialog
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog. By
default TAB_STYLE is used.owner
- the Frame
from which the dialog is displayedmodal
- true for a modal dialog, false for one that allows others windows to be active at the same timeHeadlessException
- if the page does not support mouse or key events.public MultiplePageDialog(Dialog owner, String title) throws HeadlessException
owner
is null
, a shared, hidden frame will be set as the owner of the dialog.owner
- the Frame
from which the dialog is displayedtitle
- the String
to display in the dialog's title barHeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
,
JComponent.getDefaultLocale()
public MultiplePageDialog(Dialog owner, String title, boolean modal) throws HeadlessException
Dialog
. If
owner
is null
, a shared, hidden frame will be set as the owner of this dialog.owner
- the Dialog
from which the dialog is displayedtitle
- the String
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 timeHeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
,
JComponent.getDefaultLocale()
public MultiplePageDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc)
public MultiplePageDialog(Window owner)
public MultiplePageDialog(Window owner, Dialog.ModalityType modalityType)
public MultiplePageDialog(Window owner, String title, Dialog.ModalityType modalityType)
public MultiplePageDialog(Window owner, String title, Dialog.ModalityType modalityType, GraphicsConfiguration gc)
public MultiplePageDialog(Dialog owner, String title, boolean modal, int style) throws HeadlessException
Dialog
. If owner
is null
, a shared, hidden frame will be set as the
owner of this dialog. All constructors defer to this one.owner
- the Dialog
from which the dialog is displayedtitle
- the String
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 timestyle
- the style. It must be one of the following: TAB_STYLE, ICON_STYLE, LIST_STYLE or TREE_STYLE.HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
,
JComponent.getDefaultLocale()
public MultiplePageDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc, int style)
public MultiplePageDialog(Window owner, int style)
public MultiplePageDialog(Window owner, Dialog.ModalityType modalityType, int style)
public MultiplePageDialog(Window owner, String title, Dialog.ModalityType modalityType, int style)
public MultiplePageDialog(Window owner, String title, Dialog.ModalityType modalityType, GraphicsConfiguration gc, int style)
public MultiplePageDialog(int style)
public MultiplePageDialog(Frame owner, int style)
public MultiplePageDialog(Frame owner, boolean modal, int style)
public JComponent createBannerPanel()
createBannerPanel
in class StandardDialog
public JComponent createContentPanel()
createContentPanel
in class StandardDialog
protected JComponent setupContentPanel(JComponent indexPanel, JComponent pagesPanel)
indexPanel
- the index panel. It has the nagivation control to control which page to show.pagesPanel
- the pages panel. It contains all the pages of this dialog.public ButtonPanel createButtonPanel()
createButtonPanel
in class StandardDialog
ButtonPanel
public JButton getOkButton()
public JButton getCancelButton()
public JButton getApplyButton()
protected JComponent createPagesPanel()
protected JTabbedPane createTabbedPane()
public JComponent createIndexPanel()
public void setPageList(PageList pageList)
pageList
- the page listpublic PageList getPageList()
public AbstractDialogPage getCurrentPage()
protected void setCurrentPage(String pageTitle)
protected void setCurrentPage(AbstractDialogPage currentPage)
protected void setCurrentPage(AbstractDialogPage currentPage, Object source)
protected void showCurrentPage(AbstractDialogPage currentPage)
currentPage
- the current pageprotected JTree createTree(DefaultMutableTreeNode root)
setTreeCellRenderer(javax.swing.tree.TreeCellRenderer)
to
set a new one.
UIManager.put("Tree.hash", Color.white);
return new JTree(root);
root
- the root of the treeprotected void configureTree(JTree tree)
tree.setToggleClickCount(1);
tree.setCellRenderer(createTreeCellRenderer());
tree.setRootVisible(false);
tree.setShowsRootHandles(false);
tree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
if (tree.getSelectionPath() == null) {
return;
}
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)
tree.getSelectionPath().getLastPathComponent();
// comment this while block if you want the parent page shows its own page instead
of
showing its first child page.
while (!treeNode.isLeaf()) {
final DefaultMutableTreeNode tn = treeNode;
Runnable runnable = new Runnable() {
public void run() {
tree.expandPath(new TreePath(tn.getPath()));
}
};
SwingUtilities.invokeLater(runnable);
treeNode = (DefaultMutableTreeNode) treeNode.getChildAt(0);
}
if (treeNode != null) {
Object userObject = treeNode.getUserObject();
if (userObject instanceof AbstractDialogPage) {
setCurrentPage((AbstractDialogPage) userObject, tree);
}
}
}
});
tree
- the tree to configureprotected MutableTreeNode createTreeNode(AbstractDialogPage dialogPage)
dialogPage
- the corresponding dialog page.protected JList createList(DefaultListModel listModel)
setListCellRenderer(javax.swing.ListCellRenderer)
to set a
new one.
JList list = new JList(listModel);
list.setCellRenderer(createListCellRenderer());
return list;
listModel
- the list modelprotected JComponent createIconPanel()
protected ButtonPanel createIconButtonPanel()
new
ScrollableButtonPanel(SwingConstants.TOP, ButtonPanel.SAME_SIZE)
.protected JideButton createIconButton(String title, Icon icon)
title
- the button titleicon
- the button iconpublic int getStyle()
public void setStyle(int style)
style
- It must be one of the following: TAB_STYLE, ICON_STYLE, LIST_STYLE or TREE_STYLE.public JComponent getIndexPanel()
public JComponent getPagesPanel()
protected TreeCellRenderer getTreeCellRenderer()
public void setTreeCellRenderer(TreeCellRenderer treeCellRenderer)
treeCellRenderer
- the tree cell rendererprotected ListCellRenderer getListCellRenderer()
public void setListCellRenderer(ListCellRenderer listCellRenderer)
listCellRenderer
- the list cell rendererprotected ListCellRenderer createListCellRenderer()
protected TreeCellRenderer createTreeCellRenderer()
public String getInitialPageTitle()
public void setInitialPageTitle(String initialPageTitle)
initialPageTitle
- the initial page title