Class ArrayEditPart
java.lang.Object
org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.csstudio.opibuilder.editparts.AbstractBaseEditPart
org.csstudio.opibuilder.editparts.AbstractContainerEditpart
org.csstudio.opibuilder.widgets.editparts.ArrayEditPart
- All Implemented Interfaces:
IPVWidgetEditpart
,IAdaptable
,org.eclipse.gef.EditPart
,org.eclipse.gef.GraphicalEditPart
,org.eclipse.gef.NodeEditPart
,org.eclipse.gef.RequestConstants
Editpart for array widget.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.csstudio.opibuilder.editparts.AbstractBaseEditPart
AbstractBaseEditPart.BaseEditPartActionFilter
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart.AccessibleGraphicalEditPart, org.eclipse.gef.editparts.AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractEditPart.EditPolicyIterator
Nested classes/interfaces inherited from interface org.csstudio.opibuilder.editparts.IPVWidgetEditpart
IPVWidgetEditpart.ISetPVValueListener
-
Field Summary
Fields inherited from class org.csstudio.opibuilder.editparts.AbstractBaseEditPart
anchorMap, propertyListenerMap
Fields inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
figure, sourceConnections, targetConnections
Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart
children, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAG
Fields inherited from interface org.eclipse.gef.EditPart
SELECTED, SELECTED_NONE, SELECTED_PRIMARY
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
void
org.eclipse.draw2d.Border
Calculate the border for the widget with assume that the widget is connected.protected org.eclipse.gef.EditPart
createChild
(Object model) protected ConnectionHandler
protected void
void
protected void
Subclass should do the activate things in this method.protected org.eclipse.draw2d.IFigure
Create and initialize the widget figure with the property values in model.getAdapter
(Class key) String[]
org.eclipse.draw2d.IFigure
org.eclipse.gef.DragTracker
getDragTracker
(org.eclipse.gef.Request request) int
getIndex
(AbstractBaseEditPart child) Get the array index on the child widget.protected List<AbstractWidgetModel>
getPV()
Get the PV corresponding to thePV Name
property.Get the pv by PV property id.getPVValue
(String pvPropId) Get value from one of the attached PVs.getValue()
By default, it returns an Object Array of its children's value.protected void
hookChild
(org.eclipse.gef.EditPart editPart, int indexOfArrayChild, boolean directChild) Hook child with array indexprotected void
initFigure
(org.eclipse.draw2d.IFigure figure) initialize the figureprotected void
boolean
protected void
void
performRequest
(org.eclipse.gef.Request request) protected void
protected void
Register the property change handlers.protected void
removeChild
(org.eclipse.gef.EditPart child) void
setControlEnabled
(boolean enabled) void
setIgnoreOldPVValue
(boolean ignoreOldValue) void
setPVValue
(String pvPropId, Object value) Set PV to given value.void
If input value is instance of Object[] and its length is equal or larger than children size, it will write each element of value to each child according children's order.protected void
Methods inherited from class org.csstudio.opibuilder.editparts.AbstractContainerEditpart
addChild, addChildToBottom, addChildToRight, getAllRuntimePVNames, getChild, getLayoutWidget, getWidget, layout, performAutosize, refreshChildren, removeAllChildren, removeChild, removeChild, removeChildByName, setModel
Methods inherited from class org.csstudio.opibuilder.editparts.AbstractBaseEditPart
addToConnectionHandler, createFigure, doDeActivate, doRefreshVisuals, executeAction, fillAnchorMap, getAllPVs, getAnchorMap, getClosestAnchorAt, getConnectionHandler, getDisplayDisposeListener, getExecutionMode, getExternalObject, getHookedActions, getMacroValue, getModelSourceConnections, getModelTargetConnections, getName, getPropertyValue, getPVByName, getSite, getSourceConnectionAnchor, getSourceConnectionAnchor, getTargetConnectionAnchor, getTargetConnectionAnchor, getTerminalNameFromAnchor, getVar, hookMouseClickAction, isSelectable, refreshVisuals, removeAllPropertyChangeHandlers, removeFromConnectionHandler, setEnabled, setExecutionMode, setExternalObject, setFigureBorder, setHeight, setPropertyChangeHandler, setPropertyValue, setPropertyValue, setSelectable, setSite, setValueInUIThread, setVar, setVisible, setWidth, setX, setY, toString
Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
addChildVisual, addNodeListener, addNotify, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getChildren, getFigure, getLayer, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refresh, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeNotify, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activateEditPolicies, addChild, addEditPartListener, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getCommand, getEditPolicy, getEditPolicyIterable, getEditPolicyIterator, getEventListeners, getEventListenersIterable, getFlag, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, register, registerAccessibility, registerModel, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest, unregister, unregisterAccessibility, unregisterModel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.gef.EditPart
addEditPartListener, addNotify, eraseSourceFeedback, eraseTargetFeedback, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
Methods inherited from interface org.eclipse.gef.GraphicalEditPart
addNodeListener, getChildren, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint
-
Constructor Details
-
ArrayEditPart
public ArrayEditPart()
-
-
Method Details
-
doActivate
protected void doActivate()Description copied from class:AbstractBaseEditPart
Subclass should do the activate things in this method. This method is last called fromAbstractBaseEditPart.activate()
. If there is code to be called as the first thing inAbstractBaseEditPart.activate()
, it can be put inAbstractBaseEditPart.doCreateFigure()
.- Overrides:
doActivate
in classAbstractBaseEditPart
-
activate
public void activate()- Specified by:
activate
in interfaceorg.eclipse.gef.EditPart
- Overrides:
activate
in classAbstractBaseEditPart
-
initValueArray
protected void initValueArray() -
calculateBorder
public org.eclipse.draw2d.Border calculateBorder()Description copied from class:AbstractBaseEditPart
Calculate the border for the widget with assume that the widget is connected.- Overrides:
calculateBorder
in classAbstractBaseEditPart
- Returns:
- the border.
-
createChild
- Overrides:
createChild
in classorg.eclipse.gef.editparts.AbstractEditPart
-
removeChild
protected void removeChild(org.eclipse.gef.EditPart child) - Overrides:
removeChild
in classorg.eclipse.gef.editparts.AbstractEditPart
-
hookChild
protected void hookChild(org.eclipse.gef.EditPart editPart, int indexOfArrayChild, boolean directChild) Hook child with array index- Parameters:
editPart
-
-
createConnectionHandler
- Overrides:
createConnectionHandler
in classAbstractBaseEditPart
-
createEditPolicies
protected void createEditPolicies()- Overrides:
createEditPolicies
in classAbstractContainerEditpart
-
deactivate
public void deactivate()- Specified by:
deactivate
in interfaceorg.eclipse.gef.EditPart
- Overrides:
deactivate
in classAbstractContainerEditpart
-
doCreateFigure
protected org.eclipse.draw2d.IFigure doCreateFigure()Description copied from class:AbstractBaseEditPart
Create and initialize the widget figure with the property values in model.- Specified by:
doCreateFigure
in classAbstractBaseEditPart
- Returns:
- the widget figure
-
getAdapter
- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classAbstractContainerEditpart
-
getAllPVNames
- Specified by:
getAllPVNames
in interfaceIPVWidgetEditpart
- Returns:
- A String array with all PV names from PV properties.
-
getArrayFigure
-
getContentPane
public org.eclipse.draw2d.IFigure getContentPane()- Specified by:
getContentPane
in interfaceorg.eclipse.gef.GraphicalEditPart
- Overrides:
getContentPane
in classorg.eclipse.gef.editparts.AbstractGraphicalEditPart
-
getControlPV
- Specified by:
getControlPV
in interfaceIPVWidgetEditpart
- Returns:
- the control PV. null if no control PV on this widget.
-
getDragTracker
public org.eclipse.gef.DragTracker getDragTracker(org.eclipse.gef.Request request) - Specified by:
getDragTracker
in interfaceorg.eclipse.gef.EditPart
- Overrides:
getDragTracker
in classorg.eclipse.gef.editparts.AbstractGraphicalEditPart
-
getModelChildren
- Overrides:
getModelChildren
in classAbstractContainerEditpart
-
getUnSyncablePropIds
-
getPV
Get the PV corresponding to thePV Name
property. It is same as callinggetPV("pv_name")
.- Specified by:
getPV
in interfaceIPVWidgetEditpart
- Returns:
- the PV corresponding to the
PV Name
property. null if PV Name is not configured for this widget.
-
getPV
Get the pv by PV property id.- Specified by:
getPV
in interfaceIPVWidgetEditpart
- Parameters:
pvPropId
- the PV property id.- Returns:
- the corresponding pv for the pvPropId. null if the pv doesn't exist.
-
getPVName
- Specified by:
getPVName
in interfaceIPVWidgetEditpart
- Returns:
- the first PV name.
-
getPVValue
Get value from one of the attached PVs.- Specified by:
getPVValue
in interfaceIPVWidgetEditpart
- Parameters:
pvPropId
- the property id of the PV. It is "pv_name" for the main PV.- Returns:
- the value of the PV.
-
getWidgetModel
- Overrides:
getWidgetModel
in classAbstractContainerEditpart
-
getIndex
Get the array index on the child widget.- Parameters:
child
-- Returns:
- the array index on the child widget. -1 if the child is not an array element or it is not a child of the array widget.
-
initFigure
protected void initFigure(org.eclipse.draw2d.IFigure figure) Description copied from class:AbstractBaseEditPart
initialize the figure- Overrides:
initFigure
in classAbstractBaseEditPart
-
performDirectEdit
protected void performDirectEdit() -
performRequest
public void performRequest(org.eclipse.gef.Request request) - Specified by:
performRequest
in interfaceorg.eclipse.gef.EditPart
- Overrides:
performRequest
in classorg.eclipse.gef.editparts.AbstractEditPart
-
registerBasePropertyChangeHandlers
protected void registerBasePropertyChangeHandlers()- Overrides:
registerBasePropertyChangeHandlers
in classAbstractContainerEditpart
-
registerPropertyChangeHandlers
protected void registerPropertyChangeHandlers()Description copied from class:AbstractBaseEditPart
Register the property change handlers. Subclass should register its property change handlers in this method.- Specified by:
registerPropertyChangeHandlers
in classAbstractBaseEditPart
-
setIgnoreOldPVValue
public void setIgnoreOldPVValue(boolean ignoreOldValue) -
setPVValue
Set PV to given value. Should accept Double, Double[], Integer, String, maybe more.- Specified by:
setPVValue
in interfaceIPVWidgetEditpart
-
getValue
Description copied from class:AbstractContainerEditpart
By default, it returns an Object Array of its children's value. IfAbstractContainerEditpart.setValue(Object)
was called with a non Object[] input value, it will return the value of its first child.- Overrides:
getValue
in classAbstractContainerEditpart
- Returns:
- The value of the widget.
-
setValue
Description copied from class:AbstractContainerEditpart
If input value is instance of Object[] and its length is equal or larger than children size, it will write each element of value to each child according children's order. Otherwise, it will write the input value as an whole Object to every child.- Overrides:
setValue
in classAbstractContainerEditpart
- Parameters:
value
- the value to be set. It must be the compatible type for the widget. For example, a boolean widget only accept boolean or number.
-
updateWidgetSize
protected void updateWidgetSize() -
addSetPVValueListener
- Specified by:
addSetPVValueListener
in interfaceIPVWidgetEditpart
-
isPVControlWidget
public boolean isPVControlWidget()- Specified by:
isPVControlWidget
in interfaceIPVWidgetEditpart
-
setControlEnabled
public void setControlEnabled(boolean enabled) - Specified by:
setControlEnabled
in interfaceIPVWidgetEditpart
-