public class WebPopupMenu extends JPopupMenu implements Styleable, LanguageMethods, LanguageEventMethods, SettingsMethods, FontMethods<WebPopupMenu>, SizeMethods<WebPopupMenu>
JPopupMenu
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.JPopupMenu
,
WebPopupMenuUI
,
PopupMenuPainter
,
Serialized FormJPopupMenu.AccessibleJPopupMenu, JPopupMenu.Separator
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
UNDEFINED
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
WebPopupMenu()
Constructs new popup menu.
|
WebPopupMenu(StyleId id)
Constructs new popup menu with the specified
StyleId . |
Modifier and Type | Method and Description |
---|---|
JMenuItem |
add(Action action) |
JMenuItem |
add(String text) |
void |
addDictionaryListener(DictionaryListener listener)
Adds new
DictionaryListener tied to the JComponent implementing this interface. |
void |
addLanguageListener(LanguageListener listener)
Adds new
LanguageListener tied to the JComponent implementing this interface. |
void |
addSeparator() |
void |
addSeparator(int index)
Adds separator into menu at the specified Z-index.
|
void |
addStyleListener(StyleListener listener)
Adds
StyleListener . |
WebPopupMenu |
changeFontSize(int change)
Changes font size of the specified component.
|
protected JMenuItem |
createActionComponent(Action action) |
Painter |
getCustomPainter()
Returns custom
Painter used for implementing JComponent . |
StyleId |
getDefaultStyleId()
Returns default component
StyleId . |
String |
getFontName()
Returns component font name.
|
int |
getFontSize()
Returns component font size.
|
String |
getLanguage()
Returns language key which was used to register specified component in
LanguageManager . |
Insets |
getMargin()
Returns current margin.
|
int |
getMaximumHeight()
Returns
JComponent maximum height set in SizeMethods.setMaximumHeight(int) or SizeMethods.UNDEFINED . |
Dimension |
getMaximumSize()
Returns
JComponent maximum size. |
int |
getMaximumWidth()
|
int |
getMinimumHeight()
Returns
JComponent minimum height set in SizeMethods.setMinimumHeight(int) or SizeMethods.UNDEFINED . |
Dimension |
getMinimumSize()
Returns
JComponent minimum size. |
int |
getMinimumWidth()
|
Dimension |
getOriginalMaximumSize()
Returns original
JComponent maximum size before any adjustments. |
Dimension |
getOriginalMinimumSize()
Returns original
JComponent minimum size before any adjustments. |
Dimension |
getOriginalPreferredSize()
Returns original
JComponent preferred size before any adjustments. |
Insets |
getPadding()
Returns current padding.
|
Shape |
getPainterShape()
|
int |
getPreferredHeight()
Returns
JComponent preferred height set in SizeMethods.setPreferredHeight(int) or SizeMethods.UNDEFINED . |
Dimension |
getPreferredSize()
Returns
JComponent preferred size. |
int |
getPreferredWidth()
Returns
JComponent preferred width set in SizeMethods.setPreferredWidth(int) or SizeMethods.UNDEFINED . |
Skin |
getSkin()
Returns skin currently applied to this component.
|
StyleId |
getStyleId()
Returns component
StyleId . |
WPopupMenuUI |
getUI()
Returns the look and feel (LaF) object that renders this component.
|
String |
getUIClassID() |
void |
insert(Action action,
int index) |
boolean |
isBoldFont()
Returns whether component font is bold or not.
|
boolean |
isItalicFont()
Returns whether component font is italic or not.
|
boolean |
isLanguageSet()
Returns whether this component registered in
LanguageManager or not. |
boolean |
isPlainFont()
Returns whether component font is plain or not.
|
boolean |
isShapeDetectionEnabled()
Returns whether or not component's custom
Shape is used for better mouse events detection. |
void |
loadSettings()
Loads previously saved settings for the specified
JComponent if it is registered. |
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 |
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. |
WebPopupMenu |
setBoldFont()
Sets bold font for the component.
|
WebPopupMenu |
setBoldFont(boolean apply)
Sets bold font for the component.
|
Painter |
setCustomPainter(Painter painter)
Sets custom
Painter for implementing JComponent . |
WebPopupMenu |
setFontName(String fontName)
Sets component font name.
|
WebPopupMenu |
setFontSize(int fontSize)
Sets component font size.
|
WebPopupMenu |
setFontSizeAndStyle(int fontSize,
boolean bold,
boolean italic)
Sets font size and style for the specified component.
|
WebPopupMenu |
setFontSizeAndStyle(int fontSize,
int style)
Sets font size and style for the specified component.
|
WebPopupMenu |
setFontStyle(boolean bold,
boolean italic)
Sets component font style.
|
WebPopupMenu |
setFontStyle(int style)
Sets component font style.
|
WebPopupMenu |
setItalicFont()
Sets italic or plain font for the component.
|
WebPopupMenu |
setItalicFont(boolean apply)
Sets italic or plain font for the component.
|
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.
|
WebPopupMenu |
setMaximumHeight(int maximumHeight)
Sets
JComponent maximum height. |
WebPopupMenu |
setMaximumSize(int width,
int height)
Sets
JComponent maximum size. |
WebPopupMenu |
setMaximumWidth(int maximumWidth)
Sets
JComponent maximum width. |
WebPopupMenu |
setMinimumHeight(int minimumHeight)
Sets
JComponent minimum height. |
WebPopupMenu |
setMinimumSize(int width,
int height)
Sets
JComponent minimum size. |
WebPopupMenu |
setMinimumWidth(int minimumWidth)
Sets
JComponent minimum width. |
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.
|
WebPopupMenu |
setPlainFont()
Sets plain font for the component.
|
WebPopupMenu |
setPlainFont(boolean apply)
Sets plain font for the component.
|
WebPopupMenu |
setPopupMenuWay(PopupMenuWay way)
Assists popup menu to allow it choose the best position relative to invoker.
|
WebPopupMenu |
setPreferredHeight(int preferredHeight)
Sets
JComponent preferred height. |
WebPopupMenu |
setPreferredSize(int width,
int height)
Sets
JComponent preferred size. |
WebPopupMenu |
setPreferredWidth(int preferredWidth)
Sets
JComponent preferred width. |
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 |
setUI(WPopupMenuUI ui)
Sets the LaF object that renders this component.
|
WebPopupMenu |
showAbove(Component invoker)
Displays popup menu above the invoker component starting at its leading side.
|
WebPopupMenu |
showAboveEnd(Component invoker)
Displays popup menu above the invoker component starting at its trailing side.
|
WebPopupMenu |
showAboveMiddle(Component invoker)
Displays popup menu above the invoker component at its middle.
|
WebPopupMenu |
showAboveStart(Component invoker)
Displays popup menu above the invoker component starting at its leading side.
|
WebPopupMenu |
showBelow(Component invoker)
Displays popup menu under the invoker component starting at its leading side.
|
WebPopupMenu |
showBelowEnd(Component invoker)
Displays popup menu under the invoker component starting at its trailing side.
|
WebPopupMenu |
showBelowMiddle(Component invoker)
Displays popup menu under the invoker component at its middle.
|
WebPopupMenu |
showBelowStart(Component invoker)
Displays popup menu under the invoker component starting at its leading side.
|
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.
|
void |
updateUI() |
add, addMenuKeyListener, addPopupMenuListener, createActionChangeListener, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public JMenuItem add(String text)
add
in class JPopupMenu
public JMenuItem add(Action action)
add
in class JPopupMenu
public void insert(Action action, int index)
insert
in class JPopupMenu
protected JMenuItem createActionComponent(Action action)
createActionComponent
in class JPopupMenu
public void addSeparator()
addSeparator
in class JPopupMenu
public void addSeparator(int index)
index
- separator Z-indexpublic WebPopupMenu showAbove(Component invoker)
invoker
- invoker componentpublic WebPopupMenu showAboveStart(Component invoker)
invoker
- invoker componentpublic WebPopupMenu showAboveMiddle(Component invoker)
invoker
- invoker componentpublic WebPopupMenu showAboveEnd(Component invoker)
invoker
- invoker componentpublic WebPopupMenu showBelow(Component invoker)
invoker
- invoker componentpublic WebPopupMenu showBelowStart(Component invoker)
invoker
- invoker componentpublic WebPopupMenu showBelowMiddle(Component invoker)
invoker
- invoker componentpublic WebPopupMenu showBelowEnd(Component invoker)
invoker
- invoker componentpublic WebPopupMenu setPopupMenuWay(PopupMenuWay way)
way
- approximate popup menu display way@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.getMargin
in interface Styleable
getMargin
in class JPopupMenu
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 padding@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 WebPopupMenu setPlainFont()
FontMethods
setPlainFont
in interface FontMethods<WebPopupMenu>
public WebPopupMenu setPlainFont(boolean apply)
FontMethods
setPlainFont
in interface FontMethods<WebPopupMenu>
apply
- whether to apply font changes or notpublic boolean isPlainFont()
FontMethods
isPlainFont
in interface FontMethods<WebPopupMenu>
public WebPopupMenu setBoldFont()
FontMethods
setBoldFont
in interface FontMethods<WebPopupMenu>
public WebPopupMenu setBoldFont(boolean apply)
FontMethods
setBoldFont
in interface FontMethods<WebPopupMenu>
apply
- whether to apply font changes or notpublic boolean isBoldFont()
FontMethods
isBoldFont
in interface FontMethods<WebPopupMenu>
public WebPopupMenu setItalicFont()
FontMethods
setItalicFont
in interface FontMethods<WebPopupMenu>
public WebPopupMenu setItalicFont(boolean apply)
FontMethods
setItalicFont
in interface FontMethods<WebPopupMenu>
apply
- whether to apply font changes or notpublic boolean isItalicFont()
FontMethods
isItalicFont
in interface FontMethods<WebPopupMenu>
public WebPopupMenu setFontStyle(boolean bold, boolean italic)
FontMethods
setFontStyle
in interface FontMethods<WebPopupMenu>
bold
- whether should set bold font or notitalic
- whether should set italic font or notpublic WebPopupMenu setFontStyle(int style)
FontMethods
setFontStyle
in interface FontMethods<WebPopupMenu>
style
- new stylepublic WebPopupMenu setFontSize(int fontSize)
FontMethods
setFontSize
in interface FontMethods<WebPopupMenu>
fontSize
- font sizepublic WebPopupMenu changeFontSize(int change)
FontMethods
changeFontSize
in interface FontMethods<WebPopupMenu>
change
- font size change amountpublic int getFontSize()
FontMethods
getFontSize
in interface FontMethods<WebPopupMenu>
public WebPopupMenu setFontSizeAndStyle(int fontSize, boolean bold, boolean italic)
FontMethods
setFontSizeAndStyle
in interface FontMethods<WebPopupMenu>
fontSize
- new font sizebold
- whether should set bold font or notitalic
- whether should set italic font or notpublic WebPopupMenu setFontSizeAndStyle(int fontSize, int style)
FontMethods
setFontSizeAndStyle
in interface FontMethods<WebPopupMenu>
fontSize
- new font sizestyle
- new stylepublic WebPopupMenu setFontName(String fontName)
FontMethods
setFontName
in interface FontMethods<WebPopupMenu>
fontName
- new font namepublic String getFontName()
FontMethods
getFontName
in interface FontMethods<WebPopupMenu>
public int getPreferredWidth()
SizeMethods
JComponent
preferred width set in SizeMethods.setPreferredWidth(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
preferred width use SizeMethods.getPreferredSize()
method instead.getPreferredWidth
in interface SizeMethods<WebPopupMenu>
JComponent
preferred width set in SizeMethods.setPreferredWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebPopupMenu setPreferredWidth(int preferredWidth)
SizeMethods
JComponent
preferred width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose preferred width on its own.setPreferredWidth
in interface SizeMethods<WebPopupMenu>
preferredWidth
- new JComponent
preferred widthJComponent
public int getPreferredHeight()
SizeMethods
JComponent
preferred height set in SizeMethods.setPreferredHeight(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
preferred height use SizeMethods.getPreferredSize()
method instead.getPreferredHeight
in interface SizeMethods<WebPopupMenu>
JComponent
preferred height set in SizeMethods.setPreferredHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebPopupMenu setPreferredHeight(int preferredHeight)
SizeMethods
JComponent
preferred height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose preferred height on its own.setPreferredHeight
in interface SizeMethods<WebPopupMenu>
preferredHeight
- new JComponent
preferred heightJComponent
@NotNull public Dimension getPreferredSize()
SizeMethods
JComponent
preferred size.
This size is already adjusted according to min/max width and height settings.
Use SizeMethods.getOriginalPreferredSize()
method to retrieve original JComponent
preferred size.getPreferredSize
in interface SizeMethods<WebPopupMenu>
getPreferredSize
in class JComponent
JComponent
preferred size@NotNull public Dimension getOriginalPreferredSize()
SizeMethods
JComponent
preferred size before any adjustments.
This might be useful for various calculations involving JComponent
size.
In most cases this is the size provided by UI implementation of the JComponent
.getOriginalPreferredSize
in interface SizeMethods<WebPopupMenu>
JComponent
preferred size before any adjustments@NotNull public WebPopupMenu setPreferredSize(int width, int height)
SizeMethods
JComponent
preferred size.
This method is a simple bridge for JComponent.setPreferredSize(Dimension)
method.setPreferredSize
in interface SizeMethods<WebPopupMenu>
width
- JComponent
preferred widthheight
- JComponent
preferred heightJComponent
public int getMaximumWidth()
SizeMethods
JComponent
maximum width set in SizeMethods.setMaximumWidth(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
maximum width use SizeMethods.getMaximumSize()
method instead.getMaximumWidth
in interface SizeMethods<WebPopupMenu>
JComponent
maximum width set in SizeMethods.setMaximumWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebPopupMenu setMaximumWidth(int maximumWidth)
SizeMethods
JComponent
maximum width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose maximum width on its own.setMaximumWidth
in interface SizeMethods<WebPopupMenu>
maximumWidth
- new JComponent
maximum widthJComponent
public int getMaximumHeight()
SizeMethods
JComponent
maximum height set in SizeMethods.setMaximumHeight(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
maximum height use SizeMethods.getMaximumSize()
method instead.getMaximumHeight
in interface SizeMethods<WebPopupMenu>
JComponent
maximum height set in SizeMethods.setMaximumHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebPopupMenu setMaximumHeight(int maximumHeight)
SizeMethods
JComponent
maximum height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose maximum height on its own.setMaximumHeight
in interface SizeMethods<WebPopupMenu>
maximumHeight
- new JComponent
maximum heightJComponent
@NotNull public Dimension getMaximumSize()
SizeMethods
JComponent
maximum size.
This size is already adjusted according to min/max width and height settings.
Use SizeMethods.getOriginalMaximumSize()
method to retrieve original JComponent
maximum size.getMaximumSize
in interface SizeMethods<WebPopupMenu>
getMaximumSize
in class JComponent
JComponent
maximum size@NotNull public Dimension getOriginalMaximumSize()
SizeMethods
JComponent
maximum size before any adjustments.
This might be useful for various calculations involving JComponent
size.
In most cases this is the size provided by UI implementation of the JComponent
.getOriginalMaximumSize
in interface SizeMethods<WebPopupMenu>
JComponent
maximum size before any adjustments@NotNull public WebPopupMenu setMaximumSize(int width, int height)
SizeMethods
JComponent
maximum size.
This method is a simple bridge for JComponent.setMaximumSize(Dimension)
method.setMaximumSize
in interface SizeMethods<WebPopupMenu>
width
- JComponent
maximum widthheight
- JComponent
maximum heightJComponent
public int getMinimumWidth()
SizeMethods
JComponent
minimum width set in SizeMethods.setMinimumWidth(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
minimum width use SizeMethods.getMinimumSize()
method instead.getMinimumWidth
in interface SizeMethods<WebPopupMenu>
JComponent
minimum width set in SizeMethods.setMinimumWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebPopupMenu setMinimumWidth(int minimumWidth)
SizeMethods
JComponent
minimum width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose minimum width on its own.setMinimumWidth
in interface SizeMethods<WebPopupMenu>
minimumWidth
- new JComponent
minimum widthJComponent
public int getMinimumHeight()
SizeMethods
JComponent
minimum height set in SizeMethods.setMinimumHeight(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
minimum height use SizeMethods.getMinimumSize()
method instead.getMinimumHeight
in interface SizeMethods<WebPopupMenu>
JComponent
minimum height set in SizeMethods.setMinimumHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebPopupMenu setMinimumHeight(int minimumHeight)
SizeMethods
JComponent
minimum height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose minimum height on its own.setMinimumHeight
in interface SizeMethods<WebPopupMenu>
minimumHeight
- new JComponent
minimum heightJComponent
@NotNull public Dimension getMinimumSize()
SizeMethods
JComponent
minimum size.
This size is already adjusted according to min/max width and height settings.
Use SizeMethods.getOriginalMinimumSize()
method to retrieve original JComponent
minimum size.getMinimumSize
in interface SizeMethods<WebPopupMenu>
getMinimumSize
in class JComponent
JComponent
minimum size@NotNull public Dimension getOriginalMinimumSize()
SizeMethods
JComponent
minimum size before any adjustments.
This might be useful for various calculations involving JComponent
size.
In most cases this is the size provided by UI implementation of the JComponent
.getOriginalMinimumSize
in interface SizeMethods<WebPopupMenu>
JComponent
minimum size before any adjustments@NotNull public WebPopupMenu setMinimumSize(int width, int height)
SizeMethods
JComponent
minimum size.
This method is a simple bridge for JComponent.setMinimumSize(Dimension)
method.setMinimumSize
in interface SizeMethods<WebPopupMenu>
width
- JComponent
minimum widthheight
- JComponent
minimum heightJComponent
public WPopupMenuUI getUI()
getUI
in class JPopupMenu
WPopupMenuUI
object that renders this componentpublic void setUI(WPopupMenuUI ui)
ui
- WPopupMenuUI
public void updateUI()
updateUI
in class JPopupMenu
public String getUIClassID()
getUIClassID
in class JPopupMenu
Copyright © 2020. All rights reserved.