|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.gef.ui.parts.AbstractEditPartViewer
Nested Class Summary |
Nested classes inherited from class org.eclipse.gef.EditPartViewer |
EditPartViewer.Conditional |
Field Summary | |
protected List |
constantSelection
|
protected List |
selection
|
protected List |
selectionListeners
|
Constructor Summary | |
AbstractEditPartViewer()
|
Method Summary | |
void |
addDragSourceListener(TransferDragSourceListener listener)
Adds a TransferDragSourceListener to this viewer. |
void |
addDropTargetListener(TransferDropTargetListener listener)
Adds a TransferDropTargetListener to this viewer. |
void |
addSelectionChangedListener(ISelectionChangedListener listener)
|
void |
appendSelection(EditPart editpart)
Appends the specified EditPart to the Viewer's selection. |
abstract Control |
createControl(Composite parent)
This assumes that the subclass has created the control and simply returns the current control. |
void |
deselect(EditPart editpart)
Removes the specified EditPart from the current selection. |
void |
deselectAll()
Deselects all EditParts. |
EditPart |
findObjectAt(org.eclipse.draw2d.geometry.Point pt)
Returns null or the EditPart associated with the specified
location. |
EditPart |
findObjectAtExcluding(org.eclipse.draw2d.geometry.Point pt,
Collection exclude)
Returns null or the EditPart at the specified location,
excluding the specified set. |
protected void |
fireSelectionChanged()
Fires selection changed to the registered listeners at the time called. |
void |
flush()
Flushes all pending updates to the Viewer. |
EditPart |
getContents()
Returns the contents of this Viewer. |
MenuManager |
getContextMenu()
Returns the MenuManager for this viewer or null if no
provider exists. |
Control |
getControl()
Returns the SWT Control for this viewer. |
protected DelegatingDragAdapter |
getDelegatingDragAdapter()
|
protected DelegatingDropAdapter |
getDelegatingDropAdapter()
|
protected DragSource |
getDragSource()
|
protected DropTarget |
getDropTarget()
|
EditDomain |
getEditDomain()
Returns the EditDomain to which this viewer belongs |
EditPartFactory |
getEditPartFactory()
Returns the EditPartFactory for this viewer. |
Map |
getEditPartRegistry()
Returns the Map for registering EditParts by Keys.
|
EditPart |
getFocusEditPart()
Returns the focus EditPart . |
KeyHandler |
getKeyHandler()
Returns the KeyHandler for this viewer. |
RootEditPart |
getRootEditPart()
Returns the RootEditPart . |
List |
getSelectedEditParts()
Returns an unmodifiable List containing the selected editparts. |
ISelection |
getSelection()
|
Map |
getVisualPartMap()
Returns the Map for associating visual parts with their
EditParts . |
protected void |
handleDispose(DisposeEvent e)
Called if and when the Control is disposed. |
protected void |
hookControl()
|
protected void |
hookDragSource()
|
protected void |
hookDropTarget()
|
protected void |
init()
|
protected List |
primGetSelectedEditParts()
|
protected void |
refreshDragSourceAdapter()
|
protected void |
refreshDropTargetAdapter()
|
void |
registerAccessibleEditPart(AccessibleEditPart acc)
Used for accessibility purposes. |
void |
removeDragSourceListener(TransferDragSourceListener listener)
|
void |
removeDropTargetListener(TransferDropTargetListener listener)
|
void |
removeSelectionChangedListener(ISelectionChangedListener l)
|
void |
reveal(EditPart part)
Shows the given EditPart if it is not visible. |
void |
select(EditPart editpart)
Replaces the current selection with the specified EditPart . |
void |
setContents(EditPart editpart)
Sets the for this Viewer. |
void |
setContents(Object contents)
Creates an EditPart for the specified contents using this viewer's
EditPartFactory . |
void |
setContextMenu(MenuManager manager)
Sets the MenuManager for this viewer's context menu. |
void |
setControl(Control control)
Optionally sets the Control for this viewer. |
void |
setCursor(Cursor cursor)
Sets the cursor for the viewer's Control . |
protected void |
setDragSource(DragSource source)
|
protected void |
setDropTarget(DropTarget target)
Sets the dropTarget. |
void |
setEditDomain(EditDomain editdomain)
Sets the EditDomain for this viewer. |
void |
setEditPartFactory(EditPartFactory factory)
Sets the EditPartFactory. |
void |
setFocus(EditPart part)
Sets the focus EditPart. |
void |
setKeyHandler(KeyHandler handler)
Sets the KeyHandler . |
void |
setRootEditPart(RootEditPart editpart)
Sets the root of this viewer. |
void |
setRouteEventsToEditDomain(boolean value)
Turns on/off the routing of events directly to the Editor. |
void |
setSelection(ISelection newSelection)
This method will clear the current selection, and set the given ISelection as the current selection. |
protected void |
unhookControl()
|
void |
unregisterAccessibleEditPart(AccessibleEditPart acc)
Used for accessibility purposes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.gef.EditPartViewer |
findObjectAtExcluding |
Field Detail |
protected final List selection
protected final List constantSelection
protected List selectionListeners
Constructor Detail |
public AbstractEditPartViewer()
Method Detail |
public void addSelectionChangedListener(ISelectionChangedListener listener)
addSelectionChangedListener
in interface ISelectionProvider
public void addDragSourceListener(TransferDragSourceListener listener)
EditPartViewer
TransferDragSourceListener
to this viewer. This has the side-effect
of ensuring that a DragSource
exists for the viewer's
Control.
addDragSourceListener
in interface EditPartViewer
listener
- the listenerpublic void addDropTargetListener(TransferDropTargetListener listener)
EditPartViewer
TransferDropTargetListener
to this viewer. This has the side-effect
of ensuring that a DropTarget
exists for the viewer's
Control.
addDropTargetListener
in interface EditPartViewer
listener
- the listenerpublic void appendSelection(EditPart editpart)
EditPartViewer
EditPart
to the Viewer's selection. The
EditPart becomes the new primary selection. Fires selection changed to allISelectionChangedListener
s.
appendSelection
in interface EditPartViewer
editpart
- the EditPart to appendpublic abstract Control createControl(Composite parent)
setControl(Control)
with the newly
created control and then call super.createControl(Composite)
.
createControl
in interface EditPartViewer
parent
- the parent in which create the SWT Control
EditPartViewer.setControl(Control)
public void deselect(EditPart editpart)
EditPartViewer
EditPart
from the current selection. If the
selection becomes empty, the viewer's contents
becomes the
current selected part. The last EditPart in the new selection is made primary
.
Fires selection changed to
ISelectionChangedListener
s.
deselect
in interface EditPartViewer
editpart
- the EditPart
to deselectpublic void deselectAll()
EditPartViewer
contents
becomes the
current selection. Fires selection changed to
ISelectionChangedListener
s.
deselectAll
in interface EditPartViewer
protected void handleDispose(DisposeEvent e)
Control
is disposed. Subclasses may extend this
method to perform additional cleanup.
e
- the disposeeventpublic final EditPart findObjectAt(org.eclipse.draw2d.geometry.Point pt)
EditPartViewer
null
or the EditPart
associated with the specified
location. The location is relative to the client area of the Viewer's
Control
. An EditPart is not directly visible. It is targeted using its
visual part which it registered using the visual part
map
. What constitutes a visual part is viewer-specific. Examples include
Figures and TreeItems.
findObjectAt
in interface EditPartViewer
pt
- The location
null
or an EditPartEditPartViewer.findObjectAt(Point)
public final EditPart findObjectAtExcluding(org.eclipse.draw2d.geometry.Point pt, Collection exclude)
EditPartViewer
null
or the EditPart
at the specified location,
excluding the specified set. This method behaves similarly to EditPartViewer.findObjectAt(Point)
.
findObjectAtExcluding
in interface EditPartViewer
pt
- The mouse locationexclude
- The set of EditParts to be excluded
null
or an EditPartEditPartViewer.findObjectAtExcluding(Point, Collection)
protected void fireSelectionChanged()
public void flush()
EditPartViewer
flush
in interface EditPartViewer
EditPartViewer.flush()
public MenuManager getContextMenu()
EditPartViewer
MenuManager
for this viewer or null
if no
provider exists.
getContextMenu
in interface EditPartViewer
EditPartViewer.getContextMenu()
public EditPart getContents()
EditPartViewer
The Root of the Viewer is different. By constrast, the root is never selected or targeted, and does not correspond to something in the model.
getContents
in interface EditPartViewer
EditPart
EditPartViewer.getContents()
public Control getControl()
EditPartViewer
Control
for this viewer.
getControl
in interface EditPartViewer
Control
EditPartViewer.getControl()
protected DelegatingDragAdapter getDelegatingDragAdapter()
protected DelegatingDropAdapter getDelegatingDropAdapter()
protected DragSource getDragSource()
protected DropTarget getDropTarget()
public EditDomain getEditDomain()
EditPartViewer
EditDomain
to which this viewer belongs
getEditDomain
in interface EditPartViewer
public EditPartFactory getEditPartFactory()
EditPartViewer
EditPartFactory
for this viewer. The EditPartFactory is used
to create the contents EditPart when EditPartViewer.setContents(Object)
is called. It
is then used by all EditParts that need to create additional EditParts, such as
children.
getEditPartFactory
in interface EditPartViewer
public Map getEditPartRegistry()
EditPartViewer
Map
for registering EditParts
by Keys.
EditParts may register themselves using any method, and may register themselved
multiple times. The purpose of such registration is to allow an EditPart to be found by
other EditParts.
getEditPartRegistry
in interface EditPartViewer
public EditPart getFocusEditPart()
EditPartViewer
EditPart
. Focus refers to keyboard focus. This
is the same concept as focus in a native Tree or Table. The User can change focus
using the keyboard without affecting the currently selected objects.
getFocusEditPart
in interface EditPartViewer
EditPart
public KeyHandler getKeyHandler()
EditPartViewer
KeyHandler
for this viewer. The KeyHandler is forwarded keys
by the active Tool
. This is important, because only the current tool
knows if it is in a state in which keys should be ignored, such as during a drag. By
default, only the SelectionTool
forwards keysrokes. It
does not do so during a drag.
getKeyHandler
in interface EditPartViewer
public RootEditPart getRootEditPart()
EditPartViewer
RootEditPart
. The RootEditPart is a special EditPart
that bridges the connection to the viewer. The root is never selected.
The root does not correspond to anything in the model. The User does not interact with
the root.
The RootEditPart has a single child: the contents
.
By defining the concept of "root", GEF allows the application's "real" EditParts to be more homogeneous. For example, all non-root EditParts have a parent.
getRootEditPart
in interface EditPartViewer
EditPartViewer.getContents()
,
EditPartViewer.setRootEditPart(RootEditPart)
public List getSelectedEditParts()
EditPartViewer
List
containing the selected editparts.
getSelectedEditParts
in interface EditPartViewer
public ISelection getSelection()
getSelection
in interface ISelectionProvider
public Map getVisualPartMap()
EditPartViewer
Map
for associating visual parts with their
EditParts
. This map is used for hit-testing. Hit testing is performed by
first determining which visual part is hit, and then mapping that part to an
EditPart
. What consistutes a visual part is viewer-specific.
Examples include Figures and TreeItems.
getVisualPartMap
in interface EditPartViewer
Map
protected void hookControl()
protected void hookDragSource()
protected void hookDropTarget()
protected void init()
protected List primGetSelectedEditParts()
protected void refreshDragSourceAdapter()
protected void refreshDropTargetAdapter()
public void registerAccessibleEditPart(AccessibleEditPart acc)
EditPartViewer
registerAccessibleEditPart
in interface EditPartViewer
acc
- the AccessibleEditPartpublic void removeDragSourceListener(TransferDragSourceListener listener)
public void removeDropTargetListener(TransferDropTargetListener listener)
public void removeSelectionChangedListener(ISelectionChangedListener l)
removeSelectionChangedListener
in interface ISelectionProvider
public void reveal(EditPart part)
EditPartViewer
reveal
in interface EditPartViewer
part
- the EditPart to revealEditPartViewer.reveal(EditPart)
public void select(EditPart editpart)
EditPartViewer
EditPart
. That part
becomes the primary selection.
Fires selection changed to
ISelectionChangedListener
s.
select
in interface EditPartViewer
editpart
- the new selectionpublic void setContextMenu(MenuManager manager)
EditPartViewer
MenuManager
for this viewer's context menu. This MenuManager
creates the SWT Menu for this viewer's control.
setContextMenu
in interface EditPartViewer
manager
- the ContextMenuProvider
EditPartViewer.getControl()
public void setContents(EditPart editpart)
EditPartViewer
setContents
in interface EditPartViewer
EditPartViewer.getRootEditPart()
public void setContents(Object contents)
EditPartViewer
EditPart
for the specified contents using this viewer's
EditPartFactory
. That EditPart is then added to the RootEditPart
.
setContents
in interface EditPartViewer
contents
- the Object representing the viewer's contentsEditPartViewer.setEditPartFactory(EditPartFactory)
public void setControl(Control control)
EditPartViewer
Control
for this viewer. The viewer's control is also
set automatically if EditPartViewer.createControl(Composite)
is called.
setControl
in interface EditPartViewer
control
- the Controlpublic void setCursor(Cursor cursor)
EditPartViewer
Control
. This method should only be
called by Tools
. null
can be used to indicate that the
default cursor should be restored.
setCursor
in interface EditPartViewer
cursor
- null
or a CursorEditPartViewer.getControl()
protected void setDragSource(DragSource source)
protected void setDropTarget(DropTarget target)
public void setEditDomain(EditDomain editdomain)
EditPartViewer
EditDomain
for this viewer. The Viewer will route all mouse and
keyboard events to the EditDomain.
setEditDomain
in interface EditPartViewer
editdomain
- The EditDomainpublic void setEditPartFactory(EditPartFactory factory)
EditPartViewer
setEditPartFactory
in interface EditPartViewer
factory
- the factoryEditPartViewer.getEditPartFactory()
public void setFocus(EditPart part)
EditPartViewer
setFocus
in interface EditPartViewer
part
- the FocusPart.EditPartViewer.getFocusEditPart()
public void setKeyHandler(KeyHandler handler)
EditPartViewer
KeyHandler
.
setKeyHandler
in interface EditPartViewer
handler
- the KeyHandlerEditPartViewer.getKeyHandler()
public void setRootEditPart(RootEditPart editpart)
EditPartViewer
setRootEditPart
in interface EditPartViewer
editpart
- the RootEditPartEditPartViewer.getRootEditPart()
,
EditPartViewer.getContents()
public void setRouteEventsToEditDomain(boolean value)
EditPartViewer
EditDomain
rather than
handled in the default way.
setRouteEventsToEditDomain
in interface EditPartViewer
value
- true if the viewer should route events to the EditDomainpublic void setSelection(ISelection newSelection)
setSelection
in interface ISelectionProvider
protected void unhookControl()
public void unregisterAccessibleEditPart(AccessibleEditPart acc)
EditPartViewer
unregisterAccessibleEditPart
in interface EditPartViewer
acc
- the accessible part
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |