diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java index 24d7ee1f640..58eea75eda1 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/ColorManager.java @@ -12,7 +12,6 @@ package org.eclipse.cdt.make.internal.ui.text; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import org.eclipse.jface.text.source.ISharedTextColors; @@ -21,7 +20,6 @@ import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Display; public class ColorManager implements ISharedTextColors { - public static final String MAKE_COMMENT_COLOR ="org.eclipse.cdt.make.ui.editor.comment"; //$NON-NLS-1$ public static final String MAKE_KEYWORD_COLOR = "org.eclipse.cdt.make.ui.editor.keyword"; //$NON-NLS-1$ public static final String MAKE_FUNCTION_COLOR = "org.eclipse.cdt.make.ui.editor.function"; //$NON-NLS-1$ @@ -52,19 +50,13 @@ public class ColorManager implements ISharedTextColors { protected Map fColorTable = new HashMap(10); - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.ISharedTextColors#dispose() - */ @Override public void dispose() { - Iterator e = fColorTable.values().iterator(); - while (e.hasNext()) - (e.next()).dispose(); + for (Color color : fColorTable.values()) { + color.dispose(); + } } - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.ISharedTextColors#getColor(org.eclipse.swt.graphics.RGB) - */ @Override public Color getColor(RGB rgb) { Color color = fColorTable.get(rgb); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java index 41f01c2fffa..9390183ad7b 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 QNX Software Systems and others. + * Copyright (c) 2000, 2013 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,22 +10,17 @@ *******************************************************************************/ package org.eclipse.cdt.make.internal.ui.text; - import java.util.Comparator; import org.eclipse.jface.text.contentassist.ICompletionProposal; public class CompletionProposalComparator implements Comparator { - /** * Constructor for CompletionProposalComparator. */ public CompletionProposalComparator() { } - /* (non-Javadoc) - * @see Comparator#compare(Object, Object) - */ @Override public int compare(ICompletionProposal c1, ICompletionProposal c2) { return c1.getDisplayString().compareToIgnoreCase(c2.getDisplayString()); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java index a757f2a835a..0f127bcf76e 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2013 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,16 +8,15 @@ * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.make.internal.ui.text; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewer; - + /** - * Used to scan and detect for SQL keywords + * Used to scan and detect for SQL keywords */ public class WordPartDetector { String wordPart = ""; //$NON-NLS-1$ @@ -25,7 +24,7 @@ public class WordPartDetector { /** * WordPartDetector. - * @param viewer is a text viewer + * @param viewer is a text viewer * @param documentOffset into the SQL document */ public WordPartDetector(ITextViewer viewer, int documentOffset) { @@ -39,7 +38,7 @@ public class WordPartDetector { */ public WordPartDetector(IDocument doc, int documentOffset) { offset = documentOffset - 1; - int endOffset = documentOffset; + int endOffset = documentOffset; try { IRegion region = doc.getLineInformationOfOffset(documentOffset); int top = region.getOffset(); @@ -48,8 +47,8 @@ public class WordPartDetector { offset--; } while (endOffset < bottom && isMakefileLetter(doc.getChar(endOffset))) { - endOffset++; - } + endOffset++; + } //we've been one step too far : increase the offset offset++; wordPart = doc.get(offset, endOffset - offset); @@ -61,7 +60,7 @@ public class WordPartDetector { public static boolean inMacro(ITextViewer viewer, int offset) { return inMacro(viewer.getDocument(), offset); } - + public static boolean inMacro(IDocument document, int offset) { boolean isMacro = false; // Try to figure out if we are in a Macro. @@ -81,15 +80,11 @@ public class WordPartDetector { return isMacro; } - - /** - * @return String - */ @Override public String toString() { return wordPart; } - + public int getOffset() { return offset; }