Modelers

org.topcased.modeler.edit
Class EListEditPart

java.lang.Object
  extended by org.eclipse.gef.editparts.AbstractEditPart
      extended by org.eclipse.gef.editparts.AbstractGraphicalEditPart
          extended by org.topcased.modeler.edit.BaseEditPart
              extended by org.topcased.modeler.edit.EListEditPart
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.gef.EditPart, org.eclipse.gef.GraphicalEditPart, org.eclipse.gef.RequestConstants

public class EListEditPart
extends BaseEditPart

This edit part adds abilities for model objects linked with the EStructuralFeature of an EMF object.
Creation : 09 jan. 2006


Nested Class Summary
protected  class EListEditPart.EListEditPartListener
          Typed listener for a GraphNode
 
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
 
Field Summary
 
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
EListEditPart(GraphNode obj, EStructuralFeature feature)
          Constructor
 
Method Summary
 void activate()
           
protected  void createEditPolicies()
          Creates edit policies and associates these with roles
protected  org.eclipse.draw2d.IFigure createFigure()
           
protected  void createNewNodes(java.util.List modelChildren)
          This method synchronizes the graphical objects with the model children
 void deactivate()
           
 java.util.List getChildren()
           
protected  DiagramElementListener getDiagramElementListener()
          Returns the listener used to listen the graphical mode object
 EObject getEObject()
          Retrieve the model object
 EStructuralFeature getEStructuralFeature()
          Get the EStructuralFeature that contains the objects that are associated with the list
protected  GraphNode getGraphNode()
          Get the graphNode model object (DI) associated with the EditPart
protected  java.util.List getModelChildren()
           
protected  void handleModelChanged(Notification msg)
          This method is called when an event occured on the model objects
 boolean isSelectable()
           
 boolean isSynchronized()
          Returns true if this editpart is synchronized with the model content
protected  void removeUnusedNodes(java.util.List modelChildren)
          emoves the contained graphnodes that do not reference a valid child
 void setSynchronized(boolean isSynchro)
          Set the synchronization state of this editpart
 
Methods inherited from class org.topcased.modeler.edit.BaseEditPart
createSnapToHelper, getAdapter, getModelListener, refresh, updateModelListening
 
Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
addChildVisual, addNodeListener, addNotify, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getContentPane, getDragTracker, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, 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, createChild, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getCommand, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, performRequest, refreshChildren, refreshVisuals, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, 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, eraseSourceFeedback, eraseTargetFeedback, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, performRequest, removeEditPartListener, removeEditPolicy, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 

Constructor Detail

EListEditPart

public EListEditPart(GraphNode obj,
                     EStructuralFeature feature)
Constructor

Parameters:
obj -
feature - the EStructuralFeature
Method Detail

getDiagramElementListener

protected DiagramElementListener getDiagramElementListener()
Description copied from class: BaseEditPart
Returns the listener used to listen the graphical mode object

Specified by:
getDiagramElementListener in class BaseEditPart
Returns:
the listener
See Also:
BaseEditPart.getDiagramElementListener()

activate

public void activate()
Specified by:
activate in interface org.eclipse.gef.EditPart
Overrides:
activate in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
See Also:
EditPart.activate()

deactivate

public void deactivate()
Specified by:
deactivate in interface org.eclipse.gef.EditPart
Overrides:
deactivate in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
See Also:
EditPart.deactivate()

isSynchronized

public boolean isSynchronized()
Returns true if this editpart is synchronized with the model content

Returns:
the synchronization state

setSynchronized

public void setSynchronized(boolean isSynchro)
Set the synchronization state of this editpart

Parameters:
isSynchro - if true the content of the list is synchronized with the model content.

createEditPolicies

protected void createEditPolicies()
Creates edit policies and associates these with roles

Overrides:
createEditPolicies in class BaseEditPart
See Also:
AbstractEditPart.createEditPolicies()
** Generated **
NOT

getEStructuralFeature

public EStructuralFeature getEStructuralFeature()
Get the EStructuralFeature that contains the objects that are associated with the list

Returns:
EStructuralFeature

getGraphNode

protected GraphNode getGraphNode()
Get the graphNode model object (DI) associated with the EditPart

Returns:
GraphNode

getEObject

public EObject getEObject()
Retrieve the model object

Returns:
the EObject associated with the EMFGraphNodeEditPart

createFigure

protected org.eclipse.draw2d.IFigure createFigure()
Specified by:
createFigure in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
See Also:
AbstractGraphicalEditPart.createFigure()

isSelectable

public boolean isSelectable()
Specified by:
isSelectable in interface org.eclipse.gef.EditPart
Overrides:
isSelectable in class org.eclipse.gef.editparts.AbstractEditPart
See Also:
EditPart.isSelectable()

getModelChildren

protected java.util.List getModelChildren()
Overrides:
getModelChildren in class org.eclipse.gef.editparts.AbstractEditPart
See Also:
AbstractEditPart.getModelChildren()

createNewNodes

protected void createNewNodes(java.util.List modelChildren)
This method synchronizes the graphical objects with the model children

Parameters:
modelChildren - the model children to display

removeUnusedNodes

protected void removeUnusedNodes(java.util.List modelChildren)
emoves the contained graphnodes that do not reference a valid child

Parameters:
modelChildren - the list of valid children

handleModelChanged

protected void handleModelChanged(Notification msg)
Description copied from class: BaseEditPart
This method is called when an event occured on the model objects

Specified by:
handleModelChanged in class BaseEditPart
Parameters:
msg - the event notification
See Also:
BaseEditPart.handleModelChanged(Notification)

getChildren

public java.util.List getChildren()
Specified by:
getChildren in interface org.eclipse.gef.EditPart
Overrides:
getChildren in class org.eclipse.gef.editparts.AbstractEditPart
See Also:
EditPart.getChildren()

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.