T
- dialog typepublic class WebDialog<T extends WebDialog<T>> extends JDialog implements Styleable, WindowEventMethods, LanguageMethods, LanguageEventMethods, SettingsMethods, WindowMethods<T>
JDialog
extension class.
It contains various useful methods to simplify core component usage.
This component should never be used with a non-Web UIs as it might cause an unexpected behavior.
You could still use that component even if WebLaF is not your application LaF as this component will use Web-UI in any case.JDialog
,
WebRootPaneUI
,
RootPanePainter
,
Serialized FormModifier and Type | Class and Description |
---|---|
class |
WebDialog.WebDialogRootPane
Custom root pane for this
WebDialog . |
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 |
---|---|
protected boolean |
closeOnFocusLoss
Whether should close dialog on focus loss or not.
|
protected DefaultFocusTracker |
focusTracker
Window focus tracker.
|
accessibleContext, rootPane, rootPaneCheckingEnabled
DEFAULT_MODALITY_TYPE
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
WebDialog()
Creates a modeless dialog without a title and without a specified
Frame owner. |
WebDialog(Component owner)
|
WebDialog(Component owner,
String title)
|
WebDialog(Dialog owner)
Creates a modeless dialog without a title with the specified
Dialog as its owner. |
WebDialog(Dialog owner,
boolean modal)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(Dialog owner,
String title)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(Dialog owner,
String title,
boolean modal)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(Frame owner)
Creates a dialog with the specified owner
Frame . |
WebDialog(Frame owner,
boolean modal)
Creates a dialog with the specified owner
Frame . |
WebDialog(Frame owner,
String title)
Creates a dialog with the specified owner
Frame . |
WebDialog(Frame owner,
String title,
boolean modal)
Creates a dialog with the specified owner
Frame . |
WebDialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a dialog with the specified owner
Frame . |
WebDialog(StyleId id)
Creates a modeless dialog without a title and without a specified
Frame owner. |
WebDialog(StyleId id,
Component owner)
|
WebDialog(StyleId id,
Component owner,
String title)
|
WebDialog(StyleId id,
Dialog owner)
Creates a modeless dialog without a title with the specified
Dialog as its owner. |
WebDialog(StyleId id,
Dialog owner,
boolean modal)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(StyleId id,
Dialog owner,
String title)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(StyleId id,
Dialog owner,
String title,
boolean modal)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(StyleId id,
Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a dialog with the specified
Dialog as its owner. |
WebDialog(StyleId id,
Frame owner)
Creates a dialog with the specified owner
Frame . |
WebDialog(StyleId id,
Frame owner,
boolean modal)
Creates a dialog with the specified owner
Frame . |
WebDialog(StyleId id,
Frame owner,
String title)
Creates a dialog with the specified owner
Frame . |
WebDialog(StyleId id,
Frame owner,
String title,
boolean modal)
Creates a dialog with the specified owner
Frame . |
WebDialog(StyleId id,
Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a dialog with the specified owner
Frame . |
WebDialog(StyleId id,
Window owner)
Creates a modeless dialog with the specified owner
Window . |
WebDialog(StyleId id,
Window owner,
Dialog.ModalityType modalityType)
Creates a dialog with the specified owner
Window . |
WebDialog(StyleId id,
Window owner,
String title)
Creates a modeless dialog with the specified owner
Window . |
WebDialog(StyleId id,
Window owner,
String title,
Dialog.ModalityType modalityType)
Creates a dialog with the specified owner
Window . |
WebDialog(StyleId id,
Window owner,
String title,
Dialog.ModalityType modalityType,
GraphicsConfiguration gc)
Creates a dialog with the specified owner
Window . |
WebDialog(Window owner)
Creates a modeless dialog with the specified owner
Window . |
WebDialog(Window owner,
Dialog.ModalityType modalityType)
Creates a dialog with the specified owner
Window . |
WebDialog(Window owner,
String title)
Creates a modeless dialog with the specified owner
Window . |
WebDialog(Window owner,
String title,
Dialog.ModalityType modalityType)
Creates a dialog with the specified owner
Window . |
WebDialog(Window owner,
String title,
Dialog.ModalityType modalityType,
GraphicsConfiguration gc)
Creates a dialog with the specified owner
Window . |
Modifier and Type | Method and Description |
---|---|
void |
addDictionaryListener(DictionaryListener listener)
Adds new
DictionaryListener tied to the JComponent implementing this interface. |
void |
addFocusableChild(Component child)
Adds focusable child that won't force dialog to close even if it set to close on focus loss.
|
void |
addLanguageListener(LanguageListener listener)
Adds new
LanguageListener tied to the JComponent implementing this interface. |
void |
addStyleListener(StyleListener listener)
Adds
StyleListener . |
T |
center()
Centers window relative to screen center.
|
T |
center(Component relativeTo)
Centers window relative to the specified component center.
|
T |
center(Component relativeTo,
int width,
int height)
Changes window size and centers it relative to the specified component center.
|
T |
center(int width,
int height)
Changes window size and centers it relative to screen center.
|
protected JRootPane |
createRootPane() |
protected void |
dialogInit() |
JComponent |
getButtonsPanel()
Returns window buttons panel.
|
Painter |
getCustomPainter()
Returns custom
Painter used for implementing JComponent . |
StyleId |
getDefaultStyleId()
Returns default component
StyleId . |
List<Component> |
getFocusableChildren()
Returns focusable children that don't force dialog to close even if it set to close on focus loss.
|
String |
getLanguage()
Returns language key which was used to register specified component in
LanguageManager . |
Insets |
getMargin()
Returns current margin.
|
Insets |
getPadding()
Returns current padding.
|
Shape |
getPainterShape()
|
Skin |
getSkin()
Returns skin currently applied to this component.
|
StyleId |
getStyleId()
Returns component
StyleId . |
JComponent |
getTitleComponent()
Returns window title component.
|
WRootPaneUI |
getUI()
Returns the look and feel (LaF) object that renders this component.
|
float |
getWindowOpacity()
Returns window opacity.
|
protected void |
initialize(Window owner,
StyleId id,
String title)
Additional initialization of WebDialog settings.
|
boolean |
isCloseOnFocusLoss()
Returns whether should close dialog on focus loss or not.
|
boolean |
isDisplayCloseButton()
Returns whether or not window close button should be displayed.
|
boolean |
isDisplayMaximizeButton()
Returns whether or not window maximize button should be displayed.
|
boolean |
isDisplayMenuBar()
Returns whether or not menu bar should be displayed.
|
boolean |
isDisplayMinimizeButton()
Returns whether or not window minimize button should be displayed.
|
boolean |
isDisplayTitleComponent()
Returns whether or not window title component should be displayed.
|
boolean |
isDisplayWindowButtons()
Returns whether or not window buttons should be displayed.
|
boolean |
isLanguageSet()
Returns whether this component registered in
LanguageManager or not. |
boolean |
isShapeDetectionEnabled()
Returns whether or not component's custom
Shape is used for better mouse events detection. |
boolean |
isWindowOpaque()
Returns whether window is opaque or not.
|
void |
loadSettings()
Loads previously saved settings for the specified
JComponent if it is registered. |
WindowCloseAdapter |
onClose(ComponentEventRunnable runnable)
Shortcut method for window close event.
|
WindowAdapter |
onClosing(WindowEventRunnable runnable)
Shortcut method for window closing event.
|
T |
packToHeight(int height)
Packs window to its preffered width and specified height.
|
T |
packToWidth(int width)
Packs window to its preffered height and specified width.
|
void |
registerSettings(Configuration configuration)
Registers
JComponent for settings auto-save. |
void |
registerSettings(SettingsProcessor processor)
Registers
JComponent for settings auto-save. |
void |
removeDictionaryListener(DictionaryListener listener)
Removes
DictionaryListener tied to the JComponent implementing this interface. |
void |
removeDictionaryListeners()
Removes all
DictionaryListener s tied to the JComponent implementing this interface. |
void |
removeFocusableChild(Component child)
Removes focusable child that doesn't force dialog to close even if it set to close on focus loss.
|
void |
removeLanguage()
Unregisters component from
LanguageManager . |
void |
removeLanguageListener(LanguageListener listener)
Removes
LanguageListener tied to the JComponent implementing this interface. |
void |
removeLanguageListeners()
Removes all
LanguageListener s tied to the JComponent implementing this interface. |
void |
removeLanguageUpdater()
Unregisters custom component
LanguageUpdater . |
void |
removeStyleListener(StyleListener listener)
Removes
StyleListener . |
boolean |
resetCustomPainter()
Resets custom
Painter for implementing JComponent to default one. |
Skin |
resetSkin()
Resets skin for this component and all of its children linked via
StyleId . |
StyleId |
resetStyleId()
Resets
StyleId to default value. |
void |
saveSettings()
Saves settings for the specified
JComponent if it is registered. |
void |
setCloseOnFocusLoss(boolean closeOnFocusLoss)
Sets whether should close dialog on focus loss or not.
|
Painter |
setCustomPainter(Painter painter)
Sets custom
Painter for implementing JComponent . |
void |
setDisplayCloseButton(boolean display)
Sets whether or not window close button should be displayed.
|
void |
setDisplayMaximizeButton(boolean display)
Sets whether or not window maximize button should be displayed.
|
void |
setDisplayMenuBar(boolean display)
Sets whether or not menu bar should be displayed.
|
void |
setDisplayMinimizeButton(boolean display)
Sets whether or not window minimize button should be displayed.
|
void |
setDisplayTitleComponent(boolean display)
Sets whether or not window title component should be displayed.
|
void |
setDisplayWindowButtons(boolean display)
Sets whether or not window buttons should be displayed.
|
void |
setLanguage(String key,
Object... data)
Registers component in
LanguageManager under specified key and with specified formatting data. |
void |
setLanguageUpdater(LanguageUpdater updater)
Registers custom language updater for this component.
|
void |
setMargin(Insets margin)
Sets new margin.
|
void |
setMargin(int margin)
Sets new margin.
|
void |
setMargin(int top,
int left,
int bottom,
int right)
Sets new margin.
|
void |
setPadding(Insets padding)
Sets new padding.
|
void |
setPadding(int padding)
Sets new padding.
|
void |
setPadding(int top,
int left,
int bottom,
int right)
Sets new padding.
|
void |
setShapeDetectionEnabled(boolean enabled)
Sets whether or not component's custom
Shape should be used for better mouse events detection. |
Skin |
setSkin(Skin skin)
Applies specified custom skin to the styleable component and all of its children linked via
StyleId . |
Skin |
setSkin(Skin skin,
boolean recursively)
Applies specified custom skin to the styleable component and all of its children linked via
StyleId . |
StyleId |
setStyleId(StyleId id)
Sets new component
StyleId . |
void |
setTitleComponent(JComponent title)
Sets window title component.
|
void |
setUI(WRootPaneUI ui)
Sets the LaF object that renders this component.
|
T |
setWindowOpacity(float opacity)
Sets window opacity if that option is supported by the underlying system.
|
T |
setWindowOpaque(boolean opaque)
Sets window opaque if that option is supported by the underlying system.
|
void |
unregisterSettings()
Unregisters
JComponent from settings auto-save. |
void |
updateLanguage(Object... data)
Updates component language and formatting data.
|
void |
updateLanguage(String key,
Object... data)
Changes component language key and updates its language and formatting data.
|
addImpl, 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, show, 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, 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
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
protected boolean closeOnFocusLoss
protected transient DefaultFocusTracker focusTracker
public WebDialog(Component owner)
public WebDialog()
Frame
owner.
A shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(Frame owner)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Frame
from which the dialog is displayedpublic WebDialog(Frame owner, boolean modal)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Frame
from which the dialog is displayedmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelesspublic WebDialog(Frame owner, String title)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(Frame owner, String title, boolean modal)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Frame
from which the dialog is displayedtitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelesspublic WebDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Frame
from which the dialog is displayedtitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelessgc
- GraphicsConfiguration
of the target screen device.
If gc
is null
, the same GraphicsConfiguration
as the owning Frame is usedpublic WebDialog(Dialog owner)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- owner Dialog
from which the dialog is displayed or null
if this dialog has no ownerpublic WebDialog(Dialog owner, boolean modal)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- owner Dialog
from which the dialog is displayed or null
if this dialog has no ownermodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelesspublic WebDialog(Dialog owner, String title)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(Dialog owner, String title, boolean modal)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- owner Dialog
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelesspublic WebDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- owner Dialog
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelessgc
- GraphicsConfiguration
of the target screen device.
If gc
is null
, the same GraphicsConfiguration
as the owning Frame is usedpublic WebDialog(Window owner)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Window
from which the dialog is displayed or null
if this dialog has no ownerpublic WebDialog(Window owner, Dialog.ModalityType modalityType)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Window
from which the dialog is displayed or null
if this dialog has no ownermodalityType
- specifies whether dialog blocks input to other windows when shown.
null
value and unsupported modality types are equivalent to MODELESS
public WebDialog(Window owner, String title)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(Window owner, String title, Dialog.ModalityType modalityType)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Window
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodalityType
- specifies whether dialog blocks input to other windows when shown.
null
value and unsupported modality types are equivalent to MODELESS
public WebDialog(Window owner, String title, Dialog.ModalityType modalityType, GraphicsConfiguration gc)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- Window
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodalityType
- specifies whether dialog blocks input to other windows when shown.
null
value and unsupported modality types are equivalent to MODELESS
gc
- GraphicsConfiguration
of the target screen device.
If gc
is null
, the same GraphicsConfiguration
as the owning Frame is usedpublic WebDialog(StyleId id)
Frame
owner.
A shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
public WebDialog(StyleId id, Frame owner)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Frame owner, boolean modal)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Frame owner, String title)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Frame owner, String title, boolean modal)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
owner
- Frame
from which the dialog is displayedtitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelesspublic WebDialog(StyleId id, Frame owner, String title, boolean modal, GraphicsConfiguration gc)
Frame
.
If owner
is null
, a shared, hidden frame will be set as the owner of the dialog.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
owner
- Frame
from which the dialog is displayedtitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelessgc
- GraphicsConfiguration
of the target screen device.
If gc
is null
, the same GraphicsConfiguration
as the owning Frame is usedpublic WebDialog(StyleId id, Dialog owner)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Dialog owner, boolean modal)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
owner
- owner Dialog
from which the dialog is displayed or null
if this dialog has no ownermodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelesspublic WebDialog(StyleId id, Dialog owner, String title)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Dialog owner, String title, boolean modal)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
owner
- owner Dialog
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelesspublic WebDialog(StyleId id, Dialog owner, String title, boolean modal, GraphicsConfiguration gc)
Dialog
as its owner.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
owner
- owner Dialog
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodal
- specifies whether dialog blocks user input to other top-level windows when shown.
If true
, the modality type property is set to DEFAULT_MODALITY_TYPE
, otherwise the dialog is modelessgc
- GraphicsConfiguration
of the target screen device.
If gc
is null
, the same GraphicsConfiguration
as the owning Frame is usedpublic WebDialog(StyleId id, Window owner)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Window owner, Dialog.ModalityType modalityType)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Window owner, String title)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
public WebDialog(StyleId id, Window owner, String title, Dialog.ModalityType modalityType)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
owner
- Window
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodalityType
- specifies whether dialog blocks input to other windows when shown.
null
value and unsupported modality types are equivalent to MODELESS
public WebDialog(StyleId id, Window owner, String title, Dialog.ModalityType modalityType, GraphicsConfiguration gc)
Window
.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
id
- StyleId
owner
- Window
from which the dialog is displayed or null
if this dialog has no ownertitle
- String
to display in the dialog's title barmodalityType
- specifies whether dialog blocks input to other windows when shown.
null
value and unsupported modality types are equivalent to MODELESS
gc
- GraphicsConfiguration
of the target screen device.
If gc
is null
, the same GraphicsConfiguration
as the owning Frame is usedprotected void dialogInit()
dialogInit
in class JDialog
protected void initialize(Window owner, StyleId id, String title)
protected JRootPane createRootPane()
createRootPane
in class JDialog
public boolean isCloseOnFocusLoss()
public void setCloseOnFocusLoss(boolean closeOnFocusLoss)
closeOnFocusLoss
- whether should close dialog on focus loss or notpublic List<Component> getFocusableChildren()
public void addFocusableChild(Component child)
child
- focusable child that won't force dialog to close even if it set to close on focus losspublic void removeFocusableChild(Component child)
child
- focusable child that doesn't force dialog to close even if it set to close on focus losspublic boolean isDisplayTitleComponent()
public void setDisplayTitleComponent(boolean display)
display
- whether or not window title component should be displayedpublic JComponent getTitleComponent()
public void setTitleComponent(JComponent title)
title
- new window title componentpublic boolean isDisplayWindowButtons()
public void setDisplayWindowButtons(boolean display)
display
- whether or not window buttons should be displayedpublic boolean isDisplayMinimizeButton()
public void setDisplayMinimizeButton(boolean display)
display
- whether or not window minimize button should be displayedpublic boolean isDisplayMaximizeButton()
public void setDisplayMaximizeButton(boolean display)
display
- whether or not window maximize button should be displayedpublic boolean isDisplayCloseButton()
public void setDisplayCloseButton(boolean display)
display
- whether or not window close button should be displayedpublic JComponent getButtonsPanel()
public boolean isDisplayMenuBar()
public void setDisplayMenuBar(boolean display)
display
- whether or not menu bar should be displayed@NotNull public StyleId getDefaultStyleId()
Styleable
StyleId
.
This method is asked when initial component StyleId
have to be provided.getDefaultStyleId
in interface Styleable
StyleId
@NotNull public StyleId getStyleId()
Styleable
StyleId
.getStyleId
in interface Styleable
StyleId
@NotNull public StyleId setStyleId(@NotNull StyleId id)
Styleable
StyleId
.
If style for the specified ID cannot be found in skin then its default style will be used instead.setStyleId
in interface Styleable
id
- custom component StyleId
StyleId
@NotNull public StyleId resetStyleId()
Styleable
StyleId
to default value.resetStyleId
in interface Styleable
StyleId
@NotNull public Skin getSkin()
Styleable
@Nullable public Skin setSkin(@NotNull Skin skin)
Styleable
@Nullable public Skin setSkin(@NotNull Skin skin, boolean recursively)
Styleable
public void addStyleListener(@NotNull StyleListener listener)
Styleable
StyleListener
.addStyleListener
in interface Styleable
listener
- StyleListener
to addpublic void removeStyleListener(@NotNull StyleListener listener)
Styleable
StyleListener
.removeStyleListener
in interface Styleable
listener
- StyleListener
to remove@Nullable public Painter getCustomPainter()
Styleable
Painter
used for implementing JComponent
.getCustomPainter
in interface Styleable
Painter
used for implementing JComponent
@Nullable public Painter setCustomPainter(@NotNull Painter painter)
Styleable
Painter
for implementing JComponent
.setCustomPainter
in interface Styleable
painter
- custom Painter
Painter
previously used for implementing JComponent
public boolean resetCustomPainter()
Styleable
Painter
for implementing JComponent
to default one.resetCustomPainter
in interface Styleable
true
if custom Painter
was successfully resetted, false
otherwise@NotNull public Shape getPainterShape()
Styleable
Painter
Shape
.
This method is not named getShape ()
to avoid clashing with JDK7+ method in Window
ancestors.getPainterShape
in interface Styleable
Painter
Shape
public boolean isShapeDetectionEnabled()
Styleable
Shape
is used for better mouse events detection.
If it wasn't explicitly specified - WebLookAndFeel.isShapeDetectionEnabled()
is used as result.isShapeDetectionEnabled
in interface Styleable
true
if component's custom Shape
is used for better mouse events detection, false
otherwisepublic void setShapeDetectionEnabled(boolean enabled)
Styleable
Shape
should be used for better mouse events detection.
It can be enabled globally through WebLookAndFeel.setShapeDetectionEnabled(boolean)
.setShapeDetectionEnabled
in interface Styleable
enabled
- whether or not component's custom Shape
should be used for better mouse events detection@Nullable public Insets getMargin()
Styleable
null
which is basically the same as an empty [0,0,0,0] margin.public void setMargin(int margin)
Styleable
public void setMargin(int top, int left, int bottom, int right)
Styleable
public void setMargin(@Nullable Insets margin)
Styleable
null
can be provided to set an empty [0,0,0,0] margin.@Nullable public Insets getPadding()
Styleable
null
which is basically the same as an empty [0,0,0,0] padding.getPadding
in interface Styleable
public void setPadding(int padding)
Styleable
setPadding
in interface Styleable
padding
- new paddingpublic void setPadding(int top, int left, int bottom, int right)
Styleable
setPadding
in interface Styleable
top
- new top paddingleft
- new left paddingbottom
- new bottom paddingright
- new right paddingpublic void setPadding(@Nullable Insets padding)
Styleable
null
can be provided to set an empty [0,0,0,0] padding.setPadding
in interface Styleable
padding
- new paddingpublic WRootPaneUI getUI()
WRootPaneUI
object that renders this componentpublic void setUI(WRootPaneUI ui)
ui
- WRootPaneUI
public WindowAdapter onClosing(WindowEventRunnable runnable)
WindowEventMethods
onClosing
in interface WindowEventMethods
runnable
- window event runnablepublic WindowCloseAdapter onClose(ComponentEventRunnable runnable)
WindowEventMethods
onClose
in interface WindowEventMethods
runnable
- component event runnable@Nullable public String getLanguage()
LanguageMethods
LanguageManager
.getLanguage
in interface LanguageMethods
LanguageManager
public void setLanguage(@NotNull String key, @Nullable Object... data)
LanguageMethods
LanguageManager
under specified key and with specified formatting data.setLanguage
in interface LanguageMethods
key
- language record keydata
- formatting datapublic void updateLanguage(@Nullable Object... data)
LanguageMethods
updateLanguage
in interface LanguageMethods
data
- new formatting datapublic void updateLanguage(@NotNull String key, @Nullable Object... data)
LanguageMethods
updateLanguage
in interface LanguageMethods
key
- new language keydata
- new formatting datapublic void removeLanguage()
LanguageMethods
LanguageManager
.
This method will not change current component settings that came from latest applied translation.removeLanguage
in interface LanguageMethods
public boolean isLanguageSet()
LanguageMethods
LanguageManager
or not.isLanguageSet
in interface LanguageMethods
LanguageManager
, false otherwisepublic void setLanguageUpdater(@NotNull LanguageUpdater updater)
LanguageMethods
setLanguageUpdater
in interface LanguageMethods
updater
- LanguageUpdater
for the componentpublic void removeLanguageUpdater()
LanguageMethods
LanguageUpdater
.removeLanguageUpdater
in interface LanguageMethods
public void addLanguageListener(@NotNull LanguageListener listener)
LanguageEventMethods
LanguageListener
tied to the JComponent
implementing this interface.
Unlike LanguageManager.addLanguageListener(LanguageListener)
using this method will not store hard references
to the LanguageListener
outside of the JComponent
to avoid any mermory leaks. So if specified JComponent
will for instance be destroyed provided LanguageListener
will also be destroyed.addLanguageListener
in interface LanguageEventMethods
listener
- LanguageListener
to addpublic void removeLanguageListener(@NotNull LanguageListener listener)
LanguageEventMethods
LanguageListener
tied to the JComponent
implementing this interface.removeLanguageListener
in interface LanguageEventMethods
listener
- LanguageListener
to removepublic void removeLanguageListeners()
LanguageEventMethods
LanguageListener
s tied to the JComponent
implementing this interface.removeLanguageListeners
in interface LanguageEventMethods
public void addDictionaryListener(@NotNull DictionaryListener listener)
LanguageEventMethods
DictionaryListener
tied to the JComponent
implementing this interface.
Unlike LanguageManager.addDictionaryListener(DictionaryListener)
using this method will not store hard references
to the DictionaryListener
outside of the JComponent
to avoid any mermory leaks. So if specified JComponent
will for instance be destroyed provided DictionaryListener
will also be destroyed.addDictionaryListener
in interface LanguageEventMethods
listener
- DictionaryListener
to addpublic void removeDictionaryListener(@NotNull DictionaryListener listener)
LanguageEventMethods
DictionaryListener
tied to the JComponent
implementing this interface.removeDictionaryListener
in interface LanguageEventMethods
listener
- DictionaryListener
to removepublic void removeDictionaryListeners()
LanguageEventMethods
DictionaryListener
s tied to the JComponent
implementing this interface.removeDictionaryListeners
in interface LanguageEventMethods
public void registerSettings(Configuration configuration)
SettingsMethods
JComponent
for settings auto-save.
Registered JComponent
will be:
- tracked for settings changes (depends on SettingsProcessor
) to save them when requested
- automatically updated with any loaded settings for that key if requested
- automatically updated with any changes made in its settings if requestedregisterSettings
in interface SettingsMethods
configuration
- Configuration
public void registerSettings(SettingsProcessor processor)
SettingsMethods
JComponent
for settings auto-save.
Registered JComponent
will be:
- tracked for settings changes (depends on SettingsProcessor
) to save them when requested
- automatically updated with any loaded settings for that key if requested
- automatically updated with any changes made in its settings if requestedregisterSettings
in interface SettingsMethods
processor
- SettingsProcessor
public void unregisterSettings()
SettingsMethods
JComponent
from settings auto-save.unregisterSettings
in interface SettingsMethods
public void loadSettings()
SettingsMethods
JComponent
if it is registered.loadSettings
in interface SettingsMethods
public void saveSettings()
SettingsMethods
JComponent
if it is registered.saveSettings
in interface SettingsMethods
public boolean isWindowOpaque()
WindowMethods
isWindowOpaque
in interface WindowMethods<T extends WebDialog<T>>
public T setWindowOpaque(boolean opaque)
WindowMethods
setWindowOpaque
in interface WindowMethods<T extends WebDialog<T>>
opaque
- whether should make window opaque or notpublic float getWindowOpacity()
WindowMethods
getWindowOpacity
in interface WindowMethods<T extends WebDialog<T>>
public T setWindowOpacity(float opacity)
WindowMethods
setWindowOpacity
in interface WindowMethods<T extends WebDialog<T>>
opacity
- new window opacitypublic T center()
WindowMethods
center
in interface WindowMethods<T extends WebDialog<T>>
public T center(Component relativeTo)
WindowMethods
center
in interface WindowMethods<T extends WebDialog<T>>
relativeTo
- component used to center windowpublic T center(int width, int height)
WindowMethods
center
in interface WindowMethods<T extends WebDialog<T>>
width
- new window widthheight
- new window heightpublic T center(Component relativeTo, int width, int height)
WindowMethods
center
in interface WindowMethods<T extends WebDialog<T>>
relativeTo
- component used to center windowwidth
- new window widthheight
- new window heightpublic T packToWidth(int width)
WindowMethods
packToWidth
in interface WindowMethods<T extends WebDialog<T>>
width
- new window widthpublic T packToHeight(int height)
WindowMethods
packToHeight
in interface WindowMethods<T extends WebDialog<T>>
height
- new window heightCopyright © 2020. All rights reserved.