sk.uniba.euromath.editor.xmlEditor.editParts
Class XMLEditPart

java.lang.Object
  extended by org.eclipse.gef.editparts.AbstractEditPart
      extended by org.eclipse.gef.editparts.AbstractGraphicalEditPart
          extended by sk.uniba.euromath.editor.xmlEditor.editParts.XMLEditPart
All Implemented Interfaces:
IAdaptable, org.eclipse.gef.EditPart, org.eclipse.gef.GraphicalEditPart, org.eclipse.gef.RequestConstants, IXMLEditPart
Direct Known Subclasses:
TextEditPart

public class XMLEditPart
extends org.eclipse.gef.editparts.AbstractGraphicalEditPart
implements IXMLEditPart

The only editpart which uses xmlEditor. One speciality is, that model of this editpart is IEMFigure, because is created for IEMFigure, which needsEditPart and as childModels return list of IEMFigures.

Author:
Tomáš Studva , Martin Kollar 31.7.2005

Nested Class Summary
 
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
protected  String id
          Id of node from source document corresponding to this EditPart.
 
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
XMLEditPart(IEMFigure figure, Boolean selectable)
          Constructor.
 
Method Summary
protected  void addChildVisual(org.eclipse.gef.EditPart childEditPart, int index)
           
protected  List<IEMFigure> computeModelChildren()
           
protected  void createEditPolicies()
           
protected  org.eclipse.draw2d.IFigure createFigure()
          Due to our architecture, EditParts don't creates figures, they uses figures from renderer.
 org.eclipse.gef.DragTracker getDragTracker(org.eclipse.gef.Request request)
           
 String getID()
          Returns id of document node, which this editpart represents.
protected  List getModelChildren()
           
 org.eclipse.gef.EditPart getTargetEditPart(org.eclipse.gef.Request request)
           
protected  XMLEditPartFactory getXMLEditPartFactory()
          Returns XMLEditPartFactory.
 boolean isSelectable()
           
protected  void refreshVisuals()
           
protected  void removeChildVisual(org.eclipse.gef.EditPart childEditPart)
           
 void setID(String id)
           
 void setSelectability(Boolean value)
          Sets if the editPart can be selected or no.
 String toString()
           
 
Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
activate, addNodeListener, addNotify, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, deactivate, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getAdapter, getContentPane, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refresh, refreshSourceConnections, refreshTargetConnections, registerVisuals, 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, getChildren, getCommand, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getParent, getRoot, getSelected, getViewer, hasFocus, installEditPolicy, isActive, performRequest, refreshChildren, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, 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.GraphicalEditPart
addNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint
 
Methods inherited from interface org.eclipse.gef.EditPart
activate, addEditPartListener, addNotify, deactivate, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getViewer, hasFocus, installEditPolicy, isActive, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

id

protected String id
Id of node from source document corresponding to this EditPart.

Constructor Detail

XMLEditPart

public XMLEditPart(IEMFigure figure,
                   Boolean selectable)
Constructor.

Parameters:
figure - not null
selectable - if then this EditPart can be selected
Method Detail

getTargetEditPart

public org.eclipse.gef.EditPart getTargetEditPart(org.eclipse.gef.Request request)
Specified by:
getTargetEditPart in interface org.eclipse.gef.EditPart
Overrides:
getTargetEditPart in class org.eclipse.gef.editparts.AbstractEditPart
See Also:
EditPart.getTargetEditPart(org.eclipse.gef.Request)

computeModelChildren

protected List<IEMFigure> computeModelChildren()
Returns:
By depth search returns descendants figures which needs EditPart.

getXMLEditPartFactory

protected XMLEditPartFactory getXMLEditPartFactory()
Returns XMLEditPartFactory.

Returns:
XMLEditPartFactory

getModelChildren

protected List getModelChildren()
Overrides:
getModelChildren in class org.eclipse.gef.editparts.AbstractEditPart
Returns:
Returns precomputed model children - figures which needs editparts.

createFigure

protected org.eclipse.draw2d.IFigure createFigure()
Due to our architecture, EditParts don't creates figures, they uses figures from renderer.

Specified by:
createFigure in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
Returns:
null

createEditPolicies

protected void createEditPolicies()
Specified by:
createEditPolicies in class org.eclipse.gef.editparts.AbstractEditPart

getID

public String getID()
Description copied from interface: IXMLEditPart
Returns id of document node, which this editpart represents.

Specified by:
getID in interface IXMLEditPart
Returns:
id of node, or null

setID

public void setID(String id)
Parameters:
id - sets id

refreshVisuals

protected void refreshVisuals()
Overrides:
refreshVisuals in class org.eclipse.gef.editparts.AbstractEditPart

addChildVisual

protected void addChildVisual(org.eclipse.gef.EditPart childEditPart,
                              int index)
Overrides:
addChildVisual in class org.eclipse.gef.editparts.AbstractGraphicalEditPart

removeChildVisual

protected void removeChildVisual(org.eclipse.gef.EditPart childEditPart)
Overrides:
removeChildVisual in class org.eclipse.gef.editparts.AbstractGraphicalEditPart

getDragTracker

public org.eclipse.gef.DragTracker getDragTracker(org.eclipse.gef.Request request)
Specified by:
getDragTracker in interface org.eclipse.gef.EditPart
Overrides:
getDragTracker in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
Parameters:
request - can be anything, the result does not depent on request
Returns:
XMLDragTracker

setSelectability

public void setSelectability(Boolean value)
Sets if the editPart can be selected or no.

Parameters:
value - if true then the EditPart can be selected

isSelectable

public boolean isSelectable()
Specified by:
isSelectable in interface org.eclipse.gef.EditPart
Overrides:
isSelectable in class org.eclipse.gef.editparts.AbstractEditPart
Returns:
true if the EditPart can be selected, used when clicking on this editPart
See Also:
AbstractEditPart.isSelectable()

toString

public String toString()
Overrides:
toString in class org.eclipse.gef.editparts.AbstractEditPart


Copyright © 2003-2006 null. All Rights Reserved.