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

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

public class XMLScrollingGraphicalViewer
extends org.eclipse.gef.ui.parts.ScrollingGraphicalViewer
implements IXMLGraphicalViewer

Scrolling graphical viewer capable of performing selections over XML. Selection object is DOMIntervalSet.

Author:
Martin Kollar

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.gef.EditPartViewer
org.eclipse.gef.EditPartViewer.Conditional
 
Field Summary
protected  DOMIntervalSet selection
          Local selection for this viewer.
 
Fields inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer
constantSelection, focusPart, selectionListeners
 
Constructor Summary
XMLScrollingGraphicalViewer(XMLEditor editor)
          Contructor.
 
Method Summary
 void addSelectionChangedListener(IDOMSelectionChangedListener listener)
          Adds a listener for selection changes in this selection provider.
 void deselect(org.eclipse.gef.EditPart editpart)
          Deselects edit part.
protected  void fireSelectionChanged()
          Fires event to listeners when selection was changed.
 DOMIntervalSet getDOMSelection()
          Returns copy of the current selection of provider.
protected  IDManager getIDManager()
          Helper getter.
protected  XMLAccess getXMLAccess()
          Helper getter.
 void removeSelectionChangedListener(IDOMSelectionChangedListener listener)
          Removes the given selection change listener from this selection provider.
 void select(org.eclipse.gef.EditPart editpart)
          Selects editpart.
 void selectionChanged(DOMSelectionChangedEvent event)
          Selection changed in some synchronized selection provider.
 void setSelection(DOMIntervalSet selection)
          Deselects editparts with Ids, that were in previous selection and select editparts that are in DOMIntervalSet and sends this selection to IDOMSelectionListeners
protected  void startSelectionListening()
          Starts listening to selection change events.
protected  void stopSelectionListening()
          Stops listening to selection change events.
 
Methods inherited from class org.eclipse.gef.ui.parts.ScrollingGraphicalViewer
createControl, getFigureCanvas, reveal, setRootFigure
 
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalViewerImpl
createDefaultRoot, createLightweightSystem, findHandleAt, findObjectAtExcluding, flush, getEventDispatcher, getLayerManager, getLightweightSystem, getRootFigure, handleDispose, handleFocusGained, handleFocusLost, hookControl, hookDropTarget, registerAccessibleEditPart, setContextMenu, setCursor, setDragSource, setEditDomain, setRootEditPart, 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

selection

protected DOMIntervalSet selection
Local selection for this viewer.

Constructor Detail

XMLScrollingGraphicalViewer

public XMLScrollingGraphicalViewer(XMLEditor editor)
Contructor.

Parameters:
editor - XMLEditor that uses this GraphicalViewer
Method Detail

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 listener is not registered.

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

getDOMSelection

public 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(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)
Selection changed in some synchronized selection provider. Synchronize selection - set in this viewer same selection.

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

stopSelectionListening

protected void stopSelectionListening()
Stops listening to selection change events.


startSelectionListening

protected void startSelectionListening()
Starts listening to selection change events.


fireSelectionChanged

protected void fireSelectionChanged()
Fires event to listeners when selection was changed.

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

select

public void select(org.eclipse.gef.EditPart editpart)
Selects 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)
Deselects edit part.

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

getIDManager

protected IDManager getIDManager()
Helper getter.

Returns:
IDManager instance

getXMLAccess

protected XMLAccess getXMLAccess()
Helper getter.

Returns:
XMLAccess instance


Copyright © 2003-2006 null. All Rights Reserved.