Package com.iizigo.prop.editor
Class ReferencePropEditor<TARGET extends IPropCnr>
- java.lang.Object
-
- com.iizigo.prop.BaseEditor<AbstractReference<TARGET>,ReferenceString>
-
- com.iizigo.prop.editor.ReferencePropEditor<TARGET>
-
- All Implemented Interfaces:
IEditedPropControllerOwner<AbstractReference<TARGET>,ReferenceString>
,IEditedPropertyEntry<AbstractReference<TARGET>,ReferenceString>
,IEditedPropertyEntryMultiProp<AbstractReference<TARGET>,ReferenceString>
,IPropertyDefined
- Direct Known Subclasses:
BaseReferencePropEditor
,ImageReferencePropEditor
,VSParticipantEditor
,VSReferencePropEditor
public class ReferencePropEditor<TARGET extends IPropCnr> extends BaseEditor<AbstractReference<TARGET>,ReferenceString>
The Reference property editor consists of a simple entry field and a more button. It states it's using StringProp, but it's rather the subclass of it, e.g. VSReference, etc, as this property editor can handle any "simple" string reference.- Author:
- Christopher Mindus
-
-
Field Summary
Fields Modifier and Type Field Description protected int
alternateExpansionLevel
protected java.lang.Object
alternateSelection
protected java.lang.Class<?>[]
classes
protected org.eclipse.jface.viewers.ViewerFilter
filter
protected java.lang.Class<org.eclipse.jface.viewers.ViewerFilter>
filterClass
protected org.eclipse.swt.graphics.Image
image
protected IzMenu
menu
protected IzMenuItem
miGoto
protected IzMenuItem
miSelect
protected java.lang.String
SELECT_MESSAGE
protected java.lang.Object
selectionRoot
Selection root.protected java.lang.String
TEXT_MESSAGE
Text message as tooltip text.protected IzToolTip
tip
-
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 ReferencePropEditor()
Default constructor called before createControls.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDropSupport()
Adds drop support for a control.protected void
create()
Creates the property editor controls.java.lang.String
formatValue(ReferenceString value)
Formats the value for user input as a String.protected java.lang.String
getBaseReferencePath()
Gets the relative base for reference parsing, i.e.protected GProp<?>
getCurrentReferenceTarget()
Gets the current property reference target.ReferenceString
getDefaultValue()
Gets the default defined value to set in the property when defined.protected java.lang.String
getLookupPropReference(java.lang.String name)
Creates the reference string to look-up from the ReferenceString.protected java.lang.String
getToolTipText()
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected ReferenceString
getValue(java.lang.String input)
Gets the property value for a user input.protected void
onCreateMenu(IzMenu menu, boolean isPost)
Called to create the menu items.protected void
onDoubleClick(org.eclipse.swt.widgets.Event e)
Called when mouse is double-clicked in the text or combobox.protected boolean
onGoto(boolean doPerform)
Goto reference.boolean
onList(boolean doPerform)
Displays the listing selection dialog.protected java.lang.String
setLookedUpReference(java.lang.String name)
Sets the reference found that also has been validated.protected void
setToolTipText(java.lang.String msg)
Sets the tooltip text.protected void
setup()
Override to provide user settings.-
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, onError, onF4List, onFocusGained, onFocusLost, onMore, onReadOnly, onUndefined, onUpdate, setColors, setCurrentValue, setEditable, setFocus, setInput, setInputValue, setInputValueFromProp, showMenu, updateTooltip, validate
-
-
-
-
Field Detail
-
TEXT_MESSAGE
protected java.lang.String TEXT_MESSAGE
Text message as tooltip text.
-
SELECT_MESSAGE
protected java.lang.String SELECT_MESSAGE
-
image
protected org.eclipse.swt.graphics.Image image
-
classes
protected java.lang.Class<?>[] classes
-
filterClass
protected java.lang.Class<org.eclipse.jface.viewers.ViewerFilter> filterClass
-
filter
protected org.eclipse.jface.viewers.ViewerFilter filter
-
tip
protected IzToolTip tip
-
menu
protected IzMenu menu
-
miSelect
protected IzMenuItem miSelect
-
miGoto
protected IzMenuItem miGoto
-
selectionRoot
protected java.lang.Object selectionRoot
Selection root.
-
alternateSelection
protected java.lang.Object alternateSelection
-
alternateExpansionLevel
protected int alternateExpansionLevel
-
-
Method Detail
-
create
protected void create()
Creates the property editor controls.- Specified by:
create
in classBaseEditor<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
-
setup
protected void setup()
Override to provide user settings.
-
onCreateMenu
protected void onCreateMenu(IzMenu menu, boolean isPost)
Called to create the menu items.
-
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<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
-
getLookupPropReference
protected java.lang.String getLookupPropReference(java.lang.String name)
Creates the reference string to look-up from the ReferenceString. Override this method for e.g. Base or Fixed Relative referencing.- Parameters:
name
- The reference name.- Returns:
- The property reference string to look-up.
-
setLookedUpReference
protected java.lang.String setLookedUpReference(java.lang.String name)
Sets the reference found that also has been validated. This method gives the opportunity for a subclass to remove e.g. the Base or Fixed Relative reference from the string start.- Parameters:
name
- The full reference.- Returns:
- The reference to set in this property as ReferenceString.
-
onList
public boolean onList(boolean doPerform)
Displays the listing selection dialog.
-
onGoto
protected boolean onGoto(boolean doPerform)
Goto reference.
-
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<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
-
getDefaultValue
public ReferenceString getDefaultValue()
Gets the default defined value to set in the property when defined.- Specified by:
getDefaultValue
in interfaceIEditedPropControllerOwner<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
- Specified by:
getDefaultValue
in classBaseEditor<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
-
getValue
protected ReferenceString getValue(java.lang.String input)
Gets the property value for a user input.- Specified by:
getValue
in classBaseEditor<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
- 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(ReferenceString value)
Formats the value for user input as a String.- Specified by:
formatValue
in interfaceIEditedPropControllerOwner<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
- Specified by:
formatValue
in classBaseEditor<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
- Parameters:
value
- The value.- Returns:
- The formatted value.
-
setToolTipText
protected void setToolTipText(java.lang.String msg)
Sets the tooltip text. The default is to apply the getToolTipText() text to the edit control.An attempt to show the tooltip of the reference target's DesignerProp tooltip is done.
- Overrides:
setToolTipText
in classBaseEditor<AbstractReference<TARGET extends IPropCnr>,ReferenceString>
- Parameters:
msg
- Message in tooltip (normally error), null for none, in which case the getToolTipText2() is used.
-
getBaseReferencePath
protected java.lang.String getBaseReferencePath()
Gets the relative base for reference parsing, i.e. the reference path of the base.- Returns:
- null if non-relative.
-
getCurrentReferenceTarget
protected GProp<?> getCurrentReferenceTarget()
Gets the current property reference target. This reference is retrieved from the current input. If the path contains "Module:/", it is assumed to be a hard path. Otherwise thegetBaseReferencePath()
is prepended.
-
addDropSupport
protected void addDropSupport()
Adds drop support for a control.
-
-