Package de.cau.cs.kieler.klighd.ui
Class KlighdTextSelection
java.lang.Object
de.cau.cs.kieler.klighd.ui.KlighdTextSelection
- All Implemented Interfaces:
IKlighdSelection,Iterable,org.eclipse.jface.text.ITextSelection,org.eclipse.jface.viewers.ISelection,org.eclipse.jface.viewers.IStructuredSelection
public class KlighdTextSelection
extends Object
implements IKlighdSelection, org.eclipse.jface.viewers.IStructuredSelection, org.eclipse.jface.text.ITextSelection
KLighD-specific implementation of
Its aim is to broadcast the selection of cursor selectable label's text to platform's
In order to let the Properties View also react on this type of selection this class also implements
Be aware of the risk of recursion!
ITextSelection.Its aim is to broadcast the selection of cursor selectable label's text to platform's
ISelectionService.In order to let the Properties View also react on this type of selection this class also implements
IStructuredSelection by providing itself as the only element.Be aware of the risk of recursion!
- Author:
- chsch
-
Constructor Summary
ConstructorsConstructorDescriptionKlighdTextSelection(String theText, int theOffset, boolean isCompleteLine, boolean isCompleteLabel, KlighdNode.KlighdFigureNode<KText> figureNode, IViewer theViewer) Standard Constructor. -
Method Summary
Modifier and TypeMethodDescriptionIterator<org.eclipse.emf.ecore.EObject>intDeprecated.this method still simply returns zerogetKNode()intintintDeprecated.this method still simply returns zerogetText()booleanbooleanDeprecated.this method may still return wrong valuesbooleanisEmpty()iterator()intsize()toArray()toList()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
KlighdTextSelection
public KlighdTextSelection(String theText, int theOffset, boolean isCompleteLine, boolean isCompleteLabel, KlighdNode.KlighdFigureNode<KText> figureNode, IViewer theViewer) Standard Constructor.- Parameters:
theText- the text selectiontheOffset- seeITextSelection.getOffset()isCompleteLine-trueif whole line is selectedisCompleteLabel-trueif whole label is selectedfigureNode- the underlyingKGraphElementcontaining the selected texttheViewer-
-
-
Method Details
-
isCompleteLine
public boolean isCompleteLine()Deprecated.this method may still return wrong values- Returns:
- the completeLine
-
isCompleteLabel
public boolean isCompleteLabel()- Returns:
- the completeLabel
-
getViewer
- Specified by:
getViewerin interfaceIKlighdSelection- Returns:
- the viewer
-
getViewContext
- Specified by:
getViewContextin interfaceIKlighdSelection- Returns:
- the
ViewContext
-
getViewElement
- Returns:
- the corresponding
KTextinstance.
-
getKGraphElement
- Returns:
- the corresponding
KGraphElementinstance.
-
getKLabel
- Returns:
- the corresponding
KLabelinstance, may benull.
-
getKNode
- Returns:
- the parent
KNodeofgetKGraphElement()
-
diagramElementsIterator
- Specified by:
diagramElementsIteratorin interfaceIKlighdSelection
-
toString
-
getText
- Specified by:
getTextin interfaceorg.eclipse.jface.text.ITextSelection- Returns:
- the text
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceorg.eclipse.jface.viewers.ISelection
-
getOffset
public int getOffset()- Specified by:
getOffsetin interfaceorg.eclipse.jface.text.ITextSelection
-
getLength
public int getLength()- Specified by:
getLengthin interfaceorg.eclipse.jface.text.ITextSelection
-
getStartLine
public int getStartLine()Deprecated.this method still simply returns zero- Specified by:
getStartLinein interfaceorg.eclipse.jface.text.ITextSelection
-
getEndLine
public int getEndLine()Deprecated.this method still simply returns zero- Specified by:
getEndLinein interfaceorg.eclipse.jface.text.ITextSelection
-
getFirstElement
- Specified by:
getFirstElementin interfaceorg.eclipse.jface.viewers.IStructuredSelection
-
iterator
-
size
public int size()- Specified by:
sizein interfaceorg.eclipse.jface.viewers.IStructuredSelection
-
toArray
- Specified by:
toArrayin interfaceorg.eclipse.jface.viewers.IStructuredSelection
-
toList
- Specified by:
toListin interfaceorg.eclipse.jface.viewers.IStructuredSelection
-