Refactory: remove unused classes, imports, fields and methods.
authorincastrix <incastrix>
Wed, 23 Dec 2009 17:49:48 +0000 (17:49 +0000)
committerincastrix <incastrix>
Wed, 23 Dec 2009 17:49:48 +0000 (17:49 +0000)
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/CombinedWordRule.java [deleted file]
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/CompositeReconcilingStrategy.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/ContentAssistPreference.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/CustomSourceInformationControl.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/HTMLPrinter.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/HTMLTextPresenter.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaColorManager.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaHeuristicScanner.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaIndenter.java
net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaOutlineInformationControl.java

diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/CombinedWordRule.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/CombinedWordRule.java
deleted file mode 100644 (file)
index 5bf8747..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package net.sourceforge.phpdt.internal.ui.text;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-//incastrix
-//import org.eclipse.jface.text.Assert;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.Token;
-
-/**
- * An implementation of <code>IRule</code> capable of detecting words.
- * <p>
- * Word rules also allow for the association of tokens with specific words. That
- * is, not only can the rule be used to provide tokens for exact matches, but
- * also for the generalized notion of a word in the context in which it is used.
- * A word rules uses a word detector to determine what a word is.
- * </p>
- * <p>
- * This word rule allows a word detector to be shared among different word
- * matchers. Its up to the word matchers to decide if a word matches and, in
- * this a case, which token is associated with that word.
- * </p>
- * 
- * @see IWordDetector
- * @since 3.0
- */
-public class CombinedWordRule implements IRule {
-
-       /**
-        * Word matcher, that associates matched words with tokens.
-        */
-       public static class WordMatcher {
-
-               /** The table of predefined words and token for this matcher */
-               private Map fWords = new HashMap();
-
-               /**
-                * Adds a word and the token to be returned if it is detected.
-                * 
-                * @param word
-                *            the word this rule will search for, may not be
-                *            <code>null</code>
-                * @param token
-                *            the token to be returned if the word has been found, may
-                *            not be <code>null</code>
-                */
-               public void addWord(String word, IToken token) {
-                       Assert.isNotNull(word);
-                       Assert.isNotNull(token);
-
-                       fWords.put(new CharacterBuffer(word), token);
-               }
-
-               /**
-                * Returns the token associated to the given word and the scanner state.
-                * 
-                * @param scanner
-                *            the scanner
-                * @param word
-                *            the word
-                * @return the token or <code>null</code> if none is associated by
-                *         this matcher
-                */
-               public IToken evaluate(ICharacterScanner scanner, CharacterBuffer word) {
-                       IToken token = (IToken) fWords.get(word);
-                       if (token != null)
-                               return token;
-                       return Token.UNDEFINED;
-               }
-
-               /**
-                * Removes all words.
-                */
-               public void clearWords() {
-                       fWords.clear();
-               }
-       }
-
-       /**
-        * Character buffer, mutable <b>or</b> suitable for use as key in hash
-        * maps.
-        */
-       public static class CharacterBuffer {
-
-               /** Buffer content */
-               private char[] fContent;
-
-               /** Buffer content size */
-               private int fLength = 0;
-
-               /** Is hash code cached? */
-               private boolean fIsHashCached = false;
-
-               /** The hash code */
-               private int fHashCode;
-
-               /**
-                * Initialize with the given capacity.
-                * 
-                * @param capacity
-                *            the initial capacity
-                */
-               public CharacterBuffer(int capacity) {
-                       fContent = new char[capacity];
-               }
-
-               /**
-                * Initialize with the given content.
-                * 
-                * @param string
-                *            the initial content
-                */
-               public CharacterBuffer(String content) {
-                       fContent = content.toCharArray();
-                       fLength = content.length();
-               }
-
-               /**
-                * Empties this buffer.
-                */
-               public void clear() {
-                       fIsHashCached = false;
-                       fLength = 0;
-               }
-
-               /**
-                * Appends the given character to the buffer.
-                * 
-                * @param c
-                *            the character
-                */
-               public void append(char c) {
-                       fIsHashCached = false;
-                       if (fLength == fContent.length) {
-                               char[] old = fContent;
-                               fContent = new char[old.length << 1];
-                               System.arraycopy(old, 0, fContent, 0, old.length);
-                       }
-                       fContent[fLength++] = c;
-               }
-
-               /**
-                * Returns the length of the content.
-                * 
-                * @return the length
-                */
-               public int length() {
-                       return fLength;
-               }
-
-               /**
-                * Returns the content as string.
-                * 
-                * @return the content
-                */
-               public String toString() {
-                       return new String(fContent, 0, fLength);
-               }
-
-               /**
-                * Returns the character at the given position.
-                * 
-                * @param i
-                *            the position
-                * @return the character at position <code>i</code>
-                */
-               public char charAt(int i) {
-                       return fContent[i];
-               }
-
-               /*
-                * @see java.lang.Object#hashCode()
-                */
-               public int hashCode() {
-                       if (fIsHashCached)
-                               return fHashCode;
-
-                       int hash = 0;
-                       for (int i = 0, n = fLength; i < n; i++)
-                               hash = 29 * hash + fContent[i];
-                       fHashCode = hash;
-                       fIsHashCached = true;
-                       return hash;
-               }
-
-               /*
-                * @see java.lang.Object#equals(java.lang.Object)
-                */
-               public boolean equals(Object obj) {
-                       if (obj == this)
-                               return true;
-                       if (!(obj instanceof CharacterBuffer))
-                               return false;
-                       CharacterBuffer buffer = (CharacterBuffer) obj;
-                       int length = buffer.length();
-                       if (length != fLength)
-                               return false;
-                       for (int i = 0; i < length; i++)
-                               if (buffer.charAt(i) != fContent[i])
-                                       return false;
-                       return true;
-               }
-
-               /**
-                * Is the content equal to the given string?
-                * 
-                * @param string
-                *            the string
-                * @return <code>true</code> iff the content is the same character
-                *         sequence as in the string
-                */
-               public boolean equals(String string) {
-                       int length = string.length();
-                       if (length != fLength)
-                               return false;
-                       for (int i = 0; i < length; i++)
-                               if (string.charAt(i) != fContent[i])
-                                       return false;
-                       return true;
-               }
-       }
-
-       /** Internal setting for the uninitialized column constraint */
-       private static final int UNDEFINED = -1;
-
-       /** The word detector used by this rule */
-       private IWordDetector fDetector;
-
-       /**
-        * The default token to be returned on success and if nothing else has been
-        * specified.
-        */
-       private IToken fDefaultToken;
-
-       /** The column constraint */
-       private int fColumn = UNDEFINED;
-
-       /** Buffer used for pattern detection */
-       private CharacterBuffer fBuffer = new CharacterBuffer(16);
-
-       /** List of word matchers */
-       private List fMatchers = new ArrayList();
-
-       /**
-        * Creates a rule which, with the help of an word detector, will return the
-        * token associated with the detected word. If no token has been associated,
-        * the scanner will be rolled back and an undefined token will be returned
-        * in order to allow any subsequent rules to analyze the characters.
-        * 
-        * @param detector
-        *            the word detector to be used by this rule, may not be
-        *            <code>null</code>
-        * 
-        * @see #addWord(String, IToken)
-        */
-       public CombinedWordRule(IWordDetector detector) {
-               this(detector, null, Token.UNDEFINED);
-       }
-
-       /**
-        * Creates a rule which, with the help of an word detector, will return the
-        * token associated with the detected word. If no token has been associated,
-        * the specified default token will be returned.
-        * 
-        * @param detector
-        *            the word detector to be used by this rule, may not be
-        *            <code>null</code>
-        * @param defaultToken
-        *            the default token to be returned on success if nothing else is
-        *            specified, may not be <code>null</code>
-        * 
-        * @see #addWord(String, IToken)
-        */
-       public CombinedWordRule(IWordDetector detector, IToken defaultToken) {
-               this(detector, null, defaultToken);
-       }
-
-       /**
-        * Creates a rule which, with the help of an word detector, will return the
-        * token associated with the detected word. If no token has been associated,
-        * the scanner will be rolled back and an undefined token will be returned
-        * in order to allow any subsequent rules to analyze the characters.
-        * 
-        * @param detector
-        *            the word detector to be used by this rule, may not be
-        *            <code>null</code>
-        * @param matcher
-        *            the initial word matcher
-        * 
-        * @see #addWord(String, IToken)
-        */
-       public CombinedWordRule(IWordDetector detector, WordMatcher matcher) {
-               this(detector, matcher, Token.UNDEFINED);
-       }
-
-       /**
-        * Creates a rule which, with the help of an word detector, will return the
-        * token associated with the detected word. If no token has been associated,
-        * the specified default token will be returned.
-        * 
-        * @param detector
-        *            the word detector to be used by this rule, may not be
-        *            <code>null</code>
-        * @param matcher
-        *            the initial word matcher
-        * @param defaultToken
-        *            the default token to be returned on success if nothing else is
-        *            specified, may not be <code>null</code>
-        * 
-        * @see #addWord(String, IToken)
-        */
-       public CombinedWordRule(IWordDetector detector, WordMatcher matcher,
-                       IToken defaultToken) {
-
-               Assert.isNotNull(detector);
-               Assert.isNotNull(defaultToken);
-
-               fDetector = detector;
-               fDefaultToken = defaultToken;
-               if (matcher != null)
-                       addWordMatcher(matcher);
-       }
-
-       /**
-        * Adds the given matcher.
-        * 
-        * @param matcher
-        *            the matcher
-        */
-       public void addWordMatcher(WordMatcher matcher) {
-               fMatchers.add(matcher);
-       }
-
-       /**
-        * Sets a column constraint for this rule. If set, the rule's token will
-        * only be returned if the pattern is detected starting at the specified
-        * column. If the column is smaller then 0, the column constraint is
-        * considered removed.
-        * 
-        * @param column
-        *            the column in which the pattern starts
-        */
-       public void setColumnConstraint(int column) {
-               if (column < 0)
-                       column = UNDEFINED;
-               fColumn = column;
-       }
-
-       /*
-        * @see IRule#evaluate(ICharacterScanner)
-        */
-       public IToken evaluate(ICharacterScanner scanner) {
-               int c = scanner.read();
-               if (fDetector.isWordStart((char) c)) {
-                       if (fColumn == UNDEFINED || (fColumn == scanner.getColumn() - 1)) {
-
-                               fBuffer.clear();
-                               do {
-                                       fBuffer.append((char) c);
-                                       c = scanner.read();
-                               } while (c != ICharacterScanner.EOF
-                                               && fDetector.isWordPart((char) c));
-                               scanner.unread();
-
-                               for (int i = 0, n = fMatchers.size(); i < n; i++) {
-                                       IToken token = ((WordMatcher) fMatchers.get(i)).evaluate(
-                                                       scanner, fBuffer);
-                                       if (!token.isUndefined())
-                                               return token;
-                               }
-
-                               if (fDefaultToken.isUndefined())
-                                       unreadBuffer(scanner);
-
-                               return fDefaultToken;
-                       }
-               }
-
-               scanner.unread();
-               return Token.UNDEFINED;
-       }
-
-       /**
-        * Returns the characters in the buffer to the scanner.
-        * 
-        * @param scanner
-        *            the scanner to be used
-        */
-       private void unreadBuffer(ICharacterScanner scanner) {
-               for (int i = fBuffer.length() - 1; i >= 0; i--)
-                       scanner.unread();
-       }
-}
index 5733b4f..0a99c66 100644 (file)
@@ -51,9 +51,9 @@ public class CompositeReconcilingStrategy implements IReconcilingStrategy,
         * 
         * @return the contained strategies or <code>null</code>
         */
-       public IReconcilingStrategy[] getReconcilingStrategies() {
-               return fStrategies;
-       }
+//     public IReconcilingStrategy[] getReconcilingStrategies() {
+//             return fStrategies;
+//     }
 
        /*
         * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
index 94d55bc..1b70289 100644 (file)
@@ -75,7 +75,7 @@ public class ContentAssistPreference {
        //private static final String INSERT_COMPLETION = PreferenceConstants.CODEASSIST_INSERT_COMPLETION;
 
        /** Preference key for filling argument names on method completion */
-       private static final String FILL_METHOD_ARGUMENTS = PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES;
+       //private static final String FILL_METHOD_ARGUMENTS = PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES;
 
        /** Preference key for guessing argument names on method completion */
        //private static final String GUESS_METHOD_ARGUMENTS = PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS;
@@ -324,7 +324,7 @@ public class ContentAssistPreference {
                changeHTMLProcessor(assistant, store, p);
        }
 
-       public static boolean fillArgumentsOnMethodCompletion(IPreferenceStore store) {
-               return store.getBoolean(FILL_METHOD_ARGUMENTS);
-       }
+//     public static boolean fillArgumentsOnMethodCompletion(IPreferenceStore store) {
+//             return store.getBoolean(FILL_METHOD_ARGUMENTS);
+//     }
 }
index e506949..0468435 100644 (file)
@@ -233,8 +233,8 @@ public class CustomSourceInformationControl extends
         * @param scrollIndex
         *            the new horizontal scroll index
         */
-       public void setHorizontalScrollPixel(int scrollIndex) {
-               scrollIndex = Math.max(0, scrollIndex);
-               fHorizontalScrollPixel = scrollIndex;
-       }
+//     public void setHorizontalScrollPixel(int scrollIndex) {
+//             scrollIndex = Math.max(0, scrollIndex);
+//             fHorizontalScrollPixel = scrollIndex;
+//     }
 }
index 47484da..c22fba0 100644 (file)
@@ -146,8 +146,8 @@ public class HTMLPrinter {
                }
        }
 
-       public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
-               if (paragraphReader != null)
-                       addParagraph(buffer, read(paragraphReader));
-       }
+//     public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
+//             if (paragraphReader != null)
+//                     addParagraph(buffer, read(paragraphReader));
+//     }
 }
index aa21538..4e6b8a7 100644 (file)
@@ -36,9 +36,9 @@ public class HTMLTextPresenter implements
                fEnforceUpperLineLimit = enforceUpperLineLimit;
        }
 
-       public HTMLTextPresenter() {
-               this(true);
-       }
+//     public HTMLTextPresenter() {
+//             this(true);
+//     }
 
        protected Reader createReader(String hoverInfo,
                        TextPresentation presentation) {
index 7578353..8ef58d7 100644 (file)
@@ -34,9 +34,9 @@ public class JavaColorManager implements IColorManager, IColorManagerExtension {
         * Creates a new Java color manager which automatically disposes the
         * allocated colors when the current display gets disposed.
         */
-       public JavaColorManager() {
-               this(true);
-       }
+//     public JavaColorManager() {
+//             this(true);
+//     }
 
        /**
         * Creates a new Java color manager.
index 1780e2f..e68f3c2 100644 (file)
@@ -20,9 +20,9 @@ import net.sourceforge.phpeclipse.phpeditor.php.PHPDocumentPartitioner;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
+//import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
+//import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.TextUtilities;
 
 /**
@@ -679,16 +679,16 @@ public class JavaHeuristicScanner implements Symbols {
         * @return a region describing the surrounding block, or <code>null</code>
         *         if none can be found
         */
-       public IRegion findSurroundingBlock(int offset) {
-               if (offset < 1 || offset >= fDocument.getLength())
-                       return null;
-
-               int begin = findOpeningPeer(offset - 1, LBRACE, RBRACE);
-               int end = findClosingPeer(offset, LBRACE, RBRACE);
-               if (begin == NOT_FOUND || end == NOT_FOUND)
-                       return null;
-               return new Region(begin, end + 1 - begin);
-       }
+//     public IRegion findSurroundingBlock(int offset) {
+//             if (offset < 1 || offset >= fDocument.getLength())
+//                     return null;
+//
+//             int begin = findOpeningPeer(offset - 1, LBRACE, RBRACE);
+//             int end = findClosingPeer(offset, LBRACE, RBRACE);
+//             if (begin == NOT_FOUND || end == NOT_FOUND)
+//                     return null;
+//             return new Region(begin, end + 1 - begin);
+//     }
 
        /**
         * Finds the smallest position in <code>fDocument</code> such that the
@@ -708,9 +708,9 @@ public class JavaHeuristicScanner implements Symbols {
         *         <code>bound</code>) that resides in a Java partition, or
         *         <code>NOT_FOUND</code> if none can be found
         */
-       public int findNonWhitespaceForward(int position, int bound) {
-               return scanForward(position, bound, fNonWSDefaultPart);
-       }
+//     public int findNonWhitespaceForward(int position, int bound) {
+//             return scanForward(position, bound, fNonWSDefaultPart);
+//     }
 
        /**
         * Finds the smallest position in <code>fDocument</code> such that the
@@ -751,9 +751,9 @@ public class JavaHeuristicScanner implements Symbols {
         *         <code>position</code>] that resides in a Java partition, or
         *         <code>NOT_FOUND</code> if none can be found
         */
-       public int findNonWhitespaceBackward(int position, int bound) {
-               return scanBackward(position, bound, fNonWSDefaultPart);
-       }
+//     public int findNonWhitespaceBackward(int position, int bound) {
+//             return scanBackward(position, bound, fNonWSDefaultPart);
+//     }
 
        /**
         * Finds the lowest position <code>p</code> in <code>fDocument</code>
@@ -825,9 +825,9 @@ public class JavaHeuristicScanner implements Symbols {
         *         <code>position</code>] that resides in a Java partition, or
         *         <code>NOT_FOUND</code> if none can be found
         */
-       public int scanForward(int position, int bound, char ch) {
-               return scanForward(position, bound, new CharacterMatch(ch));
-       }
+//     public int scanForward(int position, int bound, char ch) {
+//             return scanForward(position, bound, new CharacterMatch(ch));
+//     }
 
        /**
         * Finds the lowest position in <code>fDocument</code> such that the
@@ -849,9 +849,9 @@ public class JavaHeuristicScanner implements Symbols {
         *         <code>bound</code>) that resides in a Java partition, or
         *         <code>NOT_FOUND</code> if none can be found
         */
-       public int scanForward(int position, int bound, char[] chars) {
-               return scanForward(position, bound, new CharacterMatch(chars));
-       }
+//     public int scanForward(int position, int bound, char[] chars) {
+//             return scanForward(position, bound, new CharacterMatch(chars));
+//     }
 
        /**
         * Finds the highest position <code>p</code> in <code>fDocument</code>
@@ -931,9 +931,9 @@ public class JavaHeuristicScanner implements Symbols {
         *         <code>position</code>] that resides in a Java partition, or
         *         <code>NOT_FOUND</code> if none can be found
         */
-       public int scanBackward(int position, int bound, char ch) {
-               return scanBackward(position, bound, new CharacterMatch(ch));
-       }
+//     public int scanBackward(int position, int bound, char ch) {
+//             return scanBackward(position, bound, new CharacterMatch(ch));
+//     }
 
        /**
         * Finds the highest position in <code>fDocument</code> such that the
@@ -955,9 +955,9 @@ public class JavaHeuristicScanner implements Symbols {
         *         <code>position</code>] that resides in a Java partition, or
         *         <code>NOT_FOUND</code> if none can be found
         */
-       public int scanBackward(int position, int bound, char[] chars) {
-               return scanBackward(position, bound, new CharacterMatch(chars));
-       }
+//     public int scanBackward(int position, int bound, char[] chars) {
+//             return scanBackward(position, bound, new CharacterMatch(chars));
+//     }
 
        /**
         * Checks whether <code>position</code> resides in a default (Java)
index a98eacd..0a1c9a2 100644 (file)
@@ -95,9 +95,9 @@ public class JavaIndenter {
         *         reference position to <code>offset</code> resides, or
         *         <code>null</code> if it cannot be determined
         */
-       public StringBuffer getReferenceIndentation(int offset) {
-               return getReferenceIndentation(offset, false);
-       }
+//     public StringBuffer getReferenceIndentation(int offset) {
+//             return getReferenceIndentation(offset, false);
+//     }
 
        /**
         * Computes the indentation at the reference point of <code>position</code>.
@@ -332,9 +332,9 @@ public class JavaIndenter {
         * @return the reference statement relative to which <code>offset</code>
         *         should be indented, or {@link JavaHeuristicScanner#NOT_FOUND}
         */
-       public int findReferencePosition(int offset) {
-               return findReferencePosition(offset, peekChar(offset));
-       }
+//     public int findReferencePosition(int offset) {
+//             return findReferencePosition(offset, peekChar(offset));
+//     }
 
        /**
         * Peeks the next char in the document that comes after <code>offset</code>
index badd6d4..e37799c 100644 (file)
@@ -280,9 +280,9 @@ public class JavaOutlineInformationControl implements IInformationControl,
         * @param parent
         *            the parent shell
         */
-       public JavaOutlineInformationControl(Shell parent) {
-               this(parent, SWT.NONE);
-       }
+//     public JavaOutlineInformationControl(Shell parent) {
+//             this(parent, SWT.NONE);
+//     }
 
        /**
         * Creates a tree information control with the given shell as parent. The