Package com.iizigo.prop.editor
Class StrokePropEditor
- java.lang.Object
- com.iizigo.prop.BaseEditor<StrokeProp,GStroke>
- com.iizigo.prop.editor.StrokePropEditor
- All Implemented Interfaces:
IEditedPropControllerOwner<StrokeProp,GStroke>
,IEditedPropertyEntry<StrokeProp,GStroke>
,IEditedPropertyEntryMultiProp<StrokeProp,GStroke>
,IPropertyDefined
,java.util.EventListener
,org.eclipse.swt.events.MouseListener
,org.eclipse.swt.internal.SWTEventListener
public class StrokePropEditor extends BaseEditor<StrokeProp,GStroke> implements org.eclipse.swt.events.MouseListener
The Stroke property editor.- Author:
- Christopher Mindus
Field Summary
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 StrokePropEditor()
Default constructor called before createControls.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
create()
Creates the property editor controls.java.lang.String
formatValue(GStroke value)
Formats the value for user input as a String.GStroke
getDefaultValue()
Gets the default defined value to set in the property when defined.static GStroke
getLastStroke()
Gets a last-stroke.protected java.lang.String
getToolTipText()
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected GStroke
getValue(java.lang.String input)
Gets the property value for a user input.void
mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
Double-click on preview or text displays color chooser.void
mouseDown(org.eclipse.swt.events.MouseEvent e)
Mouse down.void
mouseUp(org.eclipse.swt.events.MouseEvent e)
Mouse up, not processed.void
onDefine(boolean on)
Called from the PropertyDefinedButton.protected void
onDispose()
Called when the editor is disposed of.protected void
onDoubleClick(org.eclipse.swt.widgets.Event e)
Called when mouse is double-clicked in the text or combobox.void
onMore()
Called when the "more..." button is pressed.void
onUndefined()
Called when undefined.void
onUpdate(GStroke stroke)
Called when a property event has been fired and the edited entry needs to be updated.protected void
setColors(org.eclipse.swt.widgets.Control... additional)
Sets the colors for the controls depending on error, focus and define state.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, onError, onF4List, onFocusGained, onFocusLost, onReadOnly, setCurrentValue, setEditable, setFocus, setInput, setInputValue, setInputValueFromProp, setToolTipText, showMenu, updateTooltip, validate
Method Detail
getLastStroke
public static GStroke getLastStroke()
Gets a last-stroke.
create
protected void create()
Creates the property editor controls.- Specified by:
create
in classBaseEditor<StrokeProp,GStroke>
setColors
protected void setColors(org.eclipse.swt.widgets.Control... additional)
Sets the colors for the controls depending on error, focus and define state.- Overrides:
setColors
in classBaseEditor<StrokeProp,GStroke>
onDispose
protected void onDispose()
Called when the editor is disposed of. Override to implement required code. By default, this method does nothing.- Overrides:
onDispose
in classBaseEditor<StrokeProp,GStroke>
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<StrokeProp,GStroke>
onMore
public void onMore()
Called when the "more..." button is pressed. Override to display dialog box.- Overrides:
onMore
in classBaseEditor<StrokeProp,GStroke>
onUndefined
public void onUndefined()
Called when undefined.- Specified by:
onUndefined
in interfaceIEditedPropControllerOwner<StrokeProp,GStroke>
- Overrides:
onUndefined
in classBaseEditor<StrokeProp,GStroke>
onUpdate
public void onUpdate(GStroke stroke)
Called when a property event has been fired and the edited entry needs to be updated. This method is also called when setting up the edited entry the first time.- Specified by:
onUpdate
in interfaceIEditedPropControllerOwner<StrokeProp,GStroke>
- Overrides:
onUpdate
in classBaseEditor<StrokeProp,GStroke>
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:
getToolTipText
in classBaseEditor<StrokeProp,GStroke>
getDefaultValue
public GStroke getDefaultValue()
Gets the default defined value to set in the property when defined.- Specified by:
getDefaultValue
in interfaceIEditedPropControllerOwner<StrokeProp,GStroke>
- Specified by:
getDefaultValue
in classBaseEditor<StrokeProp,GStroke>
getValue
protected GStroke getValue(java.lang.String input) throws java.lang.Exception
Gets the property value for a user input.- Specified by:
getValue
in classBaseEditor<StrokeProp,GStroke>
- Parameters:
input
- The current user input.- Returns:
- The property value for the input, or null to un-define the property.
- Throws:
java.lang.Exception
- For validation errors.
formatValue
public java.lang.String formatValue(GStroke value)
Formats the value for user input as a String.- Specified by:
formatValue
in interfaceIEditedPropControllerOwner<StrokeProp,GStroke>
- Specified by:
formatValue
in classBaseEditor<StrokeProp,GStroke>
- Parameters:
value
- The value.- Returns:
- The formatted value.
onDefine
public void onDefine(boolean on)
Called from the PropertyDefinedButton.- Specified by:
onDefine
in interfaceIPropertyDefined
- Overrides:
onDefine
in classBaseEditor<StrokeProp,GStroke>
- Parameters:
on
- The defined state.
mouseDoubleClick
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
Double-click on preview or text displays color chooser.- Specified by:
mouseDoubleClick
in interfaceorg.eclipse.swt.events.MouseListener
- Parameters:
e
-
mouseDown
public void mouseDown(org.eclipse.swt.events.MouseEvent e)
Mouse down.- Specified by:
mouseDown
in interfaceorg.eclipse.swt.events.MouseListener
mouseUp
public void mouseUp(org.eclipse.swt.events.MouseEvent e)
Mouse up, not processed.- Specified by:
mouseUp
in interfaceorg.eclipse.swt.events.MouseListener