org.eclipse.cdt.internal.ui.text
Class CTextTools

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.text.CTextTools

public class CTextTools
extends java.lang.Object

This type shares all scanners and the color manager between its clients.


Constructor Summary
CTextTools()
          Creates a new C text tools collection and eagerly creates and initializes all members of this collection.
CTextTools(org.eclipse.jface.preference.IPreferenceStore store)
          Creates a new C text tools collection and eagerly creates and initializes all members of this collection.
CTextTools(org.eclipse.jface.preference.IPreferenceStore store, org.eclipse.core.runtime.Preferences coreStore)
          Creates a new C text tools collection and eagerly creates and initializes all members of this collection.
CTextTools(org.eclipse.jface.preference.IPreferenceStore store, org.eclipse.core.runtime.Preferences coreStore, boolean autoDisposeOnDisplayDispose)
          Creates a new C text tools collection and eagerly creates and initializes all members of this collection.
 
Method Summary
 void adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)
          Adapts the behavior of the contained components to the change encoded in the given event.
 boolean affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)
          Determines whether the preference change encoded by the given event changes the behavior of one its contained components.
 org.eclipse.jface.text.IDocumentPartitioner createDocumentPartitioner()
          Gets the document provider used.
 void dispose()
          Disposes all members of this tools collection.
 org.eclipse.jface.text.rules.RuleBasedScanner getCCodeScanner()
          Gets the code scanner used.
 CColorManager getColorManager()
          Gets the color manager.
 org.eclipse.jface.text.rules.RuleBasedScanner getCppCodeScanner()
          Gets the code scanner used.
 org.eclipse.jface.text.rules.RuleBasedScanner getCppPreprocessorScanner()
          Returns a scanner which is configured to scan C++ preprocessor directives.
 org.eclipse.jface.text.rules.RuleBasedScanner getCPreprocessorScanner()
          Returns a scanner which is configured to scan C preprocessor directives.
 java.lang.String getDocumentPartitioning()
          Get the document partitioning used for the C partitioner.
 org.eclipse.jface.text.rules.RuleBasedScanner getMultilineCommentScanner()
          Returns a scanner which is configured to scan C multiline comments.
 org.eclipse.jface.text.rules.IPartitionTokenScanner getPartitionScanner()
          Returns a scanner which is configured to scan C-specific partitions, which are multi-line comments, and regular C source code.
 org.eclipse.jface.text.rules.RuleBasedScanner getSinglelineCommentScanner()
          Returns a scanner which is configured to scan C singleline comments.
 org.eclipse.jface.text.rules.RuleBasedScanner getStringScanner()
          Returns a scanner which is configured to scan C strings.
 void setDocumentPartitioning(java.lang.String documentPartitioning)
          Set the document partitioning to be used for the C partitioner.
 void setupCDocument(org.eclipse.jface.text.IDocument document)
          Sets up the given document for the default partitioning.
 void setupCDocumentPartitioner(org.eclipse.jface.text.IDocument document, java.lang.String partitioning)
          Sets up the document partitioner for the given document for the given partitioning.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CTextTools

public CTextTools(org.eclipse.jface.preference.IPreferenceStore store)
Creates a new C text tools collection and eagerly creates and initializes all members of this collection.


CTextTools

public CTextTools(org.eclipse.jface.preference.IPreferenceStore store,
                  org.eclipse.core.runtime.Preferences coreStore)
Creates a new C text tools collection and eagerly creates and initializes all members of this collection.


CTextTools

public CTextTools(org.eclipse.jface.preference.IPreferenceStore store,
                  org.eclipse.core.runtime.Preferences coreStore,
                  boolean autoDisposeOnDisplayDispose)
Creates a new C text tools collection and eagerly creates and initializes all members of this collection.


CTextTools

public CTextTools()
Creates a new C text tools collection and eagerly creates and initializes all members of this collection.

Method Detail

dispose

public void dispose()
Disposes all members of this tools collection.


getColorManager

public CColorManager getColorManager()
Gets the color manager.


getCCodeScanner

public org.eclipse.jface.text.rules.RuleBasedScanner getCCodeScanner()
Gets the code scanner used.


getCppCodeScanner

public org.eclipse.jface.text.rules.RuleBasedScanner getCppCodeScanner()
Gets the code scanner used.


getPartitionScanner

public org.eclipse.jface.text.rules.IPartitionTokenScanner getPartitionScanner()
Returns a scanner which is configured to scan C-specific partitions, which are multi-line comments, and regular C source code.

Returns:
a C partition scanner

createDocumentPartitioner

public org.eclipse.jface.text.IDocumentPartitioner createDocumentPartitioner()
Gets the document provider used.


getMultilineCommentScanner

public org.eclipse.jface.text.rules.RuleBasedScanner getMultilineCommentScanner()
Returns a scanner which is configured to scan C multiline comments.

Returns:
a C multiline comment scanner

getSinglelineCommentScanner

public org.eclipse.jface.text.rules.RuleBasedScanner getSinglelineCommentScanner()
Returns a scanner which is configured to scan C singleline comments.

Returns:
a C singleline comment scanner

getStringScanner

public org.eclipse.jface.text.rules.RuleBasedScanner getStringScanner()
Returns a scanner which is configured to scan C strings.

Returns:
a C string scanner

getCPreprocessorScanner

public org.eclipse.jface.text.rules.RuleBasedScanner getCPreprocessorScanner()
Returns a scanner which is configured to scan C preprocessor directives.

Returns:
a C preprocessor directives scanner

getCppPreprocessorScanner

public org.eclipse.jface.text.rules.RuleBasedScanner getCppPreprocessorScanner()
Returns a scanner which is configured to scan C++ preprocessor directives.

Returns:
a C++ preprocessor directives scanner

affectsBehavior

public boolean affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)
Determines whether the preference change encoded by the given event changes the behavior of one its contained components.

Parameters:
event - the event to be investigated
Returns:
true if event causes a behavioral change

adaptToPreferenceChange

public void adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)
Adapts the behavior of the contained components to the change encoded in the given event.

Parameters:
event - the event to whch to adapt

setupCDocumentPartitioner

public void setupCDocumentPartitioner(org.eclipse.jface.text.IDocument document,
                                      java.lang.String partitioning)
Sets up the document partitioner for the given document for the given partitioning.

Parameters:
document - the document to be set up
partitioning - the document partitioning
Since:
3.0

setupCDocument

public void setupCDocument(org.eclipse.jface.text.IDocument document)
Sets up the given document for the default partitioning.

Parameters:
document - the document to be set up
Since:
3.0

getDocumentPartitioning

public java.lang.String getDocumentPartitioning()
Get the document partitioning used for the C partitioner.

Returns:
the document partitioning used for the C partitioner
Since:
3.1

setDocumentPartitioning

public void setDocumentPartitioning(java.lang.String documentPartitioning)
Set the document partitioning to be used for the C partitioner.

Since:
3.1