Package com.iizigo.prop.editor
Class ClassReferencePropEditor
- java.lang.Object
- com.iizigo.prop.BaseEditor<EditorClassReference,java.lang.String>
- com.iizigo.prop.editor.ClassReferencePropEditor
- All Implemented Interfaces:
IEditedPropControllerOwner<EditorClassReference,java.lang.String>
,IEditedPropertyEntry<EditorClassReference,java.lang.String>
,IEditedPropertyEntryMultiProp<EditorClassReference,java.lang.String>
,IPropertyDefined
public class ClassReferencePropEditor extends BaseEditor<EditorClassReference,java.lang.String>
The Class Reference property editor consists of a simple entry field.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
requiredInterface
The required interface, or null for none.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 ClassReferencePropEditor()
Default constructor called before createControls.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAnnotation()
Add interface.protected void
addInterface()
Add interface.protected void
create()
Creates the property editor controls.protected void
createJava()
Creates a new Java class.java.lang.String
formatValue(java.lang.String value)
Formats the value for user input as a String.java.lang.String
getDefaultValue()
Gets the default defined value to set in the property when defined.IzToolTip
getNativeToolTip()
Gets a "native" tooltip to use.protected java.lang.String
getToolTipText()
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected java.lang.String
getValue(java.lang.String input)
Gets the property value for a user input.protected void
gotoJava()
Goto Java class definition.void
initialize(EditorClassReference prop)
Initializes a newly created property (e.g.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, or to resolve the type for tooltip.protected void
selectJava(boolean all)
Selects a class from the project (or its classpath), but .java files as parsed sources.void
setCurrentValue(java.lang.String value)
Sets the current value and overrides it in order to build the tooltip.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, getOption, getSelectionListener, getSeverity, getShell, getToolTipText2, hasFocus, isPropReadOnly, onDefine, onDispose, onError, onF4List, onFocusGained, onFocusLost, onReadOnly, onUndefined, onUpdate, setColors, setEditable, setFocus, setInput, setInputValue, setInputValueFromProp, setToolTipText, showMenu, updateTooltip, validate
Method Detail
initialize
public void initialize(EditorClassReference prop) throws PropException
Initializes a newly created property (e.g. a reference property for accepted classes, etc).- Specified by:
initialize
in interfaceIEditedPropControllerOwner<EditorClassReference,java.lang.String>
- Overrides:
initialize
in classBaseEditor<EditorClassReference,java.lang.String>
- Parameters:
prop
- The newly created orphan property.- Throws:
PropException
- For property errors.
create
protected void create()
Creates the property editor controls.- Specified by:
create
in classBaseEditor<EditorClassReference,java.lang.String>
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<EditorClassReference,java.lang.String>
createJava
protected void createJava()
Creates a new Java class.
selectJava
protected void selectJava(boolean all)
Selects a class from the project (or its classpath), but .java files as parsed sources.
addInterface
protected void addInterface()
Add interface.
addAnnotation
protected void addAnnotation()
Add interface.
gotoJava
protected void gotoJava()
Goto Java class definition.
onMore
public void onMore()
Called when the "more..." button is pressed, or to resolve the type for tooltip.- Overrides:
onMore
in classBaseEditor<EditorClassReference,java.lang.String>
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<EditorClassReference,java.lang.String>
getNativeToolTip
public IzToolTip getNativeToolTip()
Gets a "native" tooltip to use.- Overrides:
getNativeToolTip
in classBaseEditor<EditorClassReference,java.lang.String>
- Returns:
- null for none, otherwise the IzToolTip instance.
getDefaultValue
public java.lang.String getDefaultValue()
Gets the default defined value to set in the property when defined.- Specified by:
getDefaultValue
in interfaceIEditedPropControllerOwner<EditorClassReference,java.lang.String>
- Specified by:
getDefaultValue
in classBaseEditor<EditorClassReference,java.lang.String>
getValue
protected java.lang.String getValue(java.lang.String input)
Gets the property value for a user input.- Specified by:
getValue
in classBaseEditor<EditorClassReference,java.lang.String>
- Parameters:
input
- The current user input.- Returns:
- The property value for the input, or null to un-define the property.
formatValue
public java.lang.String formatValue(java.lang.String value)
Formats the value for user input as a String.- Specified by:
formatValue
in interfaceIEditedPropControllerOwner<EditorClassReference,java.lang.String>
- Specified by:
formatValue
in classBaseEditor<EditorClassReference,java.lang.String>
- Parameters:
value
- The value.- Returns:
- The formatted value.
setCurrentValue
public void setCurrentValue(java.lang.String value)
Sets the current value and overrides it in order to build the tooltip.- Overrides:
setCurrentValue
in classBaseEditor<EditorClassReference,java.lang.String>