sk.uniba.euromath.editor.textEditor.viewers
Class TextScrollingGraphicalViewer

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
                  extended by sk.uniba.euromath.editor.textEditor.viewers.TextScrollingGraphicalViewer
All Implemented Interfaces:
org.eclipse.gef.EditPartViewer, org.eclipse.gef.GraphicalViewer, ISelectionProvider, IDOMSelectionChangedListener, IDOMSelectionProvider, IXMLGraphicalViewer

public class TextScrollingGraphicalViewer
extends XMLScrollingGraphicalViewer

Overrides selection funcionality of ScrollingGraphicalViewer. Selection is represented by DOMIntervalSet. Converts DOMIntervals from DOMIntervalSet to EditParts and start offset and end offset in this EditParts

Author:
Martin Kollar

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.gef.EditPartViewer
org.eclipse.gef.EditPartViewer.Conditional
 
Field Summary
 
Fields inherited from class sk.uniba.euromath.editor.xmlEditor.viewers.XMLScrollingGraphicalViewer
selection
 
Fields inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer
constantSelection, focusPart, selectionListeners
 
Constructor Summary
TextScrollingGraphicalViewer(TextEditor editor)
          Contructor.
 
Method Summary
 void deselect(org.eclipse.gef.EditPart editpart)
          Deselects edit part.
 void deselectAll()
          Deselects all selected editparts.
 void select(org.eclipse.gef.EditPart editpart)
          Selecting whole EditPart.
 void select(ITextPieceKeeper keeper, int startIndex, int endIndex)
          Selects text of keeper according to indexes.
 void setSelection(DOMIntervalSet selection)
          Deselects editparts with Ids, that were in previous selection and select editparts that are in DOMIntervalSet
 
Methods inherited from class sk.uniba.euromath.editor.xmlEditor.viewers.XMLScrollingGraphicalViewer
addSelectionChangedListener, fireSelectionChanged, getDOMSelection, getIDManager, getXMLAccess, removeSelectionChangedListener, selectionChanged, startSelectionListening, stopSelectionListening
 
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, 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, 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
 

Constructor Detail

TextScrollingGraphicalViewer

public TextScrollingGraphicalViewer(TextEditor editor)
Contructor.

Parameters:
editor - text editor that uses this GraphicalViewer
Method Detail

setSelection

public void setSelection(DOMIntervalSet selection)
Deselects editparts with Ids, that were in previous selection and select editparts that are in DOMIntervalSet

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

select

public void select(org.eclipse.gef.EditPart editpart)
Selecting whole EditPart.

Specified by:
select in interface org.eclipse.gef.EditPartViewer
Overrides:
select in class XMLScrollingGraphicalViewer
Parameters:
editpart - EditPart that is going to be selected

select

public void select(ITextPieceKeeper keeper,
                   int startIndex,
                   int endIndex)
Selects text of keeper according to indexes. It means selection is expanded by this interval. Indexes of value -1 are transformed to bounds of rendered text.

Parameters:
keeper - target for selection
startIndex - index in rendered text where start to select from, if has value -1, then is set to 0
endIndex - index of first char not to select in rendered text, if has value -1, then set to one behind keeper's rendered text

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 XMLScrollingGraphicalViewer
Parameters:
editpart - EditPart that is going to be deselected

deselectAll

public void deselectAll()
Deselects all selected editparts. At the end fires selection change.

Specified by:
deselectAll in interface org.eclipse.gef.EditPartViewer
Overrides:
deselectAll in class org.eclipse.gef.ui.parts.AbstractEditPartViewer


Copyright © 2003-2006 null. All Rights Reserved.