Package com.iizigo.prop.editor
Class TooltipPropEditor
- All Implemented Interfaces:
IThemeListener,IEditedPropControllerOwner<TooltipProp,,KTooltip> IEditedPropertyEntry<TooltipProp,,KTooltip> IEditedPropertyEntryMultiProp<TooltipProp,,KTooltip> IPropertyDefined,IDisposedPart
The tooltip property editor.
A context menu is available when right-clicking on the icon. A double-click on it opens the Rich Text Editor or the Text Editor.
The option "plain" makes input limited to PLAIN KStrings and should be combined with PlainKStringProp. The option "message" makes editing and selection of the category possible.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ListenerSelection listener to check for caret location.Fields inherited from class com.iizigo.prop.BaseEditor
appUI, combo, control, controller, definedButton, display, editor, focusListener, hasBeenModified, info, more, multipleValueWarningInput, options, parent, propController, shell, text, validator, wasDefinedAtFocusGainedConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprotected voidChecks the goto-enablement from the selection.protected voidcreate()Creates the property editor controls.protected voidCreate the text and tooltip.protected booleandoUndefineIfEmpty(boolean focusLost) Keeps empty strings as defined, when input has been changed specifically to empty string, or if the entry was defined when editing began.formatValue(KTooltip value) Formats the value for user input as a String.protected intGets the selection from the text or combo.Gets the default defined value to set in the property when defined.protected StringGets the tooltip text to display in the entry fields (not the one for property errors or validator).protected KTooltipGets the property value for a user input.protected voidCalled when mouse is double-clicked in the text or combobox.voidonError(String input, String message, int severity, boolean isMultipleValueWarning, boolean isChildError) Called when the property is updated due to an error.voidonF4List()Called when F4 is pressed in a Text field.voidCalled when the property is undefined.voidCalled when the property is updated without errors, with a new value.protected voidsetInputValue(KTooltip value) Sets the new input value.protected voidsetToolTipText(String msg) Sets the tooltip text.Methods inherited from class com.iizigo.prop.BaseEditor
assignMaster, beginProcessEvent, canProcessEvents, checkInput, createCCombo, createControls, createGridLayout, createIzMenu, createMoreButton, createMoreIzMenu, createText, dispose, doValueChangeConversion, endProcessEvent, getBaseEditor, getCurrentInput, getCurrentValue, getCurrentValues, getModifyListener, getNativeToolTip, getOption, getSelectionListener, getSeverity, getShell, getToolTipText2, hasFocus, initialize, isDisposed, isPropReadOnly, onDefine, onDispose, onFocusGained, onFocusLost, onMore, onReadOnly, onThemeChanged, setColors, setCurrentValue, setEditable, setFocus, setInput, setInputValueFromProp, showMenu, updateTooltip, validate
Field Details
caretListener
Selection listener to check for caret location.
Constructor Details
TooltipPropEditor
public TooltipPropEditor()
Method Details
create
protected void create()Creates the property editor controls.- Specified by:
createin classBaseEditor<TooltipProp,KTooltip>
createTextAndTTCursorChange
protected void createTextAndTTCursorChange()Create the text and tooltip.getCaretPosition
protected int getCaretPosition()Gets the selection from the text or combo.checkGoto
protected void checkGoto()Checks the goto-enablement from the selection.onDoubleClick
Called when mouse is double-clicked in the text or combobox. Overridden to check if Goto reference is enabled, and if so goes there.- Overrides:
onDoubleClickin classBaseEditor<TooltipProp,KTooltip>
onF4List
public void onF4List()Called when F4 is pressed in a Text field.- Overrides:
onF4Listin classBaseEditor<TooltipProp,KTooltip>
getToolTipText
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).- Specified by:
getToolTipTextin classBaseEditor<TooltipProp,KTooltip>
setToolTipText
Sets the tooltip text. The default is to apply the getToolTipText() text to the edit control.- Overrides:
setToolTipTextin classBaseEditor<TooltipProp,KTooltip> - Parameters:
msg- Message in tooltip (normally error), null for none, in which case the getToolTipText2() is used.
getDefaultValue
Gets the default defined value to set in the property when defined.- Specified by:
getDefaultValuein interfaceIEditedPropControllerOwner<TooltipProp,KTooltip> - Specified by:
getDefaultValuein classBaseEditor<TooltipProp,KTooltip>
doUndefineIfEmpty
protected boolean doUndefineIfEmpty(boolean focusLost) Keeps empty strings as defined, when input has been changed specifically to empty string, or if the entry was defined when editing began.- Overrides:
doUndefineIfEmptyin classBaseEditor<TooltipProp,KTooltip>
getValue
Gets the property value for a user input.- Specified by:
getValuein classBaseEditor<TooltipProp,KTooltip> - Parameters:
input- The current user input.- Returns:
- The property value for the input, or null to un-define the property.
- Throws:
KStringException- For parsing errors.
formatValue
Formats the value for user input as a String.- Specified by:
formatValuein interfaceIEditedPropControllerOwner<TooltipProp,KTooltip> - Specified by:
formatValuein classBaseEditor<TooltipProp,KTooltip> - Parameters:
value- The value.- Returns:
- The formatted value.
setInputValue
Sets the new input value.- Overrides:
setInputValuein classBaseEditor<TooltipProp,KTooltip> - Parameters:
value- The value to set, null for empty.
onUpdate
Called when the property is updated without errors, with a new value.- Specified by:
onUpdatein interfaceIEditedPropControllerOwner<TooltipProp,KTooltip> - Overrides:
onUpdatein classBaseEditor<TooltipProp,KTooltip>
onUndefined
public void onUndefined()Called when the property is undefined.- Specified by:
onUndefinedin interfaceIEditedPropControllerOwner<TooltipProp,KTooltip> - Overrides:
onUndefinedin classBaseEditor<TooltipProp,KTooltip>
onError
public void onError(String input, String message, int severity, boolean isMultipleValueWarning, boolean isChildError) Called when the property is updated due to an error.- Specified by:
onErrorin interfaceIEditedPropControllerOwner<TooltipProp,KTooltip> - Overrides:
onErrorin classBaseEditor<TooltipProp,KTooltip>