Package com._1c.g5.lwt.controls
Class LightFormattedText
- java.lang.Object
-
- com._1c.g5.lwt.AbstractLightControl
-
- com._1c.g5.lwt.controls.LightText
-
- com._1c.g5.lwt.controls.LightFormattedText
-
- All Implemented Interfaces:
IEditable
,ILightControl
public class LightFormattedText extends LightText
Light formatted text control. User can set formatters for text input/output.
This control uses NebulaFormattedText
as overlay control. As formatter it also uses NebulaITextFormatter
formatter. For more information on how to use formatter seeITextFormatter
and its implementations.
This control does not support password mode, multiline mode. Visible line count is always one as control does not support multiline mode. Text limit can't be set viasetTextLimit(int)
, because text limit is determined by formatter.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com._1c.g5.lwt.controls.LightText
LightText.OverlayFocusListener, LightText.OverlayKeyListener, LightText.OverlayModifyListener, LightText.OverlayTraverseListener, LightText.OverlayVerifyKeyListener, LightText.OverlayVerifyListener
-
-
Field Summary
-
Fields inherited from class com._1c.g5.lwt.controls.LightText
EMPTY_STRING
-
-
Constructor Summary
Constructors Constructor Description LightFormattedText()
Default constructor.LightFormattedText(org.eclipse.nebula.widgets.formattedtext.ITextFormatter formatter)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearSelection()
Clears the selection of this text box.protected void
createOverlay(org.eclipse.swt.widgets.Composite parent)
Creates overlayorg.eclipse.nebula.widgets.formattedtext.ITextFormatter
getFormatter()
Returns formatter used to format text.protected String
getOverlayText()
Returns overlay text.protected org.eclipse.swt.widgets.Control
getOverlayTextControl()
Returns overlay text control.int
getTextLimit()
Returns the maximum number of characters that the light text control is capable of holding.int
getVisibleLineCount()
Gets the visible line count.boolean
isMultiline()
Checks if this text is multiline.boolean
isPasswordMode()
Checks whether password mode is on or off.protected void
resetOverlayTextControl()
Resets overlay text control.protected void
selectAllOverlayText()
Selects all overlay text.void
setFormatter(org.eclipse.nebula.widgets.formattedtext.ITextFormatter formatter)
Sets formatter used to format text.void
setMultiline(boolean multiline)
Formatted text does not support multiline mode.protected void
setOverlayText(String text)
Sets overlay text.void
setPasswordMode(boolean passwordMode)
Formatted text does not support password mode.void
setText(String text)
Sets the text.void
setTextLimit(int textLimit)
Formatted text does not support text limit.void
setVisibleLineCount(int visibleLineCount)
Formatted text visible line counts is always one as it does not support multiline mode.-
Methods inherited from class com._1c.g5.lwt.controls.LightText
addTextChangedListener, addTextChangingListener, computeSize, dispose, getDisplayText, getHintText, getLastNotifiedText, getText, handleEvent, isBorderVisible, isEditable, isLiveEditing, isReadOnly, paint, removeTextChangedListener, removeTextChangingListener, resetTextSize, setBackgroundColor, setBorderColor, setBorderVisible, setBounds, setEditable, setEnabled, setFocus, setHintColor, setHintText, setLastNotifiedText, setLiveEditing, setReadOnly, setTextColor, setTextInternal, setUndoRedoText, setVisible
-
Methods inherited from class com._1c.g5.lwt.AbstractLightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getOverlay, getParent, getTooltip, getVisibleBounds, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setCursor, setData, setFocusable, setLayoutData, setOverlay, setParent, setTooltip
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.lwt.ILightControl
initialize
-
-
-
-
Method Detail
-
setPasswordMode
public void setPasswordMode(boolean passwordMode)
Formatted text does not support password mode.- Overrides:
setPasswordMode
in classLightText
- Parameters:
passwordMode
-true
to turn password mode on,false
to turn it off.
-
isPasswordMode
public boolean isPasswordMode()
Description copied from class:LightText
Checks whether password mode is on or off.- Overrides:
isPasswordMode
in classLightText
- Returns:
true
if text is in password mode,false
otherwise.
-
setMultiline
public void setMultiline(boolean multiline)
Formatted text does not support multiline mode.- Overrides:
setMultiline
in classLightText
- Parameters:
multiline
-true
to turn the multiline mode on,false
to turn off.
-
isMultiline
public boolean isMultiline()
Description copied from class:LightText
Checks if this text is multiline.- Overrides:
isMultiline
in classLightText
- Returns:
true
if it is multiline,false
otherwise.
-
setTextLimit
public void setTextLimit(int textLimit)
Formatted text does not support text limit. Text limit is determined by formatter. Formatter can be set viasetFormatter(ITextFormatter)
method.- Overrides:
setTextLimit
in classLightText
- Parameters:
textLimit
- the new text limit.
-
getTextLimit
public int getTextLimit()
Description copied from class:LightText
Returns the maximum number of characters that the light text control is capable of holding.- Overrides:
getTextLimit
in classLightText
- Returns:
- the textLimit the text limit
-
setVisibleLineCount
public void setVisibleLineCount(int visibleLineCount)
Formatted text visible line counts is always one as it does not support multiline mode.- Overrides:
setVisibleLineCount
in classLightText
- Parameters:
visibleLineCount
- the new visible line count,-1
to clear the limit.
-
getVisibleLineCount
public int getVisibleLineCount()
Description copied from class:LightText
Gets the visible line count.- Overrides:
getVisibleLineCount
in classLightText
- Returns:
- the visible line count,
-1
if no limit set.
-
clearSelection
public void clearSelection()
Description copied from class:LightText
Clears the selection of this text box.- Overrides:
clearSelection
in classLightText
-
setFormatter
public void setFormatter(org.eclipse.nebula.widgets.formattedtext.ITextFormatter formatter)
Sets formatter used to format text. Formatted text resets when formatter is set.- Parameters:
formatter
- - formatter to set. Can benull
.
-
getFormatter
public org.eclipse.nebula.widgets.formattedtext.ITextFormatter getFormatter()
Returns formatter used to format text.- Returns:
- formatter used to format text. Can return
null
.
-
getOverlayTextControl
protected org.eclipse.swt.widgets.Control getOverlayTextControl()
Description copied from class:LightText
Returns overlay text control.- Overrides:
getOverlayTextControl
in classLightText
- Returns:
- overlay text control. Returns
null
if there is no overlay at the moment.
-
resetOverlayTextControl
protected void resetOverlayTextControl()
Description copied from class:LightText
Resets overlay text control.- Overrides:
resetOverlayTextControl
in classLightText
-
createOverlay
protected void createOverlay(org.eclipse.swt.widgets.Composite parent)
Description copied from class:LightText
Creates overlay- Overrides:
createOverlay
in classLightText
- Parameters:
parent
- - overlay parent. can't benull
.
-
setOverlayText
protected void setOverlayText(String text)
Description copied from class:LightText
Sets overlay text.- Overrides:
setOverlayText
in classLightText
- Parameters:
text
- - text to set. Can't benull
.
-
getOverlayText
protected String getOverlayText()
Description copied from class:LightText
Returns overlay text.- Overrides:
getOverlayText
in classLightText
- Returns:
- overlay text. Can't return
null
.
-
selectAllOverlayText
protected void selectAllOverlayText()
Description copied from class:LightText
Selects all overlay text.- Overrides:
selectAllOverlayText
in classLightText
-
-