Eclipse JDT
2.0

org.eclipse.jdt.ui.text
Class JavaTextTools

java.lang.Object
  |
  +--org.eclipse.jdt.ui.text.JavaTextTools

public class JavaTextTools
extends Object

Tools required to configure a Java text viewer. The color manager and all scanner exist only one time, i.e. the same instances are returned to all clients. Thus, clients share those tools.

This class may be instantiated; it is not intended to be subclassed.


Constructor Summary
JavaTextTools(IPreferenceStore store)
          Creates a new Java text tools collection.
 
Method Summary
protected  void adaptToPreferenceChange(PropertyChangeEvent event)
          Adapts the behavior of the contained components to the change encoded in the given event.
 boolean affectsBehavior(PropertyChangeEvent event)
          Determines whether the preference change encoded by the given event changes the behavior of one its contained components.
 IDocumentPartitioner createDocumentPartitioner()
          Factory method for creating a Java-specific document partitioner using this object's partitions scanner.
 void dispose()
          Disposes all the individual tools of this tools collection.
 RuleBasedScanner getCodeScanner()
          Returns a scanner which is configured to scan Java source code.
 IColorManager getColorManager()
          Returns the color manager which is used to manage any Java-specific colors needed for such things like syntax highlighting.
 RuleBasedScanner getJavaDocScanner()
          Returns a scanner which is configured to scan JavaDoc compliant comments.
 RuleBasedScanner getMultilineCommentScanner()
          Returns a scanner which is configured to scan Java multiline comments.
 String[] getPartitionManagingPositionCategories()
          Returns the names of the document position categories used by the document partitioners created by this object to manage their partition information.
 IPartitionTokenScanner getPartitionScanner()
          Returns a scanner which is configured to scan Java-specific partitions, which are multi-line comments, JavaDoc comments, and regular Java source code.
 RuleBasedScanner getSinglelineCommentScanner()
          Returns a scanner which is configured to scan Java singleline comments.
 RuleBasedScanner getStringScanner()
          Returns a scanner which is configured to scan Java strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTextTools

public JavaTextTools(IPreferenceStore store)
Creates a new Java text tools collection.

Parameters:
store - the preference store to initialize the text tools. The text tool instance installs a listener on the passed preference store to adapt itself to changes in the preference store. In general PreferenceConstants. getPreferenceStore() shoould be used to initialize the text tools.
Since:
2.0
See Also:
PreferenceConstants.getPreferenceStore()
Method Detail

dispose

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


getColorManager

public IColorManager getColorManager()
Returns the color manager which is used to manage any Java-specific colors needed for such things like syntax highlighting.

Returns:
the color manager to be used for Java text viewers

getCodeScanner

public RuleBasedScanner getCodeScanner()
Returns a scanner which is configured to scan Java source code.

Returns:
a Java source code scanner

getMultilineCommentScanner

public RuleBasedScanner getMultilineCommentScanner()
Returns a scanner which is configured to scan Java multiline comments.

Returns:
a Java multiline comment scanner
Since:
2.0

getSinglelineCommentScanner

public RuleBasedScanner getSinglelineCommentScanner()
Returns a scanner which is configured to scan Java singleline comments.

Returns:
a Java singleline comment scanner
Since:
2.0

getStringScanner

public RuleBasedScanner getStringScanner()
Returns a scanner which is configured to scan Java strings.

Returns:
a Java string scanner
Since:
2.0

getJavaDocScanner

public RuleBasedScanner getJavaDocScanner()
Returns a scanner which is configured to scan JavaDoc compliant comments. Notes that the start sequence "/**" and the corresponding end sequence are part of the JavaDoc comment.

Returns:
a JavaDoc scanner

getPartitionScanner

public IPartitionTokenScanner getPartitionScanner()
Returns a scanner which is configured to scan Java-specific partitions, which are multi-line comments, JavaDoc comments, and regular Java source code.

Returns:
a Java partition scanner

createDocumentPartitioner

public IDocumentPartitioner createDocumentPartitioner()
Factory method for creating a Java-specific document partitioner using this object's partitions scanner. This method is a convenience method.

Returns:
a newly created Java document partitioner

getPartitionManagingPositionCategories

public String[] getPartitionManagingPositionCategories()
Returns the names of the document position categories used by the document partitioners created by this object to manage their partition information. If the partitioners don't use document position categories, the returned result is null.

Returns:
the partition managing position categories or null if there is none

affectsBehavior

public boolean affectsBehavior(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
Since:
2.0

adaptToPreferenceChange

protected void adaptToPreferenceChange(PropertyChangeEvent event)
Adapts the behavior of the contained components to the change encoded in the given event.

Parameters:
event - the event to which to adapt
Since:
2.0

Eclipse JDT
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.