org.eclipse.xtext.ui.editor.doubleClicking
Class FixedCharCountPartitionDoubleClickSelector

java.lang.Object
  extended by org.eclipse.jface.text.DefaultTextDoubleClickStrategy
      extended by org.eclipse.xtext.ui.editor.doubleClicking.AbstractWordAwareDoubleClickStrategy
          extended by org.eclipse.xtext.ui.editor.doubleClicking.AbstractPartitionDoubleClickSelector
              extended by org.eclipse.xtext.ui.editor.doubleClicking.FixedCharCountPartitionDoubleClickSelector
All Implemented Interfaces:
org.eclipse.jface.text.ITextDoubleClickStrategy

public class FixedCharCountPartitionDoubleClickSelector
extends AbstractPartitionDoubleClickSelector

Custom partition selector that allows to strip a fixed set of characters from the beginning and the end of a partition.

The implementation was heavily adapted from org.eclipse.jdt.internal.ui.text.java.PartitionDoubleClickSelector

.

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
FixedCharCountPartitionDoubleClickSelector(java.lang.String partitioning, int leftBorder, int rightBorder)
          Creates a new partition double click selector for the given document partitioning.
 
Method Summary
protected  org.eclipse.jface.text.IRegion getSelectedRegion(org.eclipse.jface.text.IDocument document, org.eclipse.jface.text.ITypedRegion completePartition)
           
 
Methods inherited from class org.eclipse.xtext.ui.editor.doubleClicking.AbstractPartitionDoubleClickSelector
findExtendedDoubleClickSelection
 
Methods inherited from class org.eclipse.xtext.ui.editor.doubleClicking.AbstractWordAwareDoubleClickStrategy
createBreakIterator, findWord
 
Methods inherited from class org.eclipse.jface.text.DefaultTextDoubleClickStrategy
doubleClicked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedCharCountPartitionDoubleClickSelector

public FixedCharCountPartitionDoubleClickSelector(java.lang.String partitioning,
                                                  int leftBorder,
                                                  int rightBorder)
Creates a new partition double click selector for the given document partitioning.

Parameters:
partitioning - the document partitioning
leftBorder - number of characters to ignore from the left border of the partition
rightBorder - number of characters to ignore from the right border of the partition
Method Detail

getSelectedRegion

protected org.eclipse.jface.text.IRegion getSelectedRegion(org.eclipse.jface.text.IDocument document,
                                                           org.eclipse.jface.text.ITypedRegion completePartition)
                                                    throws org.eclipse.jface.text.BadLocationException
Overrides:
getSelectedRegion in class AbstractPartitionDoubleClickSelector
Throws:
org.eclipse.jface.text.BadLocationException