Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2008-09-11 12:01:34 +0000
committerDani Megert2008-09-11 12:01:34 +0000
commit632fd1ce2f0a9ab9359727ceae521e223ae22973 (patch)
treeb584161996bfb35f9dd2e5dd5ebf1ca5b15493d3 /org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui
parentecd77176ea6b00c6d7f9f6d751105808d9309158 (diff)
downloadeclipse.platform.text-632fd1ce2f0a9ab9359727ceae521e223ae22973.tar.gz
eclipse.platform.text-632fd1ce2f0a9ab9359727ceae521e223ae22973.tar.xz
eclipse.platform.text-632fd1ce2f0a9ab9359727ceae521e223ae22973.zip
Removed trailing whitespace and organized the importsv20080909-ascu
Diffstat (limited to 'org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui')
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java8
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java33
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java4
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java100
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java26
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java2
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java21
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java9
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java4
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java36
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java16
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java20
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java28
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java16
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java12
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java10
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java2
19 files changed, 242 insertions, 169 deletions
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java
index 6f49c19f2..5a1d0badb 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java
@@ -11,10 +11,20 @@
package org.eclipse.ui.examples.javaeditor;
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
+
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+import org.eclipse.ui.texteditor.RetargetTextEditorAction;
+import org.eclipse.ui.texteditor.TextEditorAction;
+
import org.eclipse.ui.editors.text.TextEditorActionContributor;
-import org.eclipse.ui.texteditor.*;
/**
* Contributes interesting Java actions to the desktop's Edit menu and the toolbar.
@@ -31,33 +41,33 @@ public class JavaActionContributor extends TextEditorActionContributor {
public JavaActionContributor() {
super();
fContentAssistProposal= new RetargetTextEditorAction(JavaEditorMessages.getResourceBundle(), "ContentAssistProposal."); //$NON-NLS-1$
- fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
+ fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
fContentAssistTip= new RetargetTextEditorAction(JavaEditorMessages.getResourceBundle(), "ContentAssistTip."); //$NON-NLS-1$
fContentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
fTogglePresentation= new PresentationAction();
}
-
+
/*
* @see IEditorActionBarContributor#init(IActionBars)
*/
public void init(IActionBars bars) {
super.init(bars);
-
+
IMenuManager menuManager= bars.getMenuManager();
IMenuManager editMenu= menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
if (editMenu != null) {
editMenu.add(new Separator());
editMenu.add(fContentAssistProposal);
editMenu.add(fContentAssistTip);
- }
-
+ }
+
IToolBarManager toolBarManager= bars.getToolBarManager();
if (toolBarManager != null) {
toolBarManager.add(new Separator());
toolBarManager.add(fTogglePresentation);
}
}
-
+
private void doSetActiveEditor(IEditorPart part) {
super.setActiveEditor(part);
@@ -71,7 +81,7 @@ public class JavaActionContributor extends TextEditorActionContributor {
fTogglePresentation.setEditor(editor);
fTogglePresentation.update();
}
-
+
/*
* @see IEditorActionBarContributor#setActiveEditor(IEditorPart)
*/
@@ -79,7 +89,7 @@ public class JavaActionContributor extends TextEditorActionContributor {
super.setActiveEditor(part);
doSetActiveEditor(part);
}
-
+
/*
* @see IEditorActionBarContributor#dispose()
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java
index 3ad829e77..511478a74 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java
@@ -11,14 +11,16 @@
package org.eclipse.ui.examples.javaeditor;
-import org.eclipse.jface.text.*;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.source.IAnnotationHover;
import org.eclipse.jface.text.source.ISourceViewer;
-/**
+/**
* The JavaAnnotationHover provides the hover support for java editors.
*/
-
+
public class JavaAnnotationHover implements IAnnotationHover {
/* (non-Javadoc)
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java
index 2cc0bb7a5..1bb39e257 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java
@@ -15,13 +15,28 @@ import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.jface.text.*;
-import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.BadPositionCategoryException;
+import org.eclipse.jface.text.DefaultPositionUpdater;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IPositionUpdater;
+import org.eclipse.jface.text.Position;
+
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
/**
* A content outline page which always represents the content of the
@@ -165,7 +180,7 @@ public class JavaContentOutlinePage extends ContentOutlinePage {
/**
* Creates a content outline page using the given provider and the given editor.
- *
+ *
* @param provider the document provider
* @param editor the editor
*/
@@ -174,7 +189,7 @@ public class JavaContentOutlinePage extends ContentOutlinePage {
fDocumentProvider= provider;
fTextEditor= editor;
}
-
+
/* (non-Javadoc)
* Method declared on ContentOutlinePage
*/
@@ -190,7 +205,7 @@ public class JavaContentOutlinePage extends ContentOutlinePage {
if (fInput != null)
viewer.setInput(fInput);
}
-
+
/* (non-Javadoc)
* Method declared on ContentOutlinePage
*/
@@ -212,17 +227,17 @@ public class JavaContentOutlinePage extends ContentOutlinePage {
}
}
}
-
+
/**
* Sets the input of the outline page
- *
+ *
* @param input the input of this outline page
*/
public void setInput(Object input) {
fInput= input;
update();
}
-
+
/**
* Updates the outline page.
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java
index 84586ca81..ceb1564dc 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java
@@ -18,10 +18,10 @@ import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.rules.FastPartitioner;
/**
- *
+ *
*/
public class JavaDocumentSetupParticipant implements IDocumentSetupParticipant {
-
+
/**
*/
public JavaDocumentSetupParticipant() {
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java
index 62783e167..53de94152 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java
@@ -13,11 +13,11 @@ package org.eclipse.ui.examples.javaeditor;
import java.util.ResourceBundle;
+import org.eclipse.swt.widgets.Composite;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.widgets.Composite;
-
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.ISelection;
@@ -37,30 +37,32 @@ import org.eclipse.jface.text.source.projection.ProjectionSupport;
import org.eclipse.jface.text.source.projection.ProjectionViewer;
import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
import org.eclipse.ui.texteditor.TextEditorAction;
import org.eclipse.ui.texteditor.TextOperationAction;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.editors.text.TextEditor;
/**
* Java specific text editor.
*/
public class JavaEditor extends TextEditor {
-
-
+
+
private class DefineFoldingRegionAction extends TextEditorAction {
public DefineFoldingRegionAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
super(bundle, prefix, editor);
}
-
+
private IAnnotationModel getAnnotationModel(ITextEditor editor) {
return (IAnnotationModel) editor.getAdapter(ProjectionAnnotationModel.class);
}
-
+
/*
* @see org.eclipse.jface.action.Action#run()
*/
@@ -72,10 +74,10 @@ public class JavaEditor extends TextEditor {
if (!textSelection.isEmpty()) {
IAnnotationModel model= getAnnotationModel(editor);
if (model != null) {
-
+
int start= textSelection.getStartLine();
int end= textSelection.getEndLine();
-
+
try {
IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput());
int offset= document.getLineOffset(start);
@@ -102,28 +104,28 @@ public class JavaEditor extends TextEditor {
public JavaEditor() {
super();
}
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method extend the
+
+ /** The <code>JavaEditor</code> implementation of this
+ * <code>AbstractTextEditor</code> method extend the
* actions to add those specific to the receiver
*/
protected void createActions() {
super.createActions();
-
+
IAction a= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS); //$NON-NLS-1$
a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
setAction("ContentAssistProposal", a); //$NON-NLS-1$
-
+
a= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION); //$NON-NLS-1$
a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
setAction("ContentAssistTip", a); //$NON-NLS-1$
-
+
a= new DefineFoldingRegionAction(JavaEditorMessages.getResourceBundle(), "DefineFoldingRegion.", this); //$NON-NLS-1$
setAction("DefineFoldingRegion", a); //$NON-NLS-1$
}
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs any extra
+
+ /** The <code>JavaEditor</code> implementation of this
+ * <code>AbstractTextEditor</code> method performs any extra
* disposal actions required by the java editor.
*/
public void dispose() {
@@ -131,9 +133,9 @@ public class JavaEditor extends TextEditor {
fOutlinePage.setInput(null);
super.dispose();
}
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs any extra
+
+ /** The <code>JavaEditor</code> implementation of this
+ * <code>AbstractTextEditor</code> method performs any extra
* revert behavior required by the java editor.
*/
public void doRevertToSaved() {
@@ -141,11 +143,11 @@ public class JavaEditor extends TextEditor {
if (fOutlinePage != null)
fOutlinePage.update();
}
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs any extra
+
+ /** The <code>JavaEditor</code> implementation of this
+ * <code>AbstractTextEditor</code> method performs any extra
* save behavior required by the java editor.
- *
+ *
* @param monitor the progress monitor
*/
public void doSave(IProgressMonitor monitor) {
@@ -153,9 +155,9 @@ public class JavaEditor extends TextEditor {
if (fOutlinePage != null)
fOutlinePage.update();
}
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs any extra
+
+ /** The <code>JavaEditor</code> implementation of this
+ * <code>AbstractTextEditor</code> method performs any extra
* save as behavior required by the java editor.
*/
public void doSaveAs() {
@@ -163,20 +165,20 @@ public class JavaEditor extends TextEditor {
if (fOutlinePage != null)
fOutlinePage.update();
}
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs sets the
+
+ /** The <code>JavaEditor</code> implementation of this
+ * <code>AbstractTextEditor</code> method performs sets the
* input of the outline page after AbstractTextEditor has set input.
- *
+ *
* @param input the editor input
* @throws CoreException in case the input can not be set
- */
+ */
public void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
if (fOutlinePage != null)
fOutlinePage.setInput(input);
}
-
+
/*
* @see org.eclipse.ui.texteditor.ExtendedTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
*/
@@ -186,15 +188,15 @@ public class JavaEditor extends TextEditor {
addAction(menu, "ContentAssistTip"); //$NON-NLS-1$
addAction(menu, "DefineFoldingRegion"); //$NON-NLS-1$
}
-
- /** The <code>JavaEditor</code> implementation of this
+
+ /** The <code>JavaEditor</code> implementation of this
* <code>AbstractTextEditor</code> method performs gets
- * the java content outline page if request is for a an
+ * the java content outline page if request is for a an
* outline page.
- *
+ *
* @param required the required type
* @return an adapter for the required type or <code>null</code>
- */
+ */
public Object getAdapter(Class required) {
if (IContentOutlinePage.class.equals(required)) {
if (fOutlinePage == null) {
@@ -204,16 +206,16 @@ public class JavaEditor extends TextEditor {
}
return fOutlinePage;
}
-
+
if (fProjectionSupport != null) {
Object adapter= fProjectionSupport.getAdapter(getSourceViewer(), required);
if (adapter != null)
return adapter;
}
-
+
return super.getAdapter(required);
}
-
+
/* (non-Javadoc)
* Method declared on AbstractTextEditor
*/
@@ -221,22 +223,22 @@ public class JavaEditor extends TextEditor {
super.initializeEditor();
setSourceViewerConfiguration(new JavaSourceViewerConfiguration());
}
-
+
/*
* @see org.eclipse.ui.texteditor.ExtendedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
*/
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
-
+
fAnnotationAccess= createAnnotationAccess();
fOverviewRuler= createOverviewRuler(getSharedColors());
-
+
ISourceViewer viewer= new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
// ensure decoration support has been created and configured.
getSourceViewerDecorationSupport(viewer);
-
+
return viewer;
}
-
+
/*
* @see org.eclipse.ui.texteditor.ExtendedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@@ -249,7 +251,7 @@ public class JavaEditor extends TextEditor {
fProjectionSupport.install();
viewer.doOperation(ProjectionViewer.TOGGLE);
}
-
+
/*
* @see org.eclipse.ui.texteditor.AbstractTextEditor#adjustHighlightRange(int, int)
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java
index 79f9bcdb9..60d0aa984 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java
@@ -19,13 +19,13 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
* The example java editor plug-in class.
- *
+ *
* @since 3.0
*/
public class JavaEditorExamplePlugin extends AbstractUIPlugin {
-
+
public final static String JAVA_PARTITIONING= "__java_example_partitioning"; //$NON-NLS-1$
-
+
private static JavaEditorExamplePlugin fgInstance;
private JavaPartitionScanner fPartitionScanner;
private JavaColorProvider fColorProvider;
@@ -38,19 +38,19 @@ public class JavaEditorExamplePlugin extends AbstractUIPlugin {
public JavaEditorExamplePlugin() {
fgInstance= this;
}
-
+
/**
* Returns the default plug-in instance.
- *
+ *
* @return the default plug-in instance
*/
public static JavaEditorExamplePlugin getDefault() {
return fgInstance;
}
-
+
/**
* Return a scanner for creating Java partitions.
- *
+ *
* @return a scanner for creating Java partitions
*/
public JavaPartitionScanner getJavaPartitionScanner() {
@@ -58,10 +58,10 @@ public class JavaEditorExamplePlugin extends AbstractUIPlugin {
fPartitionScanner= new JavaPartitionScanner();
return fPartitionScanner;
}
-
+
/**
* Returns the singleton Java code scanner.
- *
+ *
* @return the singleton Java code scanner
*/
public RuleBasedScanner getJavaCodeScanner() {
@@ -69,10 +69,10 @@ public class JavaEditorExamplePlugin extends AbstractUIPlugin {
fCodeScanner= new JavaCodeScanner(getJavaColorProvider());
return fCodeScanner;
}
-
+
/**
* Returns the singleton Java color provider.
- *
+ *
* @return the singleton Java color provider
*/
public JavaColorProvider getJavaColorProvider() {
@@ -80,10 +80,10 @@ public class JavaEditorExamplePlugin extends AbstractUIPlugin {
fColorProvider= new JavaColorProvider();
return fColorProvider;
}
-
+
/**
* Returns the singleton Javadoc scanner.
- *
+ *
* @return the singleton Javadoc scanner
*/
public RuleBasedScanner getJavaDocScanner() {
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java
index e76e3d9f9..7f807d7eb 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java
@@ -29,7 +29,7 @@ public class JavaEditorMessages {
return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
}
}
-
+
public static ResourceBundle getResourceBundle() {
return fgResourceBundle;
}
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java
index 1eebdba32..c6db15777 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java
@@ -14,7 +14,16 @@ package org.eclipse.ui.examples.javaeditor;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.jface.text.rules.*;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WordRule;
/**
* This scanner recognizes the JavaDoc comments and Java multi line comments.
@@ -44,20 +53,20 @@ public class JavaPartitionScanner extends RuleBasedPartitionScanner {
return (c == '*' || c == '/');
}
}
-
+
/**
- *
+ *
*/
static class WordPredicateRule extends WordRule implements IPredicateRule {
-
+
private IToken fSuccessToken;
-
+
public WordPredicateRule(IToken successToken) {
super(new EmptyCommentDetector());
fSuccessToken= successToken;
addWord("/**/", fSuccessToken); //$NON-NLS-1$
}
-
+
/*
* @see org.eclipse.jface.text.rules.IPredicateRule#evaluate(ICharacterScanner, boolean)
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java
index 4110ffee6..54ca2cff5 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java
@@ -40,8 +40,8 @@ import org.eclipse.ui.examples.javaeditor.util.JavaColorProvider;
* Example configuration for an <code>SourceViewer</code> which shows Java code.
*/
public class JavaSourceViewerConfiguration extends SourceViewerConfiguration {
-
-
+
+
/**
* Single token scanner.
*/
@@ -50,21 +50,21 @@ public class JavaSourceViewerConfiguration extends SourceViewerConfiguration {
setDefaultReturnToken(new Token(attribute));
}
}
-
+
/**
* Default constructor.
*/
public JavaSourceViewerConfiguration() {
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return new JavaAnnotationHover();
}
-
+
/*
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
*/
@@ -72,21 +72,21 @@ public class JavaSourceViewerConfiguration extends SourceViewerConfiguration {
IAutoEditStrategy strategy= (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new JavaAutoIndentStrategy() : new DefaultIndentLineAutoEditStrategy());
return new IAutoEditStrategy[] { strategy };
}
-
+
/*
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer)
*/
public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) {
return JavaEditorExamplePlugin.JAVA_PARTITIONING;
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return new String[] { IDocument.DEFAULT_CONTENT_TYPE, JavaPartitionScanner.JAVA_DOC, JavaPartitionScanner.JAVA_MULTILINE_COMMENT };
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
@@ -105,28 +105,28 @@ public class JavaSourceViewerConfiguration extends SourceViewerConfiguration {
return assistant;
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
public String getDefaultPrefix(ISourceViewer sourceViewer, String contentType) {
return (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? "//" : null); //$NON-NLS-1$
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
return new JavaDoubleClickSelector();
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
return new String[] { "\t", " " }; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
@@ -135,11 +135,11 @@ public class JavaSourceViewerConfiguration extends SourceViewerConfiguration {
JavaColorProvider provider= JavaEditorExamplePlugin.getDefault().getJavaColorProvider();
PresentationReconciler reconciler= new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
+
DefaultDamagerRepairer dr= new DefaultDamagerRepairer(JavaEditorExamplePlugin.getDefault().getJavaCodeScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
-
+
dr= new DefaultDamagerRepairer(JavaEditorExamplePlugin.getDefault().getJavaDocScanner());
reconciler.setDamager(dr, JavaPartitionScanner.JAVA_DOC);
reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_DOC);
@@ -150,14 +150,14 @@ public class JavaSourceViewerConfiguration extends SourceViewerConfiguration {
return reconciler;
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
public int getTabWidth(ISourceViewer sourceViewer) {
return 4;
}
-
+
/* (non-Javadoc)
* Method declared on SourceViewerConfiguration
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java
index 53f4930f0..1600b8e35 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java
@@ -11,9 +11,14 @@
package org.eclipse.ui.examples.javaeditor;
-import org.eclipse.jface.text.*;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+
/**
* Example implementation for an <code>ITextHover</code> which hovers over Java code.
*/
@@ -32,7 +37,7 @@ public class JavaTextHover implements ITextHover {
}
return JavaEditorMessages.getString("JavaTextHover.emptySelection"); //$NON-NLS-1$
}
-
+
/* (non-Javadoc)
* Method declared on ITextHover
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java
index 8ec3bd55a..f508ea029 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java
@@ -28,7 +28,7 @@ public class PresentationAction extends TextEditorAction {
super(JavaEditorMessages.getResourceBundle(), "TogglePresentation.", null); //$NON-NLS-1$
update();
}
-
+
/* (non-Javadoc)
* Method declared on IAction
*/
@@ -41,7 +41,7 @@ public class PresentationAction extends TextEditorAction {
setChecked(!show);
editor.showHighlightRangeOnly(!show);
}
-
+
/* (non-Javadoc)
* Method declared on TextEditorAction
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java
index 4f82ef0c9..73cab6b29 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java
@@ -24,7 +24,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
public JavaAutoIndentStrategy() {
}
-
+
/* (non-Javadoc)
* Method declared on IAutoIndentStrategy
*/
@@ -35,10 +35,10 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
smartInsertAfterBracket(d, c);
}
}
-
+
/**
* Returns whether or not the given text ends with one of the documents legal line delimiters.
- *
+ *
* @param d the document
* @param txt the text
* @return <code>true</code> if <code>txt</code> ends with one of the document's line delimiters, <code>false</code> otherwise
@@ -49,10 +49,10 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
return TextUtilities.endsWith(delimiters, txt) > -1;
return false;
}
-
+
/**
* Returns the line number of the next bracket after end.
- *
+ *
* @param document - the document being parsed
* @param line - the line to start searching back from
* @param end - the end position to search back from
@@ -65,7 +65,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
int start= document.getLineOffset(line);
int brackcount= getBracketCount(document, start, end, false) - closingBracketIncrease;
- // sum up the brackets counts of each line (closing brackets count negative,
+ // sum up the brackets counts of each line (closing brackets count negative,
// opening positive) until we find a line the brings the count to zero
while (brackcount < 0) {
line--;
@@ -78,11 +78,11 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
return line;
}
-
+
/**
- * Returns the bracket value of a section of text. Closing brackets have a value of -1 and
+ * Returns the bracket value of a section of text. Closing brackets have a value of -1 and
* open brackets have a value of 1.
- *
+ *
* @param document - the document being parsed
* @param start - the start position for the search
* @param end - the end position for the search
@@ -105,7 +105,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
// a comment starts, advance to the comment end
begin= getCommentEnd(document, begin + 1, end);
} else if (next == '/') {
- // '//'-comment: nothing to do anymore on this line
+ // '//'-comment: nothing to do anymore on this line
begin= end;
}
}
@@ -138,10 +138,10 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
return bracketcount;
}
-
+
/**
* Returns the end position of a comment starting at the given <code>position</code>.
- *
+ *
* @param document - the document being parsed
* @param position - the start position for the search
* @param end - the end position for the search
@@ -161,10 +161,10 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
return end;
}
-
+
/**
* Returns the content of the given line without the leading whitespace.
- *
+ *
* @param document - the document being parsed
* @param line - the line being searched
* @return the content of the given line without the leading whitespace
@@ -179,10 +179,10 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
return ""; //$NON-NLS-1$
}
-
+
/**
* Returns the position of the <code>character</code> in the <code>document</code> after <code>position</code>.
- *
+ *
* @param document - the document being parsed
* @param position - the position to start searching from
* @param end - the end of the document
@@ -204,7 +204,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
return end;
}
-
+
/**
* Set the indent of a new line based on the command provided in the supplied document.
* @param document - the document being parsed
@@ -241,7 +241,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
System.out.println(JavaEditorMessages.getString("AutoIndent.error.bad_location_1")); //$NON-NLS-1$
}
}
-
+
/**
* Set the indent of a bracket based on the command provided in the supplied document.
* @param document - the document being parsed
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java
index b5656b513..2e811094c 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java
@@ -15,8 +15,18 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.*;
-import org.eclipse.ui.examples.javaeditor.util.*;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+
+import org.eclipse.ui.examples.javaeditor.util.JavaColorProvider;
+import org.eclipse.ui.examples.javaeditor.util.JavaWhitespaceDetector;
+import org.eclipse.ui.examples.javaeditor.util.JavaWordDetector;
/**
* A Java code scanner.
@@ -31,7 +41,7 @@ public class JavaCodeScanner extends RuleBasedScanner {
/**
* Creates a Java code scanner with the given color provider.
- *
+ *
* @param provider the color provider
*/
public JavaCodeScanner(JavaColorProvider provider) {
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java
index 12ad2bfc8..4a8fb8088 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java
@@ -15,7 +15,13 @@ import java.text.MessageFormat;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.contentassist.*;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ContextInformation;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
/**
* Example Java completion processor.
@@ -43,7 +49,7 @@ public class JavaCompletionProcessor implements IContentAssistProcessor {
public void install(IContextInformation info, ITextViewer viewer, int offset) {
fInstallOffset= offset;
}
-
+
/*
* @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int, TextPresentation)
*/
@@ -68,7 +74,7 @@ public class JavaCompletionProcessor implements IContentAssistProcessor {
}
return result;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
@@ -80,28 +86,28 @@ public class JavaCompletionProcessor implements IContentAssistProcessor {
MessageFormat.format(JavaEditorMessages.getString("CompletionProcessor.ContextInfo.value.pattern"), new Object[] { new Integer(i), new Integer(documentOffset - 5), new Integer(documentOffset + 5)})); //$NON-NLS-1$
return result;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public char[] getCompletionProposalAutoActivationCharacters() {
return new char[] { '.', '(' };
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public char[] getContextInformationAutoActivationCharacters() {
return new char[] { '#' };
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public IContextInformationValidator getContextInformationValidator() {
return fValidator;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java
index 8fe3fcfc0..77d86c159 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java
@@ -28,13 +28,13 @@ public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
protected static char[] fgBrackets= { '{', '}', '(', ')', '[', ']', '"', '"' };
- /*
+ /*
* Create a JavaDoubleClickSelector.
*/
public JavaDoubleClickSelector() {
super();
}
-
+
/* (non-Javadoc)
* Method declared on ITextDoubleClickStrategy
*/
@@ -50,11 +50,11 @@ public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
if (!selectBracketBlock())
selectWord();
}
-
+
/**
* Match the brackets at the current selection. Return <code>true</code> if successful,
* <code>false</code> otherwise.
- *
+ *
* @return <code>true</code> if brackets match, <code>false</code> otherwise
*/
protected boolean matchBracketsAt() {
@@ -107,11 +107,11 @@ public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
return false;
}
-
+
/**
* Select the word at the current selection location. Return <code>true</code> if successful,
* <code>false</code> otherwise.
- *
+ *
* @return <code>true</code> if a word can be found at the current selection location, <code>false</code> otherwise
*/
protected boolean matchWord() {
@@ -151,10 +151,10 @@ public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
return false;
}
-
+
/**
* Returns the position of the closing bracket after <code>startPosition</code>.
- *
+ *
* @param startPosition - the beginning position
* @param openBracket - the character that represents the open bracket
* @param closeBracket - the character that represents the close bracket
@@ -182,10 +182,10 @@ public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
return -1;
}
-
+
/**
* Returns the position of the open bracket before <code>startPosition</code>.
- *
+ *
* @param startPosition - the beginning position
* @param openBracket - the character that represents the open bracket
* @param closeBracket - the character that represents the close bracket
@@ -211,10 +211,10 @@ public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
return openPos + 1;
return -1;
}
-
+
/**
* Select the area between the selected bracket and the closing bracket.
- *
+ *
* @return <code>true</code> if selection was successful, <code>false</code> otherwise
*/
protected boolean selectBracketBlock() {
@@ -229,9 +229,9 @@ public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
}
return false;
}
-
+
/**
- * Select the word at the current selection.
+ * Select the word at the current selection.
*/
protected void selectWord() {
if (matchWord()) {
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java
index dc022407e..48146f962 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java
@@ -12,7 +12,11 @@ package org.eclipse.ui.examples.javaeditor.javadoc;
import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.*;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
/**
* Example Java doc completion processor.
@@ -30,35 +34,35 @@ public class JavaDocCompletionProcessor implements IContentAssistProcessor {
result[i]= new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length());
return result;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
return null;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
public IContextInformationValidator getContextInformationValidator() {
return null;
}
-
+
/* (non-Javadoc)
* Method declared on IContentAssistProcessor
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java
index ea2e4b284..35f36b24a 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java
@@ -15,7 +15,15 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.*;
+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.RuleBasedScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+
import org.eclipse.ui.examples.javaeditor.util.JavaColorProvider;
import org.eclipse.ui.examples.javaeditor.util.JavaWhitespaceDetector;
@@ -48,7 +56,7 @@ public class JavaDocScanner extends RuleBasedScanner {
/**
* Create a new javadoc scanner for the given color provider.
- *
+ *
* @param provider the color provider
*/
public JavaDocScanner(JavaColorProvider provider) {
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
index 5142b09b8..91d5f463a 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
@@ -11,7 +11,9 @@
package org.eclipse.ui.examples.javaeditor.util;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
@@ -37,17 +39,17 @@ public class JavaColorProvider {
/**
* Release all of the color resources held onto by the receiver.
- */
+ */
public void dispose() {
Iterator e= fColorTable.values().iterator();
while (e.hasNext())
((Color) e.next()).dispose();
}
-
+
/**
* Return the color that is stored in the color table under the given RGB
* value.
- *
+ *
* @param rgb the RGB value
* @return the color stored in the color table for the given RGB value
*/
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java
index 50b5e6f8a..7261da3e2 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java
@@ -24,7 +24,7 @@ public class JavaWordDetector implements IWordDetector {
public boolean isWordPart(char character) {
return Character.isJavaIdentifierPart(character);
}
-
+
/* (non-Javadoc)
* Method declared on IWordDetector.
*/

Back to the top