Class ExtendStyledText
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.swt.custom.StyledText
com.e1c.langtool.internal.ui.common.tools.ExtendStyledText
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
public final class ExtendStyledText
extends org.eclipse.swt.custom.StyledText
The realization of text field based on
StyledText.
In contrast to StyledText this class provides setting
max height of the component, also it allows showing a small error tooltip and showing a
hint message (see setHintMessage(String)) when text is empty end it's not focused.- See Also:
-
Text
-
Field Summary
FieldsFields inherited from class org.eclipse.swt.widgets.Control
handle -
Constructor Summary
ConstructorsConstructorDescriptionExtendStyledText(org.eclipse.swt.widgets.Composite parent, int style, int errorDectorationPos, String errorMsg) ExtendStyledText(org.eclipse.swt.widgets.Composite parent, int style, String errorMsg) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidorg.eclipse.swt.graphics.PointcomputeSize(int wHint, int hHint, boolean changed) Returns the hint message.intReturns a value of the max height for this component.voidHides an error.voidsetHintMessage(String hintMessage) Sets the hint message.voidsetMaxHeight(int height) Sets the max height of this component.voidShows an error.Methods inherited from class org.eclipse.swt.custom.StyledText
addBidiSegmentListener, addCaretListener, addExtendedModifyListener, addLineBackgroundListener, addLineStyleListener, addModifyListener, addPaintObjectListener, addSelectionListener, addVerifyKeyListener, addVerifyListener, addWordMovementListener, append, copy, copy, cut, getAlignment, getAlwaysShowScrollBars, getBackground, getBaseline, getBaseline, getBidiColoring, getBlockSelection, getBlockSelectionBounds, getBottomMargin, getCaretOffset, getCharCount, getContent, getDoubleClickEnabled, getDragDetect, getEditable, getForeground, getHorizontalIndex, getHorizontalPixel, getIndent, getJustify, getKeyBinding, getLeftMargin, getLine, getLineAlignment, getLineAtOffset, getLineBackground, getLineBullet, getLineCount, getLineDelimiter, getLineHeight, getLineHeight, getLineIndent, getLineIndex, getLineJustify, getLinePixel, getLineSpacing, getLineTabStops, getLineVerticalIndent, getLineWrapIndent, getLocationAtOffset, getMarginColor, getMouseNavigatorEnabled, getOffsetAtLine, getOffsetAtLocation, getOffsetAtPoint, getOrientation, getRanges, getRanges, getRightMargin, getSelection, getSelectionBackground, getSelectionCount, getSelectionForeground, getSelectionRange, getSelectionRanges, getSelectionText, getStyleRangeAtOffset, getStyleRanges, getStyleRanges, getStyleRanges, getStyleRanges, getTabs, getTabStops, getText, getText, getTextBounds, getTextLimit, getTextRange, getTopIndex, getTopMargin, getTopPixel, getWordWrap, getWrapIndent, insert, invokeAction, isTextSelected, paste, print, print, print, redraw, redraw, redrawRange, removeBidiSegmentListener, removeCaretListener, removeExtendedModifyListener, removeLineBackgroundListener, removeLineStyleListener, removeModifyListener, removePaintObjectListener, removeSelectionListener, removeVerifyKeyListener, removeVerifyListener, removeWordMovementListener, replaceStyleRanges, replaceTextRange, scroll, selectAll, setAlignment, setAlwaysShowScrollBars, setBackground, setBidiColoring, setBlockSelection, setBlockSelectionBounds, setBlockSelectionBounds, setBottomMargin, setCaret, setCaretOffset, setContent, setCursor, setDoubleClickEnabled, setDragDetect, setEditable, setEnabled, setFocus, setFont, setForeground, setHorizontalIndex, setHorizontalPixel, setIndent, setJustify, setKeyBinding, setLeftMargin, setLineAlignment, setLineBackground, setLineBullet, setLineIndent, setLineJustify, setLineSpacing, setLineSpacingProvider, setLineTabStops, setLineVerticalIndent, setLineWrapIndent, setMarginColor, setMargins, setMouseNavigatorEnabled, setOrientation, setRightMargin, setSelection, setSelection, setSelection, setSelectionBackground, setSelectionForeground, setSelectionRange, setSelectionRanges, setStyleRange, setStyleRanges, setStyleRanges, setStyleRanges, setTabs, setTabStops, setText, setTextDirection, setTextLimit, setTopIndex, setTopMargin, setTopPixel, setWordWrap, setWrapIndent, showSelectionMethods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, setIMEMethods inherited from class org.eclipse.swt.widgets.Composite
changed, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Field Details
-
DEFAULT_MAX_HEIGHT
public static final int DEFAULT_MAX_HEIGHT- See Also:
-
-
Constructor Details
-
ExtendStyledText
public ExtendStyledText(org.eclipse.swt.widgets.Composite parent, int style, int errorDectorationPos, String errorMsg) -
ExtendStyledText
-
-
Method Details
-
setMaxHeight
public void setMaxHeight(int height) Sets the max height of this component. If the given max height is less than 0 or than the min height of this component then this method does nothing.- Parameters:
height- a new max height of this component (value must be non negative)
-
getMaxHeight
public int getMaxHeight()Returns a value of the max height for this component.- Returns:
- a value of the max height
-
showError
public void showError()Shows an error. It shows a little error image and tooltip with error message. -
hideError
public void hideError()Hides an error. -
setHintMessage
Sets the hint message. The message text is displayed as a hint for the user, indicating the purpose of the field.- Parameters:
hintMessage- the text that will be shown as hint
-
getHintMessage
Returns the hint message.- Returns:
- the hint message
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed) - Overrides:
computeSizein classorg.eclipse.swt.custom.StyledText
-
checkSubclass
protected void checkSubclass()- Overrides:
checkSubclassin classorg.eclipse.swt.widgets.Composite
-