Package com.iizigo.prop.editor
Class BadgePropEditor
- java.lang.Object
- com.iizigo.prop.BaseEditor<BadgeProp,GBadge>
- com.iizigo.prop.editor.BadgePropEditor
- All Implemented Interfaces:
IEditedPropControllerOwner<BadgeProp,GBadge>,IEditedPropertyEntry<BadgeProp,GBadge>,IEditedPropertyEntryMultiProp<BadgeProp,GBadge>,IPropertyDefined
public class BadgePropEditor extends BaseEditor<BadgeProp,GBadge>
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
Fields Modifier and Type Field Description protected org.eclipse.swt.widgets.ListenercaretListenerSelection 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
Constructors Constructor Description BadgePropEditor()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckGoto()Checks the goto-enablement from the selection.protected voidcreate()Creates the property editor controls.protected voidcreateTextAndTTCursorChange()Create the text and tooltip.java.lang.StringformatValue(GBadge value)Formats the value for user input as a String.protected intgetCaretPosition()Gets the selection from the text or combo.GBadgegetDefaultValue()Gets the default defined value to set in the property when defined.protected java.lang.StringgetToolTipText()Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected GBadgegetValue(java.lang.String input)Gets the property value for a user input.protected voidonDoubleClick(org.eclipse.swt.widgets.Event e)Called when mouse is double-clicked in the text or combobox.voidonError(java.lang.String input, java.lang.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.voidonUndefined()Called when the property is undefined.voidonUpdate(GBadge value)Called when the property is updated without errors, with a new value.protected voidsetInputValue(GBadge value)Sets the new input value.protected voidsetToolTipText(java.lang.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, setColors, setCurrentValue, setEditable, setFocus, setInput, setInputValueFromProp, showMenu, updateTooltip, validate
Method Detail
create
protected void create()
Creates the property editor controls.- Specified by:
createin 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:
onDoubleClickin classBaseEditor<BadgeProp,GBadge>
onF4List
public void onF4List()
Called when F4 is pressed in a Text field.- Overrides:
onF4Listin classBaseEditor<BadgeProp,GBadge>
getToolTipText
protected java.lang.String getToolTipText()
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).- Specified by:
getToolTipTextin classBaseEditor<BadgeProp,GBadge>
setToolTipText
protected void setToolTipText(java.lang.String msg)
Sets the tooltip text. The default is to apply the getToolTipText() text to the edit control.- Overrides:
setToolTipTextin classBaseEditor<BadgeProp,GBadge>- Parameters:
msg- Message in tooltip (normally error), null for none, in which case the getToolTipText2() is used.
getDefaultValue
public GBadge getDefaultValue()
Gets the default defined value to set in the property when defined.- Specified by:
getDefaultValuein interfaceIEditedPropControllerOwner<BadgeProp,GBadge>- Specified by:
getDefaultValuein classBaseEditor<BadgeProp,GBadge>
getValue
protected GBadge getValue(java.lang.String input) throws KStringException
Gets the property value for a user input.- Specified by:
getValuein 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
public java.lang.String formatValue(GBadge value)
Formats the value for user input as a String.- Specified by:
formatValuein interfaceIEditedPropControllerOwner<BadgeProp,GBadge>- Specified by:
formatValuein classBaseEditor<BadgeProp,GBadge>- Parameters:
value- The value.- Returns:
- The formatted value.
setInputValue
protected void setInputValue(GBadge value)
Sets the new input value.- Overrides:
setInputValuein classBaseEditor<BadgeProp,GBadge>- Parameters:
value- The value to set, null for empty.
onUpdate
public void onUpdate(GBadge value)
Called when the property is updated without errors, with a new value.- Specified by:
onUpdatein interfaceIEditedPropControllerOwner<BadgeProp,GBadge>- Overrides:
onUpdatein classBaseEditor<BadgeProp,GBadge>
onUndefined
public void onUndefined()
Called when the property is undefined.- Specified by:
onUndefinedin interfaceIEditedPropControllerOwner<BadgeProp,GBadge>- Overrides:
onUndefinedin classBaseEditor<BadgeProp,GBadge>
onError
public void onError(java.lang.String input, java.lang.String message, int severity, boolean isMultipleValueWarning, boolean isChildError)Called when the property is updated due to an error.- Specified by:
onErrorin interfaceIEditedPropControllerOwner<BadgeProp,GBadge>- Overrides:
onErrorin classBaseEditor<BadgeProp,GBadge>