Package com.iizigo.prop.editor
Class VSRelativeReferencePropEditor
- java.lang.Object
- com.iizigo.prop.BaseEditor<VSRelativeReference<?>,java.lang.String>
- com.iizigo.prop.editor.VSRelativeReferencePropEditor
- All Implemented Interfaces:
IEditedPropControllerOwner<VSRelativeReference<?>,java.lang.String>,IEditedPropertyEntry<VSRelativeReference<?>,java.lang.String>,IEditedPropertyEntryMultiProp<VSRelativeReference<?>,java.lang.String>,IPropertyDefined
- Direct Known Subclasses:
VSActionActorParticipantEditor
public class VSRelativeReferencePropEditor extends BaseEditor<VSRelativeReference<?>,java.lang.String>
The VirtualSpace Reference property editor consists of a simple entry field and a more button to perform a selection.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<?>[]classesprotected org.eclipse.swt.graphics.Imageimageprotected booleanisVSRootprotected java.lang.StringitemDefinedprotected IzMenuItemmiGotoprotected IzMenuItemmiSelectprotected java.lang.StringmoreTextprotected IzToolTiptipprotected java.lang.Stringtitleprotected java.lang.StringtooltipTextFields 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 VSRelativeReferencePropEditor()Default constructor called before createControls.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildMenu()Called to build the menu.protected voidcreate()Creates the property editor controls.java.lang.StringformatValue(java.lang.String value)Formats the value for user input as a String.protected VSComponentgetCurrentReferenceTarget()Gets the current property reference target.java.lang.StringgetDefaultValue()Gets the default defined value to set in the property when defined.protected VSComponentgetReferenceTarget(java.lang.String relativeReference)Gets the current property reference target.protected java.lang.StringgetToolTipText()Gets the tooltip text to display in the entry fields (not the one for property errors or validator).protected java.lang.StringgetValue(java.lang.String input)Gets the property value for a user input.protected EditorVirtualSpacegetVirtualSpace(int ask)Gets the VirtualSpace, prompted to create it perhaps, or connect.protected static EditorVirtualSpacegetVirtualSpace(org.eclipse.swt.widgets.Shell shell, int ask, IPropertyEditorController controller, EditedPropController<?,?> propController, Atom atom)Gets the VirtualSpace, prompted to create it perhaps, or connect.protected voidonCreateMenu(IzMenu menu, boolean isPost)Called to create the menu items.protected voidonCreateVSAction()Creates a action.protected static voidonCreateVSColumn(EditorVirtualSpace ns, IPropertyEditorController controller, EditedPropController<?,?> propController, org.eclipse.swt.widgets.Text text, VSRelativeReference<?> reference)Creates a column.protected voidonCreateVSField()Creates a field.protected voidonCreateVSTable()Creates a table.protected voidonDoubleClick(org.eclipse.swt.widgets.Event e)Called when mouse is double-clicked in the text or combobox.protected booleanonGoto(boolean doPerform)Goto reference.protected voidonList()Called when the "more..." button is pressed.voidonMore()Called when the "more..." button is pressed.protected voidsetToolTipText(java.lang.String msg)Sets the tooltip text.protected voidsetup()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, onReadOnly, onUndefined, onUpdate, setColors, setCurrentValue, setEditable, setFocus, setInput, setInputValue, setInputValueFromProp, showMenu, updateTooltip, validate
Field Detail
title
protected java.lang.String title
moreText
protected java.lang.String moreText
tooltipText
protected java.lang.String tooltipText
itemDefined
protected java.lang.String itemDefined
image
protected org.eclipse.swt.graphics.Image image
classes
protected java.lang.Class<?>[] classes
isVSRoot
protected boolean isVSRoot
tip
protected IzToolTip tip
miSelect
protected IzMenuItem miSelect
miGoto
protected IzMenuItem miGoto
Method Detail
setup
protected void setup()
Override to provide user settings.
create
protected void create()
Creates the property editor controls.- Specified by:
createin classBaseEditor<VSRelativeReference<?>,java.lang.String>
buildMenu
protected void buildMenu()
Called to build the menu.
getVirtualSpace
protected EditorVirtualSpace getVirtualSpace(int ask)
Gets the VirtualSpace, prompted to create it perhaps, or connect.- Parameters:
ask- Question when -1, to connect or create, 0=connect, 1=create.- Returns:
- null if canceled.
getVirtualSpace
protected static EditorVirtualSpace getVirtualSpace(org.eclipse.swt.widgets.Shell shell, int ask, IPropertyEditorController controller, EditedPropController<?,?> propController, Atom atom)
Gets the VirtualSpace, prompted to create it perhaps, or connect.- Parameters:
ask- Question when -1, to connect or create, 0=connect, 1=create.- Returns:
- null if canceled.
onCreateVSField
protected void onCreateVSField()
Creates a field.
onCreateVSTable
protected void onCreateVSTable()
Creates a table.
onCreateVSAction
protected void onCreateVSAction()
Creates a action.
onCreateVSColumn
protected static void onCreateVSColumn(EditorVirtualSpace ns, IPropertyEditorController controller, EditedPropController<?,?> propController, org.eclipse.swt.widgets.Text text, VSRelativeReference<?> reference)
Creates a column.
onCreateMenu
protected void onCreateMenu(IzMenu menu, boolean isPost)
Called to create the menu items.
onMore
public void onMore()
Called when the "more..." button is pressed. Override to display dialog box.- Overrides:
onMorein classBaseEditor<VSRelativeReference<?>,java.lang.String>
onList
protected void onList()
Called when the "more..." button is pressed. Override to display dialog box.
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<VSRelativeReference<?>,java.lang.String>
onGoto
protected boolean onGoto(boolean doPerform)
Goto reference.
getCurrentReferenceTarget
protected VSComponent 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.
getReferenceTarget
protected VSComponent getReferenceTarget(java.lang.String relativeReference)
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.
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<VSRelativeReference<?>,java.lang.String>
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:
setToolTipTextin classBaseEditor<VSRelativeReference<?>,java.lang.String>- Parameters:
msg- Message in tooltip (normally error), null for none, in which case the getToolTipText2() is used.
getDefaultValue
public java.lang.String getDefaultValue()
Gets the default defined value to set in the property when defined.- Specified by:
getDefaultValuein interfaceIEditedPropControllerOwner<VSRelativeReference<?>,java.lang.String>- Specified by:
getDefaultValuein classBaseEditor<VSRelativeReference<?>,java.lang.String>
getValue
protected java.lang.String getValue(java.lang.String input)
Gets the property value for a user input.- Specified by:
getValuein classBaseEditor<VSRelativeReference<?>,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:
formatValuein interfaceIEditedPropControllerOwner<VSRelativeReference<?>,java.lang.String>- Specified by:
formatValuein classBaseEditor<VSRelativeReference<?>,java.lang.String>- Parameters:
value- The value.- Returns:
- The formatted value.