sk.uniba.euromath.editor.xmlEditor.viewers
Class XMLGraphicalViewerImpl

java.lang.Object
  extended by org.eclipse.gef.ui.parts.AbstractEditPartViewer
      extended by org.eclipse.gef.ui.parts.GraphicalViewerImpl
          extended by sk.uniba.euromath.editor.xmlEditor.viewers.XMLGraphicalViewerImpl
All Implemented Interfaces:
org.eclipse.gef.EditPartViewer, org.eclipse.gef.GraphicalViewer, ISelectionProvider, IDOMSelectionChangedListener, IDOMSelectionProvider, IXMLGraphicalViewer

public class XMLGraphicalViewerImpl
extends org.eclipse.gef.ui.parts.GraphicalViewerImpl
implements IXMLGraphicalViewer

Author:
Martin Kollar

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.gef.EditPartViewer
org.eclipse.gef.EditPartViewer.Conditional
 
Field Summary
protected  List<IDOMSelectionChangedListener> selectionChangedListeners
           
 
Fields inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer
constantSelection, focusPart, selectionListeners
 
Constructor Summary
XMLGraphicalViewerImpl(XMLEditor editor)
           
 
Method Summary
 void addSelectionChangedListener(IDOMSelectionChangedListener listener)
          Adds a listener for selection changes in this selection provider.
 void deselect(org.eclipse.gef.EditPart editpart)
           
protected  void fireSelectionChanged()
          This is called when new editpart is selected or deselected
 sk.baka.ikslibs.interval.DOMIntervalSet getDOMSelection()
          Returns copy of the current selection of provider.
 sk.baka.ikslibs.interval.DOMIntervalSet getLocalSelection()
           
 void removeSelectionChangedListener(IDOMSelectionChangedListener listener)
          Removes the given selection change listener from this selection provider.
 void select(org.eclipse.gef.EditPart editpart)
           
 void selectionChanged(DOMSelectionChangedEvent event)
          Effect is same as using setSelection
 void setSelection(sk.baka.ikslibs.interval.DOMIntervalSet selection)
          Deselects editparts with Ids, that were in previous selection and select editparts that are in DOMIntervalSet and sends this selection to IDOMSelectionListeners
 void showSelection(sk.baka.ikslibs.interval.DOMIntervalSet selection)
          Deselects editparts with Ids, that were in previous selection and select editparts that are in DOMIntervalSet and sends this selection to IDOMSelectionListeners
 
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalViewerImpl
createControl, createDefaultRoot, createLightweightSystem, findHandleAt, findObjectAtExcluding, flush, getEventDispatcher, getLayerManager, getLightweightSystem, getRootFigure, handleDispose, handleFocusGained, handleFocusLost, hookControl, hookDropTarget, registerAccessibleEditPart, reveal, setContextMenu, setCursor, setDragSource, setEditDomain, setRootEditPart, setRootFigure, setRouteEventsToEditDomain, unhookControl, unregisterAccessibleEditPart
 
Methods inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer
addDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, addSelectionChangedListener, appendSelection, deselectAll, findObjectAt, findObjectAtExcluding, getContents, getContextMenu, getControl, getDelegatingDragAdapter, getDelegatingDropAdapter, getDragSource, getDropTarget, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, hookDragSource, init, primGetSelectedEditParts, refreshDragSourceAdapter, refreshDropTargetAdapter, removeDragSourceListener, removeDragSourceListener, removeDropTargetListener, removeDropTargetListener, removePropertyChangeListener, removeSelectionChangedListener, setContents, setContents, setControl, setDropTarget, setEditPartFactory, setFocus, setKeyHandler, setProperty, setSelection, setSelectionManager
 
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.GraphicalViewer
findHandleAt
 
Methods inherited from interface org.eclipse.gef.EditPartViewer
addDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, appendSelection, createControl, deselectAll, findObjectAt, findObjectAtExcluding, findObjectAtExcluding, flush, getContents, getContextMenu, getControl, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, registerAccessibleEditPart, removeDragSourceListener, removeDragSourceListener, removeDropTargetListener, removeDropTargetListener, removePropertyChangeListener, reveal, setContents, setContents, setContextMenu, setControl, setCursor, setEditDomain, setEditPartFactory, setFocus, setKeyHandler, setProperty, setRootEditPart, setRouteEventsToEditDomain, setSelectionManager, unregisterAccessibleEditPart
 
Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider
addSelectionChangedListener, removeSelectionChangedListener, setSelection
 

Field Detail

selectionChangedListeners

protected List<IDOMSelectionChangedListener> selectionChangedListeners
Constructor Detail

XMLGraphicalViewerImpl

public XMLGraphicalViewerImpl(XMLEditor editor)
Parameters:
editor - XMLEditor that uses this GraphicalViewer to show his state
Method Detail

showSelection

public void showSelection(sk.baka.ikslibs.interval.DOMIntervalSet selection)
Deselects editparts with Ids, that were in previous selection and select editparts that are in DOMIntervalSet and sends this selection to IDOMSelectionListeners

Specified by:
showSelection in interface IXMLGraphicalViewer
Parameters:
selection - DOMIntervalSet containing DOMInetervals, that have to be selected

addSelectionChangedListener

public void addSelectionChangedListener(IDOMSelectionChangedListener listener)
Description copied from interface: IDOMSelectionProvider
Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.

Specified by:
addSelectionChangedListener in interface IDOMSelectionProvider
Parameters:
listener - new listener to be add from selectionChangedListeners

removeSelectionChangedListener

public void removeSelectionChangedListener(IDOMSelectionChangedListener listener)
Description copied from interface: IDOMSelectionProvider
Removes the given selection change listener from this selection provider. Has no affect if an identical listener is not registered.

Specified by:
removeSelectionChangedListener in interface IDOMSelectionProvider
Parameters:
listener - listener to be removed from selectionChangedListeners

getDOMSelection

public sk.baka.ikslibs.interval.DOMIntervalSet getDOMSelection()
Description copied from interface: IDOMSelectionProvider
Returns copy of the current selection of provider.

Specified by:
getDOMSelection in interface IDOMSelectionProvider
Returns:
globalSelection

setSelection

public void setSelection(sk.baka.ikslibs.interval.DOMIntervalSet selection)
Deselects editparts with Ids, that were in previous selection and select editparts that are in DOMIntervalSet and sends this selection to IDOMSelectionListeners

Specified by:
setSelection in interface IDOMSelectionProvider
Parameters:
selection - DOMIntervalSet containing DOMInetervals, that have to be selected

selectionChanged

public void selectionChanged(DOMSelectionChangedEvent event)
Effect is same as using setSelection

Specified by:
selectionChanged in interface IDOMSelectionChangedListener
Parameters:
event - DOMSelectionChangedEvent that contains source of new selction, that should be some XMLEditor and DOMIntervalSet as selection

fireSelectionChanged

protected void fireSelectionChanged()
This is called when new editpart is selected or deselected

Overrides:
fireSelectionChanged in class org.eclipse.gef.ui.parts.AbstractEditPartViewer

select

public void select(org.eclipse.gef.EditPart editpart)
Specified by:
select in interface org.eclipse.gef.EditPartViewer
Overrides:
select in class org.eclipse.gef.ui.parts.AbstractEditPartViewer
Parameters:
editpart - EditPart that is going to be selected

deselect

public void deselect(org.eclipse.gef.EditPart editpart)
Specified by:
deselect in interface org.eclipse.gef.EditPartViewer
Overrides:
deselect in class org.eclipse.gef.ui.parts.AbstractEditPartViewer
Parameters:
editpart - EditPart that is going to be deselected
See Also:
EditPart#setSelected(EditPart.SELECTED_NONE)

getLocalSelection

public sk.baka.ikslibs.interval.DOMIntervalSet getLocalSelection()
Returns:
local selection of this GraphicalViewer


Copyright © 2003-2006 null. All Rights Reserved.