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:
IThemeListener
,IEditedPropControllerOwner<AbstractReference<TARGET>,
,ReferenceString> IEditedPropertyEntry<AbstractReference<TARGET>,
,ReferenceString> IEditedPropertyEntryMultiProp<AbstractReference<TARGET>,
,ReferenceString> IPropertyDefined
,IDisposedPart
- 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
Modifier and TypeFieldDescriptionprotected int
protected Object
protected Class<?>[]
protected ViewerFilter
protected Class
<ViewerFilter> protected Image
protected IzMenu
protected IzMenuItem
protected IzMenuItem
protected String
protected Object
Selection root.protected String
Text message as tooltip text.protected IzToolTip
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
Adds drop support for a control.protected void
create()
Creates the property editor controls.formatValue
(ReferenceString value) Formats the value for user input as a String.protected String
Gets the relative base for reference parsing, i.e.protected GProp
<?> Gets the current property reference target.Gets the default defined value to set in the property when defined.protected String
getLookupPropReference
(String name) Creates the reference string to look-up from the ReferenceString.protected String
Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected ReferenceString
Gets the property value for a user input.protected void
onCreateMenu
(IzMenu menu, boolean isPost) Called to create the menu items.protected void
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 String
setLookedUpReference
(String name) Sets the reference found that also has been validated.protected void
setToolTipText
(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, isDisposed, isPropReadOnly, onDefine, onDispose, onError, onF4List, onFocusGained, onFocusLost, onMore, onReadOnly, onThemeChanged, onUndefined, onUpdate, setColors, setCurrentValue, setEditable, setFocus, setInput, setInputValue, setInputValueFromProp, showMenu, updateTooltip, validate
Field Details
TEXT_MESSAGE
Text message as tooltip text.SELECT_MESSAGE
image
classes
filterClass
filter
tip
miSelect
miGoto
selectionRoot
Selection root.alternateSelection
alternateExpansionLevel
protected int alternateExpansionLevel
Constructor Details
ReferencePropEditor
public ReferencePropEditor()Default constructor called before createControls.
Method Details
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
Called to create the menu items.onDoubleClick
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
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
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
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
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
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
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
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
Gets the relative base for reference parsing, i.e. the reference path of the base.- Returns:
- null if non-relative.
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.