Package org.basex.gui.layout
Class BaseXDialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.basex.gui.layout.BaseXDialog
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,RootPaneContainer,WindowConstants,BaseXWindow
- Direct Known Subclasses:
DialogAbout,DialogBindings,DialogColors,DialogEdit,DialogExport,DialogFonts,DialogInsert,DialogLine,DialogManage,DialogMem,DialogMessage,DialogNew,DialogPackages,DialogPass,DialogPrefs,DialogProgress,DialogProps,DialogSort
This superclass in inherited by all dialog windows.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
- 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 TypeFieldDescriptionReference to the main window.final KeyListenerKey listener, triggering an action with each click.protected booleanRemembers if the window was correctly closed.protected BaseXBackReference to the root panel.Fields 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
ConstructorsModifierConstructorDescriptionprotectedBaseXDialog(GUI gui, String title) Constructor, called from the main window.protectedBaseXDialog(GUI gui, String title, boolean modal) Constructor, called from the main window.protectedBaseXDialog(BaseXDialog dialog, String title) Constructor, called from a dialog window. -
Method Summary
Modifier and TypeMethodDescriptionvoidReacts on user input; can be overwritten.static voidBrowses the specified url.voidcancel()Cancels the dialog; can be overwritten.voidclose()Closes the dialog and stores the location of the dialog window; can be overwritten.Returns the window reference.static booleanStatic yes/no dialog.dialog()Returns the dialog.voiddispose()protected static voidenableOK(JComponent panel, String label, boolean enabled) Enables/disables a button in the specified panel.static voidStatic error dialog.protected final voidfinish()Finalizes the dialog layout and sets it visible.gui()Returns the GUI.final booleanmodal()Indicates if this is a modal dialog.final BaseXBacknewButtons(Object... buttons) Creates a new button list.final booleanok()States if the dialog window was confirmed or canceled.protected final BaseXBackokCancel()Creates a OK and CANCEL button.protected final voidSets a component at the specifiedBorderLayoutposition.static StringyesNoCancel(GUI gui, String text, String... buttons) Static yes/no/cancel dialog.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, setVisible, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, 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
-
gui
Reference to the main window. -
ok
protected boolean okRemembers if the window was correctly closed. -
panel
Reference to the root panel. -
keys
Key listener, triggering an action with each click.
-
-
Constructor Details
-
BaseXDialog
Constructor, called from a dialog window.- Parameters:
dialog- calling dialogtitle- dialog title
-
BaseXDialog
Constructor, called from the main window.- Parameters:
gui- reference to the main windowtitle- dialog title
-
BaseXDialog
Constructor, called from the main window.- Parameters:
gui- reference to the main windowtitle- dialog titlemodal- modal flag
-
-
Method Details
-
set
Sets a component at the specifiedBorderLayoutposition.- Parameters:
comp- component to be addedpos- layout position
-
finish
protected final void finish()Finalizes the dialog layout and sets it visible. -
action
Reacts on user input; can be overwritten.- Parameters:
source- source
-
cancel
public void cancel()Cancels the dialog; can be overwritten. -
close
public void close()Closes the dialog and stores the location of the dialog window; can be overwritten. -
dispose
public void dispose() -
modal
public final boolean modal()Indicates if this is a modal dialog.- Returns:
- result of check
-
ok
public final boolean ok()States if the dialog window was confirmed or canceled.- Returns:
- true when dialog was confirmed
-
okCancel
Creates a OK and CANCEL button.- Returns:
- button list
-
newButtons
Creates a new button list.- Parameters:
buttons- button names or objects- Returns:
- button list
-
enableOK
Enables/disables a button in the specified panel.- Parameters:
panel- button panellabel- button labelenabled- enabled/disabled
-
yesNoCancel
Static yes/no/cancel dialog. Returnsnullif the dialog was canceled.- Parameters:
gui- parent referencetext- textbuttons- additional buttons- Returns:
- chosen action (
Text.B_YES,Text.B_NO,Text.B_CANCEL)
-
confirm
Static yes/no dialog.- Parameters:
gui- parent referencetext- text- Returns:
trueif dialog was confirmed
-
error
Static error dialog.- Parameters:
gui- parent referencetext- text
-
browse
Browses the specified url.- Parameters:
gui- parent referenceurl- url to be browsed
-
gui
Description copied from interface:BaseXWindowReturns the GUI.- Specified by:
guiin interfaceBaseXWindow- Returns:
- GUI
-
dialog
Description copied from interface:BaseXWindowReturns the dialog.- Specified by:
dialogin interfaceBaseXWindow- Returns:
- dialog (can be
null)
-
component
Description copied from interface:BaseXWindowReturns the window reference.- Specified by:
componentin interfaceBaseXWindow- Returns:
- window
-