Package com.iizigo.prop.editor
Class BadgePropEditor
- All Implemented Interfaces:
IThemeListener
,IEditedPropControllerOwner<BadgeProp,
,GBadge> IEditedPropertyEntry<BadgeProp,
,GBadge> IEditedPropertyEntryMultiProp<BadgeProp,
,GBadge> IPropertyDefined
The Badge property editor consists of an icon for the color and font size.
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.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionprotected final org.eclipse.swt.widgets.Listener
Selection 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, wasDefinedAtFocusGained
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionprotected void
Checks the goto-enablement from the selection.protected void
create()
Creates the property editor controls.protected void
Create the text and tooltip.formatValue
(GBadge value) Formats the value for user input as a String.protected int
Gets the selection from the text or combo.Gets the default defined value to set in the property when defined.protected String
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected GBadge
Gets the property value for a user input.protected void
onDoubleClick
(org.eclipse.swt.widgets.Event e) Called when mouse is double-clicked in the text or combobox.void
onError
(String input, String message, int severity, boolean isMultipleValueWarning, boolean isChildError) Called when the property is updated due to an error.void
onF4List()
Called when F4 is pressed in a Text field.void
Called when the property is undefined.void
Called when the property is updated without errors, with a new value.protected void
setInputValue
(GBadge value) Sets the new input value.protected void
setToolTipText
(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, doUndefineIfEmpty, doValueChangeConversion, endProcessEvent, getBaseEditor, getCurrentInput, getCurrentValue, getCurrentValues, getModifyListener, getNativeToolTip, getOption, getSelectionListener, getSeverity, getShell, getToolTipText2, hasFocus, initialize, isPropReadOnly, onDefine, onDispose, onFocusGained, onFocusLost, onMore, onReadOnly, onThemeChanged, setColors, setCurrentValue, setEditable, setFocus, setInput, setInputValueFromProp, showMenu, updateTooltip, validate
Field Details
caretListener
protected final org.eclipse.swt.widgets.Listener caretListenerSelection listener to check for caret location.
Constructor Details
BadgePropEditor
public BadgePropEditor()
Method Details
create
protected void create()Creates the property editor controls.- Specified by:
create
in classBaseEditor<BadgeProp,
GBadge>
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
protected void onDoubleClick(org.eclipse.swt.widgets.Event e) 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:
onDoubleClick
in classBaseEditor<BadgeProp,
GBadge>
onF4List
public void onF4List()Called when F4 is pressed in a Text field.- Overrides:
onF4List
in classBaseEditor<BadgeProp,
GBadge>
getToolTipText
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).- Specified by:
getToolTipText
in classBaseEditor<BadgeProp,
GBadge>
setToolTipText
Sets the tooltip text. The default is to apply the getToolTipText() text to the edit control.- Overrides:
setToolTipText
in classBaseEditor<BadgeProp,
GBadge> - 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:
getDefaultValue
in interfaceIEditedPropControllerOwner<BadgeProp,
GBadge> - Specified by:
getDefaultValue
in classBaseEditor<BadgeProp,
GBadge>
getValue
Gets the property value for a user input.- Specified by:
getValue
in classBaseEditor<BadgeProp,
GBadge> - 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:
formatValue
in interfaceIEditedPropControllerOwner<BadgeProp,
GBadge> - Specified by:
formatValue
in classBaseEditor<BadgeProp,
GBadge> - Parameters:
value
- The value.- Returns:
- The formatted value.
setInputValue
Sets the new input value.- Overrides:
setInputValue
in classBaseEditor<BadgeProp,
GBadge> - Parameters:
value
- The value to set, null for empty.
onUpdate
Called when the property is updated without errors, with a new value.- Specified by:
onUpdate
in interfaceIEditedPropControllerOwner<BadgeProp,
GBadge> - Overrides:
onUpdate
in classBaseEditor<BadgeProp,
GBadge>
onUndefined
public void onUndefined()Called when the property is undefined.- Specified by:
onUndefined
in interfaceIEditedPropControllerOwner<BadgeProp,
GBadge> - Overrides:
onUndefined
in classBaseEditor<BadgeProp,
GBadge>
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:
onError
in interfaceIEditedPropControllerOwner<BadgeProp,
GBadge> - Overrides:
onError
in classBaseEditor<BadgeProp,
GBadge>