public class WebEditorPane extends JEditorPane implements IInputPrompt, Styleable, DocumentEventMethods<WebEditorPane>, EventMethods, LanguageMethods, LanguageEventMethods, SettingsMethods, FontMethods<WebEditorPane>, SizeMethods<WebEditorPane>
JEditorPane
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.JEditorPane
,
WebEditorPaneUI
,
EditorPanePainter
,
Serialized FormJEditorPane.AccessibleJEditorPane, JEditorPane.AccessibleJEditorPaneHTML, JEditorPane.JEditorPaneAccessibleHypertextSupport
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
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 |
---|
WebEditorPane()
Constructs new editor pane.
|
WebEditorPane(String url)
Constructs new editor pane.
|
WebEditorPane(String type,
String text)
Constructs new editor pane.
|
WebEditorPane(StyleId id)
Constructs new editor pane.
|
WebEditorPane(StyleId id,
String url)
Constructs new editor pane.
|
WebEditorPane(StyleId id,
String type,
String text)
Constructs new editor pane.
|
WebEditorPane(StyleId id,
URL url)
Constructs new editor pane.
|
WebEditorPane(URL url)
Constructs new editor pane.
|
Modifier and Type | Method and Description |
---|---|
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 |
addStyleListener(StyleListener listener)
Adds
StyleListener . |
WebEditorPane |
changeFontSize(int change)
Changes font size of the specified component.
|
void |
clear()
Clears editor text.
|
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 |
getInputPrompt()
Returns input prompt text.
|
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 . |
WEditorPaneUI |
getUI()
Returns the look and feel (LaF) object that renders this component.
|
String |
getUIClassID() |
boolean |
isBoldFont()
Returns whether component font is bold or not.
|
boolean |
isEmpty()
Returns whether or not this editor is empty.
|
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. |
DocumentChangeBehavior<WebEditorPane> |
onChange(DocumentEventRunnable<WebEditorPane> runnable)
Shortcut method for document change event.
|
MouseAdapter |
onDoubleClick(MouseEventRunnable runnable)
Shortcut method for double-click mouse event.
|
MouseAdapter |
onDragStart(int shift,
MouseButton mouseButton,
MouseEventRunnable runnable)
Shortcut method for drag start.
|
MouseAdapter |
onDragStart(int shift,
MouseEventRunnable runnable)
Shortcut method for drag start.
|
FocusAdapter |
onFocusGain(FocusEventRunnable runnable)
Shortcut method for focus gain event.
|
FocusAdapter |
onFocusLoss(FocusEventRunnable runnable)
Shortcut method for focus loss event.
|
KeyAdapter |
onKeyPress(HotkeyData hotkey,
KeyEventRunnable runnable)
Shortcut method for key press event.
|
KeyAdapter |
onKeyPress(KeyEventRunnable runnable)
Shortcut method for key press event.
|
KeyAdapter |
onKeyRelease(HotkeyData hotkey,
KeyEventRunnable runnable)
Shortcut method for key release event.
|
KeyAdapter |
onKeyRelease(KeyEventRunnable runnable)
Shortcut method for key release event.
|
KeyAdapter |
onKeyType(HotkeyData hotkey,
KeyEventRunnable runnable)
Shortcut method for key type event.
|
KeyAdapter |
onKeyType(KeyEventRunnable runnable)
Shortcut method for key type event.
|
MouseAdapter |
onMenuTrigger(MouseEventRunnable runnable)
Shortcut method for mouse event triggering popup menu.
|
MouseAdapter |
onMouseClick(MouseButton mouseButton,
MouseEventRunnable runnable)
Shortcut method for mouse click event.
|
MouseAdapter |
onMouseClick(MouseEventRunnable runnable)
Shortcut method for mouse click event.
|
MouseAdapter |
onMouseDrag(MouseButton mouseButton,
MouseEventRunnable runnable)
Shortcut method for mouse drag event.
|
MouseAdapter |
onMouseDrag(MouseEventRunnable runnable)
Shortcut method for mouse drag event.
|
MouseAdapter |
onMouseEnter(MouseEventRunnable runnable)
Shortcut method for mouse enter event.
|
MouseAdapter |
onMouseExit(MouseEventRunnable runnable)
Shortcut method for mouse exit event.
|
MouseAdapter |
onMousePress(MouseButton mouseButton,
MouseEventRunnable runnable)
Shortcut method for mouse press event.
|
MouseAdapter |
onMousePress(MouseEventRunnable runnable)
Shortcut method for mouse press event.
|
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. |
WebEditorPane |
setBoldFont()
Sets bold font for the component.
|
WebEditorPane |
setBoldFont(boolean apply)
Sets bold font for the component.
|
Painter |
setCustomPainter(Painter painter)
Sets custom
Painter for implementing JComponent . |
WebEditorPane |
setFontName(String fontName)
Sets component font name.
|
WebEditorPane |
setFontSize(int fontSize)
Sets component font size.
|
WebEditorPane |
setFontSizeAndStyle(int fontSize,
boolean bold,
boolean italic)
Sets font size and style for the specified component.
|
WebEditorPane |
setFontSizeAndStyle(int fontSize,
int style)
Sets font size and style for the specified component.
|
WebEditorPane |
setFontStyle(boolean bold,
boolean italic)
Sets component font style.
|
WebEditorPane |
setFontStyle(int style)
Sets component font style.
|
void |
setInputPrompt(String text)
Sets input prompt text.
|
WebEditorPane |
setItalicFont()
Sets italic or plain font for the component.
|
WebEditorPane |
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.
|
WebEditorPane |
setMaximumHeight(int maximumHeight)
Sets
JComponent maximum height. |
WebEditorPane |
setMaximumSize(int width,
int height)
Sets
JComponent maximum size. |
WebEditorPane |
setMaximumWidth(int maximumWidth)
Sets
JComponent maximum width. |
WebEditorPane |
setMinimumHeight(int minimumHeight)
Sets
JComponent minimum height. |
WebEditorPane |
setMinimumSize(int width,
int height)
Sets
JComponent minimum size. |
WebEditorPane |
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.
|
WebEditorPane |
setPlainFont()
Sets plain font for the component.
|
WebEditorPane |
setPlainFont(boolean apply)
Sets plain font for the component.
|
WebEditorPane |
setPreferredHeight(int preferredHeight)
Sets
JComponent preferred height. |
WebEditorPane |
setPreferredSize(int width,
int height)
Sets
JComponent preferred size. |
WebEditorPane |
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(WEditorPaneUI ui)
Sets the LaF object that renders this component.
|
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() |
addHyperlinkListener, createDefaultEditorKit, createEditorKitForContentType, fireHyperlinkUpdate, getAccessibleContext, getContentType, getEditorKit, getEditorKitClassNameForContentType, getEditorKitForContentType, getHyperlinkListeners, getPage, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getStream, getText, paramString, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, replaceSelection, scrollToReference, setContentType, setEditorKit, setEditorKitForContentType, setPage, setPage, setText
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDocument, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, viewToModel, write
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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, setVisible, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, 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, 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, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public WebEditorPane()
public WebEditorPane(String type, String text)
type
- mime type for the content editing supporttext
- initial editor contentpublic WebEditorPane(String url) throws IOException
url
- URL of the pageIOException
- exception for a null
or invalid URL specificationpublic WebEditorPane(URL url) throws IOException
url
- URL of the pageIOException
- exception for a null
or invalid page specification, or exception from the stream being readpublic WebEditorPane(StyleId id, String type, String text)
id
- StyleId
type
- mime type for the content editing supporttext
- initial editor contentpublic WebEditorPane(StyleId id, String url) throws IOException
id
- StyleId
url
- URL of the pageIOException
- exception for a null
or invalid URL specificationpublic WebEditorPane(StyleId id, URL url) throws IOException
id
- StyleId
url
- URL of the pageIOException
- exception for a null
or invalid page specification, or exception from the stream being readpublic boolean isEmpty()
true
if this editor is empty, false
otherwisepublic void clear()
@Nullable public String getInputPrompt()
IInputPrompt
getInputPrompt
in interface IInputPrompt
public void setInputPrompt(@Nullable String text)
IInputPrompt
setInputPrompt
in interface IInputPrompt
text
- input prompt text@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 JTextComponent
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.setMargin
in interface Styleable
setMargin
in class JTextComponent
margin
- new 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@NotNull public DocumentChangeBehavior<WebEditorPane> onChange(@NotNull DocumentEventRunnable<WebEditorPane> runnable)
DocumentEventMethods
onChange
in interface DocumentEventMethods<WebEditorPane>
runnable
- document event runnable@NotNull public MouseAdapter onMousePress(@NotNull MouseEventRunnable runnable)
EventMethods
onMousePress
in interface EventMethods
runnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMousePress(@Nullable MouseButton mouseButton, @NotNull MouseEventRunnable runnable)
EventMethods
onMousePress
in interface EventMethods
mouseButton
- mouse button filterrunnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMouseEnter(@NotNull MouseEventRunnable runnable)
EventMethods
onMouseEnter
in interface EventMethods
runnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMouseExit(@NotNull MouseEventRunnable runnable)
EventMethods
onMouseExit
in interface EventMethods
runnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMouseDrag(@NotNull MouseEventRunnable runnable)
EventMethods
onMouseDrag
in interface EventMethods
runnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMouseDrag(@Nullable MouseButton mouseButton, @NotNull MouseEventRunnable runnable)
EventMethods
onMouseDrag
in interface EventMethods
mouseButton
- mouse button filterrunnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMouseClick(@NotNull MouseEventRunnable runnable)
EventMethods
onMouseClick
in interface EventMethods
runnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMouseClick(@Nullable MouseButton mouseButton, @NotNull MouseEventRunnable runnable)
EventMethods
onMouseClick
in interface EventMethods
mouseButton
- mouse button filterrunnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onDoubleClick(@NotNull MouseEventRunnable runnable)
EventMethods
onDoubleClick
in interface EventMethods
runnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onMenuTrigger(@NotNull MouseEventRunnable runnable)
EventMethods
onMenuTrigger
in interface EventMethods
runnable
- mouse event runnableMouseAdapter
@NotNull public KeyAdapter onKeyType(@NotNull KeyEventRunnable runnable)
EventMethods
onKeyType
in interface EventMethods
runnable
- key event runnableKeyAdapter
@NotNull public KeyAdapter onKeyType(@Nullable HotkeyData hotkey, @NotNull KeyEventRunnable runnable)
EventMethods
onKeyType
in interface EventMethods
hotkey
- hotkey filterrunnable
- key event runnableKeyAdapter
@NotNull public KeyAdapter onKeyPress(@NotNull KeyEventRunnable runnable)
EventMethods
onKeyPress
in interface EventMethods
runnable
- key event runnableKeyAdapter
@NotNull public KeyAdapter onKeyPress(@Nullable HotkeyData hotkey, @NotNull KeyEventRunnable runnable)
EventMethods
onKeyPress
in interface EventMethods
hotkey
- hotkey filterrunnable
- key event runnableKeyAdapter
@NotNull public KeyAdapter onKeyRelease(@NotNull KeyEventRunnable runnable)
EventMethods
onKeyRelease
in interface EventMethods
runnable
- key event runnableKeyAdapter
@NotNull public KeyAdapter onKeyRelease(@Nullable HotkeyData hotkey, @NotNull KeyEventRunnable runnable)
EventMethods
onKeyRelease
in interface EventMethods
hotkey
- hotkey filterrunnable
- key event runnableKeyAdapter
@NotNull public FocusAdapter onFocusGain(@NotNull FocusEventRunnable runnable)
EventMethods
onFocusGain
in interface EventMethods
runnable
- focus event runnableFocusAdapter
@NotNull public FocusAdapter onFocusLoss(@NotNull FocusEventRunnable runnable)
EventMethods
onFocusLoss
in interface EventMethods
runnable
- focus event runnableFocusAdapter
@NotNull public MouseAdapter onDragStart(int shift, @NotNull MouseEventRunnable runnable)
EventMethods
onDragStart
in interface EventMethods
shift
- coordinate shift required to start dragrunnable
- mouse event runnableMouseAdapter
@NotNull public MouseAdapter onDragStart(int shift, @Nullable MouseButton mouseButton, @NotNull MouseEventRunnable runnable)
EventMethods
onDragStart
in interface EventMethods
shift
- coordinate shift required to start dragmouseButton
- mouse button filterrunnable
- mouse event runnableMouseAdapter
@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 WebEditorPane setPlainFont()
FontMethods
setPlainFont
in interface FontMethods<WebEditorPane>
public WebEditorPane setPlainFont(boolean apply)
FontMethods
setPlainFont
in interface FontMethods<WebEditorPane>
apply
- whether to apply font changes or notpublic boolean isPlainFont()
FontMethods
isPlainFont
in interface FontMethods<WebEditorPane>
public WebEditorPane setBoldFont()
FontMethods
setBoldFont
in interface FontMethods<WebEditorPane>
public WebEditorPane setBoldFont(boolean apply)
FontMethods
setBoldFont
in interface FontMethods<WebEditorPane>
apply
- whether to apply font changes or notpublic boolean isBoldFont()
FontMethods
isBoldFont
in interface FontMethods<WebEditorPane>
public WebEditorPane setItalicFont()
FontMethods
setItalicFont
in interface FontMethods<WebEditorPane>
public WebEditorPane setItalicFont(boolean apply)
FontMethods
setItalicFont
in interface FontMethods<WebEditorPane>
apply
- whether to apply font changes or notpublic boolean isItalicFont()
FontMethods
isItalicFont
in interface FontMethods<WebEditorPane>
public WebEditorPane setFontStyle(boolean bold, boolean italic)
FontMethods
setFontStyle
in interface FontMethods<WebEditorPane>
bold
- whether should set bold font or notitalic
- whether should set italic font or notpublic WebEditorPane setFontStyle(int style)
FontMethods
setFontStyle
in interface FontMethods<WebEditorPane>
style
- new stylepublic WebEditorPane setFontSize(int fontSize)
FontMethods
setFontSize
in interface FontMethods<WebEditorPane>
fontSize
- font sizepublic WebEditorPane changeFontSize(int change)
FontMethods
changeFontSize
in interface FontMethods<WebEditorPane>
change
- font size change amountpublic int getFontSize()
FontMethods
getFontSize
in interface FontMethods<WebEditorPane>
public WebEditorPane setFontSizeAndStyle(int fontSize, boolean bold, boolean italic)
FontMethods
setFontSizeAndStyle
in interface FontMethods<WebEditorPane>
fontSize
- new font sizebold
- whether should set bold font or notitalic
- whether should set italic font or notpublic WebEditorPane setFontSizeAndStyle(int fontSize, int style)
FontMethods
setFontSizeAndStyle
in interface FontMethods<WebEditorPane>
fontSize
- new font sizestyle
- new stylepublic WebEditorPane setFontName(String fontName)
FontMethods
setFontName
in interface FontMethods<WebEditorPane>
fontName
- new font namepublic String getFontName()
FontMethods
getFontName
in interface FontMethods<WebEditorPane>
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<WebEditorPane>
JComponent
preferred width set in SizeMethods.setPreferredWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebEditorPane setPreferredWidth(int preferredWidth)
SizeMethods
JComponent
preferred width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose preferred width on its own.setPreferredWidth
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
JComponent
preferred height set in SizeMethods.setPreferredHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebEditorPane setPreferredHeight(int preferredHeight)
SizeMethods
JComponent
preferred height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose preferred height on its own.setPreferredHeight
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
getPreferredSize
in class JEditorPane
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<WebEditorPane>
JComponent
preferred size before any adjustments@NotNull public WebEditorPane setPreferredSize(int width, int height)
SizeMethods
JComponent
preferred size.
This method is a simple bridge for JComponent.setPreferredSize(Dimension)
method.setPreferredSize
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
JComponent
maximum width set in SizeMethods.setMaximumWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebEditorPane setMaximumWidth(int maximumWidth)
SizeMethods
JComponent
maximum width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose maximum width on its own.setMaximumWidth
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
JComponent
maximum height set in SizeMethods.setMaximumHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebEditorPane setMaximumHeight(int maximumHeight)
SizeMethods
JComponent
maximum height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose maximum height on its own.setMaximumHeight
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
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<WebEditorPane>
JComponent
maximum size before any adjustments@NotNull public WebEditorPane setMaximumSize(int width, int height)
SizeMethods
JComponent
maximum size.
This method is a simple bridge for JComponent.setMaximumSize(Dimension)
method.setMaximumSize
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
JComponent
minimum width set in SizeMethods.setMinimumWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebEditorPane setMinimumWidth(int minimumWidth)
SizeMethods
JComponent
minimum width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose minimum width on its own.setMinimumWidth
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
JComponent
minimum height set in SizeMethods.setMinimumHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebEditorPane setMinimumHeight(int minimumHeight)
SizeMethods
JComponent
minimum height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose minimum height on its own.setMinimumHeight
in interface SizeMethods<WebEditorPane>
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<WebEditorPane>
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<WebEditorPane>
JComponent
minimum size before any adjustments@NotNull public WebEditorPane setMinimumSize(int width, int height)
SizeMethods
JComponent
minimum size.
This method is a simple bridge for JComponent.setMinimumSize(Dimension)
method.setMinimumSize
in interface SizeMethods<WebEditorPane>
width
- JComponent
minimum widthheight
- JComponent
minimum heightJComponent
public WEditorPaneUI getUI()
getUI
in class JTextComponent
WEditorPaneUI
object that renders this componentpublic void setUI(WEditorPaneUI ui)
ui
- WEditorPaneUI
public void updateUI()
updateUI
in class JTextComponent
public String getUIClassID()
getUIClassID
in class JEditorPane
Copyright © 2020. All rights reserved.