Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.examples.javaeditor')
-rw-r--r--org.eclipse.ui.examples.javaeditor/.classpath8
-rw-r--r--org.eclipse.ui.examples.javaeditor/.cvsignore1
-rw-r--r--org.eclipse.ui.examples.javaeditor/.project35
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java90
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java38
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java237
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java41
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java255
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java99
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java36
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.properties44
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java105
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java166
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java45
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java52
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java263
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java69
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java111
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java240
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaEditorMessages.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java68
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java80
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/togglepresentation.gifbin125 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java58
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWhitespaceDetector.java27
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java34
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java38
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/IXMLColorConstants.java21
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/NonRuleBasedDamagerRepairer.java148
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TagRule.java41
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java57
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditorUI.java108
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.java65
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.properties13
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLConfiguration.java101
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDocumentProvider.java35
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDoubleClickStrategy.java122
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLPartitionScanner.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLScanner.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLTagScanner.java34
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLWhitespaceDetector.java20
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/preferences/TemplatesPreferencePage.java40
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/AntVariableResolver.java50
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLCompletionProcessor.java99
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLContextType.java43
-rw-r--r--org.eclipse.ui.examples.javaeditor/about.html30
-rw-r--r--org.eclipse.ui.examples.javaeditor/build.properties23
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal.htm14
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal2002.htm13
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal2003.htm14
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2002.gifbin1045 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2003.gifbin1101 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ui_javaeditor_ex.html237
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ui_templateeditor_ex.html69
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/obj16/java.gifbin140 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/resolver.gifbin983 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/sample.gifbin983 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/template.gifbin155 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/plugin.properties38
-rw-r--r--org.eclipse.ui.examples.javaeditor/plugin.xml119
-rw-r--r--org.eclipse.ui.examples.javaeditor/templates/ant.properties12
-rw-r--r--org.eclipse.ui.examples.javaeditor/templates/ant.xml14
63 files changed, 0 insertions, 3916 deletions
diff --git a/org.eclipse.ui.examples.javaeditor/.classpath b/org.eclipse.ui.examples.javaeditor/.classpath
deleted file mode 100644
index 81b25ea2f..000000000
--- a/org.eclipse.ui.examples.javaeditor/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="Eclipse Java Editor Example"/>
- <classpathentry kind="src" path="Template Editor Example"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.ui.examples.javaeditor/.cvsignore b/org.eclipse.ui.examples.javaeditor/.cvsignore
deleted file mode 100644
index c5e82d745..000000000
--- a/org.eclipse.ui.examples.javaeditor/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/org.eclipse.ui.examples.javaeditor/.project b/org.eclipse.ui.examples.javaeditor/.project
deleted file mode 100644
index 55e75aeba..000000000
--- a/org.eclipse.ui.examples.javaeditor/.project
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.examples.javaeditor</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.filebuffers</project>
- <project>org.eclipse.core.runtime.compatibility</project>
- <project>org.eclipse.jface.text</project>
- <project>org.eclipse.ui</project>
- <project>org.eclipse.ui.editors</project>
- <project>org.eclipse.ui.views</project>
- <project>org.eclipse.ui.workbench.texteditor</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
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
deleted file mode 100644
index fc01c69b0..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-import org.eclipse.jface.action.*;
-import org.eclipse.ui.*;
-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.
- */
-public class JavaActionContributor extends TextEditorActionContributor {
-
- protected RetargetTextEditorAction fContentAssistProposal;
- protected RetargetTextEditorAction fContentAssistTip;
- protected TextEditorAction fTogglePresentation;
-
- /**
- * Default constructor.
- */
- public JavaActionContributor() {
- super();
- fContentAssistProposal= new RetargetTextEditorAction(JavaEditorMessages.getResourceBundle(), "ContentAssistProposal."); //$NON-NLS-1$
- 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);
-
- ITextEditor editor= null;
- if (part instanceof ITextEditor)
- editor= (ITextEditor) part;
-
- fContentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); //$NON-NLS-1$
- fContentAssistTip.setAction(getAction(editor, "ContentAssistTip")); //$NON-NLS-1$
-
- fTogglePresentation.setEditor(editor);
- fTogglePresentation.update();
- }
-
- /*
- * @see IEditorActionBarContributor#setActiveEditor(IEditorPart)
- */
- public void setActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
- doSetActiveEditor(part);
- }
-
- /*
- * @see IEditorActionBarContributor#dispose()
- */
- public void dispose() {
- doSetActiveEditor(null);
- super.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
deleted file mode 100644
index 27b6e5348..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-import org.eclipse.jface.text.*;
-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)
- * Method declared on IAnnotationHover
- */
- public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
- IDocument document= sourceViewer.getDocument();
-
- try {
- IRegion info= document.getLineInformation(lineNumber);
- return document.get(info.getOffset(), info.getLength());
- } catch (BadLocationException x) {
- }
-
- return null;
- }
-}
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
deleted file mode 100644
index 723812cac..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-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.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
- * connected editor in 10 segments.
- */
-public class JavaContentOutlinePage extends ContentOutlinePage {
-
- /**
- * A segment element.
- */
- protected static class Segment {
- public String name;
- public Position position;
-
- public Segment(String name, Position position) {
- this.name= name;
- this.position= position;
- }
-
- public String toString() {
- return name;
- }
- }
-
- /**
- * Divides the editor's document into ten segments and provides elements for them.
- */
- protected class ContentProvider implements ITreeContentProvider {
-
- protected final static String SEGMENTS= "__java_segments"; //$NON-NLS-1$
- protected IPositionUpdater fPositionUpdater= new DefaultPositionUpdater(SEGMENTS);
- protected List fContent= new ArrayList(10);
-
- protected void parse(IDocument document) {
-
- int lines= document.getNumberOfLines();
- int increment= Math.max(Math.round(lines / 10), 10);
-
- for (int line= 0; line < lines; line += increment) {
-
- int length= increment;
- if (line + increment > lines)
- length= lines - line;
-
- try {
-
- int offset= document.getLineOffset(line);
- int end= document.getLineOffset(line + length);
- length= end - offset;
- Position p= new Position(offset, length);
- document.addPosition(SEGMENTS, p);
- fContent.add(new Segment(MessageFormat.format(JavaEditorMessages.getString("OutlinePage.segment.title_pattern"), new Object[] { new Integer(offset) }), p)); //$NON-NLS-1$
-
- } catch (BadPositionCategoryException x) {
- } catch (BadLocationException x) {
- }
- }
- }
-
- /*
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (oldInput != null) {
- IDocument document= fDocumentProvider.getDocument(oldInput);
- if (document != null) {
- try {
- document.removePositionCategory(SEGMENTS);
- } catch (BadPositionCategoryException x) {
- }
- document.removePositionUpdater(fPositionUpdater);
- }
- }
-
- fContent.clear();
-
- if (newInput != null) {
- IDocument document= fDocumentProvider.getDocument(newInput);
- if (document != null) {
- document.addPositionCategory(SEGMENTS);
- document.addPositionUpdater(fPositionUpdater);
-
- parse(document);
- }
- }
- }
-
- /*
- * @see IContentProvider#dispose
- */
- public void dispose() {
- if (fContent != null) {
- fContent.clear();
- fContent= null;
- }
- }
-
- /*
- * @see IContentProvider#isDeleted(Object)
- */
- public boolean isDeleted(Object element) {
- return false;
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object element) {
- return fContent.toArray();
- }
-
- /*
- * @see ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- return element == fInput;
- }
-
- /*
- * @see ITreeContentProvider#getParent(Object)
- */
- public Object getParent(Object element) {
- if (element instanceof Segment)
- return fInput;
- return null;
- }
-
- /*
- * @see ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object element) {
- if (element == fInput)
- return fContent.toArray();
- return new Object[0];
- }
- }
-
- protected Object fInput;
- protected IDocumentProvider fDocumentProvider;
- protected ITextEditor fTextEditor;
-
- /**
- * Creates a content outline page using the given provider and the given editor.
- */
- public JavaContentOutlinePage(IDocumentProvider provider, ITextEditor editor) {
- super();
- fDocumentProvider= provider;
- fTextEditor= editor;
- }
-
- /* (non-Javadoc)
- * Method declared on ContentOutlinePage
- */
- public void createControl(Composite parent) {
-
- super.createControl(parent);
-
- TreeViewer viewer= getTreeViewer();
- viewer.setContentProvider(new ContentProvider());
- viewer.setLabelProvider(new LabelProvider());
- viewer.addSelectionChangedListener(this);
-
- if (fInput != null)
- viewer.setInput(fInput);
- }
-
- /* (non-Javadoc)
- * Method declared on ContentOutlinePage
- */
- public void selectionChanged(SelectionChangedEvent event) {
-
- super.selectionChanged(event);
-
- ISelection selection= event.getSelection();
- if (selection.isEmpty())
- fTextEditor.resetHighlightRange();
- else {
- Segment segment= (Segment) ((IStructuredSelection) selection).getFirstElement();
- int start= segment.position.getOffset();
- int length= segment.position.getLength();
- try {
- fTextEditor.setHighlightRange(start, length, true);
- } catch (IllegalArgumentException x) {
- fTextEditor.resetHighlightRange();
- }
- }
- }
-
- /**
- * Sets the input of the outline page
- */
- public void setInput(Object input) {
- fInput= input;
- update();
- }
-
- /**
- * Updates the outline page.
- */
- public void update() {
- TreeViewer viewer= getTreeViewer();
-
- if (viewer != null) {
- Control control= viewer.getControl();
- if (control != null && !control.isDisposed()) {
- control.setRedraw(false);
- viewer.setInput(fInput);
- viewer.expandAll();
- control.setRedraw(true);
- }
- }
- }
-}
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
deleted file mode 100644
index 3c468a934..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.DefaultPartitioner;
-
-/**
- *
- */
-public class JavaDocumentSetupParticipant implements IDocumentSetupParticipant {
-
- /**
- */
- public JavaDocumentSetupParticipant() {
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
- */
- public void setup(IDocument document) {
- if (document instanceof IDocumentExtension3) {
- IDocumentExtension3 extension3= (IDocumentExtension3) document;
- IDocumentPartitioner partitioner= new DefaultPartitioner(JavaEditorExamplePlugin.getDefault().getJavaPartitionScanner(), JavaPartitionScanner.JAVA_PARTITION_TYPES);
- extension3.setDocumentPartitioner(JavaEditorExamplePlugin.JAVA_PARTITIONING, partitioner);
- partitioner.connect(document);
- }
- }
-}
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
deleted file mode 100644
index 94f724341..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-import java.util.ResourceBundle;
-
-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;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-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.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;
-
-
-/**
- * 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()
- */
- public void run() {
- ITextEditor editor= getTextEditor();
- ISelection selection= editor.getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection) {
- ITextSelection textSelection= (ITextSelection) selection;
- 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);
- int endOffset= document.getLineOffset(end + 1);
- Position position= new Position(offset, endOffset - offset);
- model.addAnnotation(new ProjectionAnnotation(), position);
- } catch (BadLocationException x) {
- // ignore
- }
- }
- }
- }
- }
- }
-
- /** The outline page */
- private JavaContentOutlinePage fOutlinePage;
- /** The projection support */
- private ProjectionSupport fProjectionSupport;
-
- /**
- * Default constructor.
- */
- public JavaEditor() {
- super();
- }
-
- /** 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
- * disposal actions required by the java editor.
- */
- public void dispose() {
- if (fOutlinePage != null)
- fOutlinePage.setInput(null);
- super.dispose();
- }
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs any extra
- * revert behavior required by the java editor.
- */
- public void doRevertToSaved() {
- super.doRevertToSaved();
- if (fOutlinePage != null)
- fOutlinePage.update();
- }
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs any extra
- * save behavior required by the java editor.
- */
- public void doSave(IProgressMonitor monitor) {
- super.doSave(monitor);
- if (fOutlinePage != null)
- fOutlinePage.update();
- }
-
- /** 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() {
- super.doSaveAs();
- if (fOutlinePage != null)
- fOutlinePage.update();
- }
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs sets the
- * input of the outline page after AbstractTextEditor has set input.
- */
- 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)
- */
- protected void editorContextMenuAboutToShow(IMenuManager menu) {
- super.editorContextMenuAboutToShow(menu);
- addAction(menu, "ContentAssistProposal"); //$NON-NLS-1$
- addAction(menu, "ContentAssistTip"); //$NON-NLS-1$
- addAction(menu, "DefineFoldingRegion"); //$NON-NLS-1$
- }
-
- /** The <code>JavaEditor</code> implementation of this
- * <code>AbstractTextEditor</code> method performs gets
- * the java content outline page if request is for a an
- * outline page.
- */
- public Object getAdapter(Class required) {
- if (IContentOutlinePage.class.equals(required)) {
- if (fOutlinePage == null) {
- fOutlinePage= new JavaContentOutlinePage(getDocumentProvider(), this);
- if (getEditorInput() != null)
- fOutlinePage.setInput(getEditorInput());
- }
- 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
- */
- protected void initializeEditor() {
- 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)
- */
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- ProjectionViewer viewer= (ProjectionViewer) getSourceViewer();
- fProjectionSupport= new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
- fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
- fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
- fProjectionSupport.install();
- viewer.doOperation(ProjectionViewer.TOGGLE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#adjustHighlightRange(int, int)
- */
- protected void adjustHighlightRange(int offset, int length) {
- ISourceViewer viewer= getSourceViewer();
- if (viewer instanceof ITextViewerExtension5) {
- ITextViewerExtension5 extension= (ITextViewerExtension5) viewer;
- extension.exposeModelRange(new Region(offset, length));
- }
- }
-}
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
deleted file mode 100644
index 216cdb40f..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-
-import org.eclipse.ui.examples.javaeditor.java.JavaCodeScanner;
-import org.eclipse.ui.examples.javaeditor.javadoc.JavaDocScanner;
-import org.eclipse.ui.examples.javaeditor.util.JavaColorProvider;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The example java editor plugin 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;
- private JavaCodeScanner fCodeScanner;
- private JavaDocScanner fDocScanner;
-
- /**
- * Creates a new plugin instance.
- *
- * @param descriptor
- */
- public JavaEditorExamplePlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- fgInstance= this;
- }
-
- /**
- * Returns the default plugin instance.
- *
- * @return the default plugin instance
- */
- public static JavaEditorExamplePlugin getDefault() {
- return fgInstance;
- }
-
- /*
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#shutdown()
- */
- public void shutdown() throws CoreException {
- super.shutdown();
- }
-
- /**
- * Return a scanner for creating java partitions.
- */
- public JavaPartitionScanner getJavaPartitionScanner() {
- if (fPartitionScanner == null)
- fPartitionScanner= new JavaPartitionScanner();
- return fPartitionScanner;
- }
-
- /**
- * Returns the singleton scanner.
- */
- public RuleBasedScanner getJavaCodeScanner() {
- if (fCodeScanner == null)
- fCodeScanner= new JavaCodeScanner(getJavaColorProvider());
- return fCodeScanner;
- }
-
- /**
- * Returns the singleton color provider.
- */
- public JavaColorProvider getJavaColorProvider() {
- if (fColorProvider == null)
- fColorProvider= new JavaColorProvider();
- return fColorProvider;
- }
-
- /**
- * Returns the singleton document scanner.
- */
- public RuleBasedScanner getJavaDocScanner() {
- if (fDocScanner == null)
- fDocScanner= new JavaDocScanner(fColorProvider);
- return fDocScanner;
- }
-}
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
deleted file mode 100644
index 2e95f6076..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class JavaEditorMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.examples.javaeditor.JavaEditorMessages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private JavaEditorMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- 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/JavaEditorMessages.properties b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.properties
deleted file mode 100644
index df31e13c2..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 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
-###############################################################################
-
-## Actions ##
-
-ContentAssistProposal.label=Content Assist@Ctrl+SPACE
-ContentAssistProposal.tooltip=Content Assist
-ContentAssistProposal.image=
-ContentAssistProposal.description=Content Assist
-
-ContentAssistTip.label=Content Tip@Ctrl+SHIFT+SPACE
-ContentAssistTip.tooltip=Content Tip
-ContentAssistTip.image=
-ContentAssistTip.description=Content Tip
-
-DefineFoldingRegion.label=Define Folding Region
-DefineFoldingRegion.tooltip=Define Folding Region
-DefineFoldingRegion.image=
-DefineFoldingRegion.description=Define Folding Region
-
-TogglePresentation.label=Change Presentation
-TogglePresentation.tooltip=Enable/Disable Segmented Source Viewer
-TogglePresentation.image=togglepresentation.gif
-TogglePresentation.description=Enable/Disable Segmented Source Viewer
-
-OutlinePage.segment.title_pattern=position {0}
-
-AutoIndent.error.bad_location_1=JavaAutoIndentStrategy.getAutoIndentString: BadLocationException
-AutoIndent.error.bad_location_2=JavaAutoIndentStrategy.calcShiftBackReplace: BadLocationException
-
-CompletionProcessor.ContextInfo.display.pattern=proposal {0} at position {1}
-CompletionProcessor.ContextInfo.value.pattern=proposal {0} valid from {1} to {2}
-CompletionProcessor.Proposal.ContextInfo.pattern={0} valid 5 characters around insertion point
-CompletionProcessor.Proposal.hoverinfo.pattern=Java keyword: {0}
-
-JavaTextHover.emptySelection=empty selection
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
deleted file mode 100644
index ca52b53b5..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.rules.*;
-
-/**
- * This scanner recognizes the JavaDoc comments and Java multi line comments.
- */
-public class JavaPartitionScanner extends RuleBasedPartitionScanner {
-
- public final static String JAVA_MULTILINE_COMMENT= "__java_multiline_comment"; //$NON-NLS-1$
- public final static String JAVA_DOC= "__java_javadoc"; //$NON-NLS-1$
- public final static String[] JAVA_PARTITION_TYPES= new String[] { JAVA_MULTILINE_COMMENT, JAVA_DOC };
-
- /**
- * Detector for empty comments.
- */
- static class EmptyCommentDetector implements IWordDetector {
-
- /* (non-Javadoc)
- * Method declared on IWordDetector
- */
- public boolean isWordStart(char c) {
- return (c == '/');
- }
-
- /* (non-Javadoc)
- * Method declared on IWordDetector
- */
- public boolean isWordPart(char c) {
- 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)
- */
- public IToken evaluate(ICharacterScanner scanner, boolean resume) {
- return super.evaluate(scanner);
- }
-
- /*
- * @see org.eclipse.jface.text.rules.IPredicateRule#getSuccessToken()
- */
- public IToken getSuccessToken() {
- return fSuccessToken;
- }
- }
-
- /**
- * Creates the partitioner and sets up the appropriate rules.
- */
- public JavaPartitionScanner() {
- super();
-
- IToken javaDoc= new Token(JAVA_DOC);
- IToken comment= new Token(JAVA_MULTILINE_COMMENT);
-
- List rules= new ArrayList();
-
- // Add rule for single line comments.
- rules.add(new EndOfLineRule("//", Token.UNDEFINED)); //$NON-NLS-1$
-
- // Add rule for strings and character constants.
- rules.add(new SingleLineRule("\"", "\"", Token.UNDEFINED, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
- rules.add(new SingleLineRule("'", "'", Token.UNDEFINED, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
-
- // Add special case word rule.
- rules.add(new WordPredicateRule(comment));
-
- // Add rules for multi-line comments and javadoc.
- rules.add(new MultiLineRule("/**", "*/", javaDoc, (char) 0, true)); //$NON-NLS-1$ //$NON-NLS-2$
- rules.add(new MultiLineRule("/*", "*/", comment, (char) 0, true)); //$NON-NLS-1$ //$NON-NLS-2$
-
- IPredicateRule[] result= new IPredicateRule[rules.size()];
- rules.toArray(result);
- setPredicateRules(result);
- }
-}
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
deleted file mode 100644
index 353a3e97b..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-import org.eclipse.swt.graphics.RGB;
-
-import org.eclipse.jface.text.DefaultAutoIndentStrategy;
-import org.eclipse.jface.text.IAutoIndentStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-
-import org.eclipse.ui.examples.javaeditor.java.JavaAutoIndentStrategy;
-import org.eclipse.ui.examples.javaeditor.java.JavaCompletionProcessor;
-import org.eclipse.ui.examples.javaeditor.java.JavaDoubleClickSelector;
-import org.eclipse.ui.examples.javaeditor.javadoc.JavaDocCompletionProcessor;
-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.
- */
- static class SingleTokenScanner extends BufferedRuleBasedScanner {
- public SingleTokenScanner(TextAttribute attribute) {
- setDefaultReturnToken(new Token(attribute));
- }
- }
-
-
- /**
- * Default constructor.
- */
- public JavaSourceViewerConfiguration() {
- }
-
- /* (non-Javadoc)
- * Method declared on SourceViewerConfiguration
- */
- public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
- return new JavaAnnotationHover();
- }
-
- /* (non-Javadoc)
- * Method declared on SourceViewerConfiguration
- */
- public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer sourceViewer, String contentType) {
- return (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new JavaAutoIndentStrategy() : new DefaultAutoIndentStrategy());
- }
-
- /*
- * @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
- */
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
-
- ContentAssistant assistant= new ContentAssistant();
- assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
- assistant.setContentAssistProcessor(new JavaCompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
- assistant.setContentAssistProcessor(new JavaDocCompletionProcessor(), JavaPartitionScanner.JAVA_DOC);
-
- assistant.enableAutoActivation(true);
- assistant.setAutoActivationDelay(500);
- assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
- assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
- assistant.setContextInformationPopupBackground(JavaEditorExamplePlugin.getDefault().getJavaColorProvider().getColor(new RGB(150, 150, 0)));
-
- 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
- */
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
-
- 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(new SingleTokenScanner(new TextAttribute(provider.getColor(JavaColorProvider.JAVADOC_DEFAULT))));
- reconciler.setDamager(dr, JavaPartitionScanner.JAVA_DOC);
- reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_DOC);
-
- dr= new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(provider.getColor(JavaColorProvider.MULTI_LINE_COMMENT))));
- reconciler.setDamager(dr, JavaPartitionScanner.JAVA_MULTILINE_COMMENT);
- reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_MULTILINE_COMMENT);
-
- return reconciler;
- }
-
- /* (non-Javadoc)
- * Method declared on SourceViewerConfiguration
- */
- public int getTabWidth(ISourceViewer sourceViewer) {
- return 4;
- }
-
- /* (non-Javadoc)
- * Method declared on SourceViewerConfiguration
- */
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
- return new JavaTextHover();
- }
-}
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
deleted file mode 100644
index 31b525eee..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-import org.eclipse.jface.text.*;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * Example implementation for an <code>ITextHover</code> which hovers over Java code.
- */
-public class JavaTextHover implements ITextHover {
-
- /* (non-Javadoc)
- * Method declared on ITextHover
- */
- public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
- if (hoverRegion != null) {
- try {
- if (hoverRegion.getLength() > -1)
- return textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
- } catch (BadLocationException x) {
- }
- }
- return JavaEditorMessages.getString("JavaTextHover.emptySelection"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * Method declared on ITextHover
- */
- public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
- Point selection= textViewer.getSelectedRange();
- if (selection.x <= offset && offset < selection.x + selection.y)
- return new Region(selection.x, selection.y);
- return new Region(offset, 0);
- }
-}
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
deleted file mode 100644
index 9175d6165..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor;
-
-
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextEditorAction;
-
-/**
- * A toolbar action which toggles the presentation model of the
- * connected text editor. The editor shows either the highlight range
- * only or always the whole document.
- */
-public class PresentationAction extends TextEditorAction {
-
- /**
- * Constructs and updates the action.
- */
- public PresentationAction() {
- super(JavaEditorMessages.getResourceBundle(), "TogglePresentation.", null); //$NON-NLS-1$
- update();
- }
-
- /* (non-Javadoc)
- * Method declared on IAction
- */
- public void run() {
-
- ITextEditor editor= getTextEditor();
-
- editor.resetHighlightRange();
- boolean show= editor.showsHighlightRangeOnly();
- setChecked(!show);
- editor.showHighlightRangeOnly(!show);
- }
-
- /* (non-Javadoc)
- * Method declared on TextEditorAction
- */
- public void update() {
- setChecked(getTextEditor() != null && getTextEditor().showsHighlightRangeOnly());
- setEnabled(true);
- }
-}
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
deleted file mode 100644
index 9cec1cf28..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.java;
-
-
-import org.eclipse.jface.text.*;
-
-/**
- * Auto indent strategy sensitive to brackets.
- */
-public class JavaAutoIndentStrategy extends DefaultAutoIndentStrategy {
-
- public JavaAutoIndentStrategy() {
- }
-
- /* (non-Javadoc)
- * Method declared on IAutoIndentStrategy
- */
- public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
- if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text))
- smartIndentAfterNewLine(d, c);
- else if ("}".equals(c.text)) { //$NON-NLS-1$
- smartInsertAfterBracket(d, c);
- }
- }
-
- /**
- * Returns whether or not the text ends with one of the given search strings.
- */
- private boolean endsWithDelimiter(IDocument d, String txt) {
- String[] delimiters= d.getLegalLineDelimiters();
- if (delimiters != null)
- return TextUtilities.endsWith(delimiters, txt) > -1;
- return false;
- }
-
- /**
- * Returns the line number of the next bracket after end.
- * @returns the line number of the next matching 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
- * @param closingBracketIncrease - the number of brackets to skip
- */
- protected int findMatchingOpenBracket(IDocument document, int line, int end, int closingBracketIncrease) throws BadLocationException {
-
- 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,
- // opening positive) until we find a line the brings the count to zero
- while (brackcount < 0) {
- line--;
- if (line < 0) {
- return -1;
- }
- start= document.getLineOffset(line);
- end= start + document.getLineLength(line) - 1;
- brackcount += getBracketCount(document, start, end, false);
- }
- return line;
- }
-
- /**
- * Returns the bracket value of a section of text. Closing brackets have a value of -1 and
- * open brackets have a value of 1.
- * @returns the line number of the next matching bracket after end
- * @param document - the document being parsed
- * @param start - the start position for the search
- * @param end - the end position for the search
- * @param ignoreCloseBrackets - whether or not to ignore closing brackets in the count
- */
- private int getBracketCount(IDocument document, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
-
- int begin = start;
- int bracketcount= 0;
- while (begin < end) {
- char curr= document.getChar(begin);
- begin++;
- switch (curr) {
- case '/' :
- if (begin < end) {
- char next= document.getChar(begin);
- if (next == '*') {
- // 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
- begin= end;
- }
- }
- break;
- case '*' :
- if (begin < end) {
- char next= document.getChar(begin);
- if (next == '/') {
- // we have been in a comment: forget what we read before
- bracketcount= 0;
- begin++;
- }
- }
- break;
- case '{' :
- bracketcount++;
- ignoreCloseBrackets= false;
- break;
- case '}' :
- if (!ignoreCloseBrackets) {
- bracketcount--;
- }
- break;
- case '"' :
- case '\'' :
- begin= getStringEnd(document, begin, end, curr);
- break;
- default :
- }
- }
- return bracketcount;
- }
-
- /**
- * Returns the end position a comment starting at pos.
- * @returns the end position a comment starting at pos
- * @param document - the document being parsed
- * @param position - the start position for the search
- * @param end - the end position for the search
- */
- private int getCommentEnd(IDocument document, int position, int end) throws BadLocationException {
- int currentPosition = position;
- while (currentPosition < end) {
- char curr= document.getChar(currentPosition);
- currentPosition++;
- if (curr == '*') {
- if (currentPosition < end && document.getChar(currentPosition) == '/') {
- return currentPosition + 1;
- }
- }
- }
- return end;
- }
-
- /**
- * Returns the String at line with the leading whitespace removed.
- * @returns the String at line with the leading whitespace removed.
- * @param document - the document being parsed
- * @param line - the line being searched
- */
- protected String getIndentOfLine(IDocument document, int line) throws BadLocationException {
- if (line > -1) {
- int start= document.getLineOffset(line);
- int end= start + document.getLineLength(line) - 1;
- int whiteend= findEndOfWhiteSpace(document, start, end);
- return document.get(start, whiteend - start);
- } else {
- return ""; //$NON-NLS-1$
- }
- }
-
- /**
- * Returns the position of the character in the document after position.
- * @returns the next location of character.
- * @param document - the document being parsed
- * @param position - the position to start searching from
- * @param end - the end of the document
- * @param character - the character you are trying to match
- */
- private int getStringEnd(IDocument document, int position, int end, char character) throws BadLocationException {
- int currentPosition = position;
- while (currentPosition < end) {
- char currentCharacter= document.getChar(currentPosition);
- currentPosition++;
- if (currentCharacter == '\\') {
- // ignore escaped characters
- currentPosition++;
- } else if (currentCharacter == character) {
- return currentPosition;
- }
- }
- return end;
- }
-
- /**
- * Set the indent of a new line based on the command provided in the supplied document.
- * @param document - the document being parsed
- * @param command - the command being performed
- */
- protected void smartIndentAfterNewLine(IDocument document, DocumentCommand command) {
-
- int docLength= document.getLength();
- if (command.offset == -1 || docLength == 0)
- return;
-
- try {
- int p= (command.offset == docLength ? command.offset - 1 : command.offset);
- int line= document.getLineOfOffset(p);
-
- StringBuffer buf= new StringBuffer(command.text);
- if (command.offset < docLength && document.getChar(command.offset) == '}') {
- int indLine= findMatchingOpenBracket(document, line, command.offset, 0);
- if (indLine == -1) {
- indLine= line;
- }
- buf.append(getIndentOfLine(document, indLine));
- } else {
- int start= document.getLineOffset(line);
- int whiteend= findEndOfWhiteSpace(document, start, command.offset);
- buf.append(document.get(start, whiteend - start));
- if (getBracketCount(document, start, command.offset, true) > 0) {
- buf.append('\t');
- }
- }
- command.text= buf.toString();
-
- } catch (BadLocationException excp) {
- 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
- * @param command - the command being performed
- */
- protected void smartInsertAfterBracket(IDocument document, DocumentCommand command) {
- if (command.offset == -1 || document.getLength() == 0)
- return;
-
- try {
- int p= (command.offset == document.getLength() ? command.offset - 1 : command.offset);
- int line= document.getLineOfOffset(p);
- int start= document.getLineOffset(line);
- int whiteend= findEndOfWhiteSpace(document, start, command.offset);
-
- // shift only when line does not contain any text up to the closing bracket
- if (whiteend == command.offset) {
- // evaluate the line with the opening bracket that matches out closing bracket
- int indLine= findMatchingOpenBracket(document, line, command.offset, 1);
- if (indLine != -1 && indLine != line) {
- // take the indent of the found line
- StringBuffer replaceText= new StringBuffer(getIndentOfLine(document, indLine));
- // add the rest of the current line including the just added close bracket
- replaceText.append(document.get(whiteend, command.offset - whiteend));
- replaceText.append(command.text);
- // modify document command
- command.length= command.offset - start;
- command.offset= start;
- command.text= replaceText.toString();
- }
- }
- } catch (BadLocationException excp) {
- System.out.println(JavaEditorMessages.getString("AutoIndent.error.bad_location_2")); //$NON-NLS-1$
- }
- }
-}
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
deleted file mode 100644
index 1ff653806..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.java;
-
-
-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.*;
-
-/**
- * A Java code scanner.
- */
-public class JavaCodeScanner extends RuleBasedScanner {
-
- private static String[] fgKeywords= { "abstract", "break", "case", "catch", "class", "continue", "default", "do", "else", "extends", "final", "finally", "for", "if", "implements", "import", "instanceof", "interface", "native", "new", "package", "private", "protected", "public", "return", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "volatile", "while" }; //$NON-NLS-36$ //$NON-NLS-35$ //$NON-NLS-34$ //$NON-NLS-33$ //$NON-NLS-32$ //$NON-NLS-31$ //$NON-NLS-30$ //$NON-NLS-29$ //$NON-NLS-28$ //$NON-NLS-27$ //$NON-NLS-26$ //$NON-NLS-25$ //$NON-NLS-24$ //$NON-NLS-23$ //$NON-NLS-22$ //$NON-NLS-21$ //$NON-NLS-20$ //$NON-NLS-19$ //$NON-NLS-18$ //$NON-NLS-17$ //$NON-NLS-16$ //$NON-NLS-15$ //$NON-NLS-14$ //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- private static String[] fgTypes= { "void", "boolean", "char", "byte", "short", "int", "long", "float", "double" }; //$NON-NLS-1$ //$NON-NLS-5$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-2$
-
- private static String[] fgConstants= { "false", "null", "true" }; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- /**
- * Creates a Java code scanner
- */
- public JavaCodeScanner(JavaColorProvider provider) {
-
- IToken keyword= new Token(new TextAttribute(provider.getColor(JavaColorProvider.KEYWORD)));
- IToken type= new Token(new TextAttribute(provider.getColor(JavaColorProvider.TYPE)));
- IToken string= new Token(new TextAttribute(provider.getColor(JavaColorProvider.STRING)));
- IToken comment= new Token(new TextAttribute(provider.getColor(JavaColorProvider.SINGLE_LINE_COMMENT)));
- IToken other= new Token(new TextAttribute(provider.getColor(JavaColorProvider.DEFAULT)));
-
- List rules= new ArrayList();
-
- // Add rule for single line comments.
- rules.add(new EndOfLineRule("//", comment)); //$NON-NLS-1$
-
- // Add rule for strings and character constants.
- rules.add(new SingleLineRule("\"", "\"", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
- rules.add(new SingleLineRule("'", "'", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
-
- // Add generic whitespace rule.
- rules.add(new WhitespaceRule(new JavaWhitespaceDetector()));
-
- // Add word rule for keywords, types, and constants.
- WordRule wordRule= new WordRule(new JavaWordDetector(), other);
- for (int i= 0; i < fgKeywords.length; i++)
- wordRule.addWord(fgKeywords[i], keyword);
- for (int i= 0; i < fgTypes.length; i++)
- wordRule.addWord(fgTypes[i], type);
- for (int i= 0; i < fgConstants.length; i++)
- wordRule.addWord(fgConstants[i], type);
- rules.add(wordRule);
-
- IRule[] result= new IRule[rules.size()];
- rules.toArray(result);
- setRules(result);
- }
-}
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
deleted file mode 100644
index 410bf8b02..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.java;
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.contentassist.*;
-
-/**
- * Example Java completion processor.
- */
-public class JavaCompletionProcessor implements IContentAssistProcessor {
-
- /**
- * Simple content assist tip closer. The tip is valid in a range
- * of 5 characters around its popup location.
- */
- protected static class Validator implements IContextInformationValidator, IContextInformationPresenter {
-
- protected int fInstallOffset;
-
- /*
- * @see IContextInformationValidator#isContextInformationValid(int)
- */
- public boolean isContextInformationValid(int offset) {
- return Math.abs(fInstallOffset - offset) < 5;
- }
-
- /*
- * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int)
- */
- public void install(IContextInformation info, ITextViewer viewer, int offset) {
- fInstallOffset= offset;
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int, TextPresentation)
- */
- public boolean updatePresentation(int documentPosition, TextPresentation presentation) {
- return false;
- }
- }
-
- protected final static String[] fgProposals=
- { "abstract", "boolean", "break", "byte", "case", "catch", "char", "class", "continue", "default", "do", "double", "else", "extends", "false", "final", "finally", "float", "for", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while" }; //$NON-NLS-48$ //$NON-NLS-47$ //$NON-NLS-46$ //$NON-NLS-45$ //$NON-NLS-44$ //$NON-NLS-43$ //$NON-NLS-42$ //$NON-NLS-41$ //$NON-NLS-40$ //$NON-NLS-39$ //$NON-NLS-38$ //$NON-NLS-37$ //$NON-NLS-36$ //$NON-NLS-35$ //$NON-NLS-34$ //$NON-NLS-33$ //$NON-NLS-32$ //$NON-NLS-31$ //$NON-NLS-30$ //$NON-NLS-29$ //$NON-NLS-28$ //$NON-NLS-27$ //$NON-NLS-26$ //$NON-NLS-25$ //$NON-NLS-24$ //$NON-NLS-23$ //$NON-NLS-22$ //$NON-NLS-21$ //$NON-NLS-20$ //$NON-NLS-19$ //$NON-NLS-18$ //$NON-NLS-17$ //$NON-NLS-16$ //$NON-NLS-15$ //$NON-NLS-14$ //$NON-NLS-13$ //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- protected IContextInformationValidator fValidator= new Validator();
-
- /* (non-Javadoc)
- * Method declared on IContentAssistProcessor
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- ICompletionProposal[] result= new ICompletionProposal[fgProposals.length];
- for (int i= 0; i < fgProposals.length; i++) {
- IContextInformation info= new ContextInformation(fgProposals[i], MessageFormat.format(JavaEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
- result[i]= new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length(), null, fgProposals[i], info, MessageFormat.format(JavaEditorMessages.getString("CompletionProcessor.Proposal.hoverinfo.pattern"), new Object[] { fgProposals[i]})); //$NON-NLS-1$
- }
- return result;
- }
-
- /* (non-Javadoc)
- * Method declared on IContentAssistProcessor
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- IContextInformation[] result= new IContextInformation[5];
- for (int i= 0; i < result.length; i++)
- result[i]= new ContextInformation(
- MessageFormat.format(JavaEditorMessages.getString("CompletionProcessor.ContextInfo.display.pattern"), new Object[] { new Integer(i), new Integer(documentOffset) }), //$NON-NLS-1$
- 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
- */
- public String getErrorMessage() {
- return null;
- }
-}
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
deleted file mode 100644
index 407a485a8..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.java;
-
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextViewer;
-
-/**
- * Double click strategy aware of Java identifier syntax rules.
- */
-public class JavaDoubleClickSelector implements ITextDoubleClickStrategy {
-
- protected ITextViewer fText;
- protected int fPos;
- protected int fStartPos;
- protected int fEndPos;
-
- protected static char[] fgBrackets= { '{', '}', '(', ')', '[', ']', '"', '"' };
-
- /*
- * Create a JavaDoubleClickSelector.
- */
- public JavaDoubleClickSelector() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on ITextDoubleClickStrategy
- */
- public void doubleClicked(ITextViewer text) {
-
- fPos= text.getSelectedRange().x;
-
- if (fPos < 0)
- return;
-
- fText= text;
-
- if (!selectBracketBlock())
- selectWord();
- }
-
- /**
- * Match the brackets at the current selection. Return true if successful,
- * false otherwise.
- */
- protected boolean matchBracketsAt() {
-
- char prevChar, nextChar;
-
- int i;
- int bracketIndex1= fgBrackets.length;
- int bracketIndex2= fgBrackets.length;
-
- fStartPos= -1;
- fEndPos= -1;
-
- // get the chars preceding and following the start position
- try {
-
- IDocument doc= fText.getDocument();
-
- prevChar= doc.getChar(fPos - 1);
- nextChar= doc.getChar(fPos);
-
- // is the char either an open or close bracket?
- for (i= 0; i < fgBrackets.length; i= i + 2) {
- if (prevChar == fgBrackets[i]) {
- fStartPos= fPos - 1;
- bracketIndex1= i;
- }
- }
- for (i= 1; i < fgBrackets.length; i= i + 2) {
- if (nextChar == fgBrackets[i]) {
- fEndPos= fPos;
- bracketIndex2= i;
- }
- }
-
- if (fStartPos > -1 && bracketIndex1 < bracketIndex2) {
- fEndPos= searchForClosingBracket(fStartPos, prevChar, fgBrackets[bracketIndex1 + 1], doc);
- if (fEndPos > -1)
- return true;
- else
- fStartPos= -1;
- } else if (fEndPos > -1) {
- fStartPos= searchForOpenBracket(fEndPos, fgBrackets[bracketIndex2 - 1], nextChar, doc);
- if (fStartPos > -1)
- return true;
- else
- fEndPos= -1;
- }
-
- } catch (BadLocationException x) {
- }
-
- return false;
- }
-
- /**
- * Select the word at the current selection. Return true if successful,
- * false otherwise.
- */
- protected boolean matchWord() {
-
- IDocument doc= fText.getDocument();
-
- try {
-
- int pos= fPos;
- char c;
-
- while (pos >= 0) {
- c= doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- --pos;
- }
-
- fStartPos= pos;
-
- pos= fPos;
- int length= doc.getLength();
-
- while (pos < length) {
- c= doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- ++pos;
- }
-
- fEndPos= pos;
-
- return true;
-
- } catch (BadLocationException x) {
- }
-
- return false;
- }
-
- /**
- * Returns the position of the closing bracket after startPosition.
- * @returns the location of the closing bracket.
- * @param startPosition - the beginning position
- * @param openBracket - the character that represents the open bracket
- * @param closeBracket - the character that represents the close bracket
- * @param document - the document being searched
- */
- protected int searchForClosingBracket(int startPosition, char openBracket, char closeBracket, IDocument document) throws BadLocationException {
- int stack= 1;
- int closePosition= startPosition + 1;
- int length= document.getLength();
- char nextChar;
-
- while (closePosition < length && stack > 0) {
- nextChar= document.getChar(closePosition);
- if (nextChar == openBracket && nextChar != closeBracket)
- stack++;
- else if (nextChar == closeBracket)
- stack--;
- closePosition++;
- }
-
- if (stack == 0)
- return closePosition - 1;
- else
- return -1;
-
- }
-
- /**
- * Returns the position of the open bracket before startPosition.
- * @returns the location of the starting bracket.
- * @param startPosition - the beginning position
- * @param openBracket - the character that represents the open bracket
- * @param closeBracket - the character that represents the close bracket
- * @param document - the document being searched
- */
- protected int searchForOpenBracket(int startPosition, char openBracket, char closeBracket, IDocument document) throws BadLocationException {
- int stack= 1;
- int openPos= startPosition - 1;
- char nextChar;
-
- while (openPos >= 0 && stack > 0) {
- nextChar= document.getChar(openPos);
- if (nextChar == closeBracket && nextChar != openBracket)
- stack++;
- else if (nextChar == openBracket)
- stack--;
- openPos--;
- }
-
- if (stack == 0)
- return openPos + 1;
- else
- return -1;
- }
-
- /**
- * Select the area between the selected bracket and the closing bracket. Return
- * true if successful.
- */
- protected boolean selectBracketBlock() {
- if (matchBracketsAt()) {
-
- if (fStartPos == fEndPos)
- fText.setSelectedRange(fStartPos, 0);
- else
- fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1);
-
- return true;
- }
- return false;
- }
-
- /**
- * Select the word at the current selection.
- */
- protected void selectWord() {
- if (matchWord()) {
-
- if (fStartPos == fEndPos)
- fText.setSelectedRange(fStartPos, 0);
- else
- fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1);
- }
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaEditorMessages.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaEditorMessages.java
deleted file mode 100644
index 1339ae2bb..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaEditorMessages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.java;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class JavaEditorMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.examples.javaeditor.JavaEditorMessages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private JavaEditorMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-}
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
deleted file mode 100644
index 7de71ee60..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.javadoc;
-
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.*;
-
-/**
- * Example Java doc completion processor.
- */
-public class JavaDocCompletionProcessor implements IContentAssistProcessor {
-
- protected final static String[] fgProposals= { "@author", "@deprecated", "@exception", "@param", "@return", "@see", "@serial", "@serialData", "@serialField", "@since", "@throws", "@version" }; //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-7$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- /* (non-Javadoc)
- * Method declared on IContentAssistProcessor
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- ICompletionProposal[] result= new ICompletionProposal[fgProposals.length];
- for (int i= 0; i < fgProposals.length; i++)
- 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
- */
- public String getErrorMessage() {
- return null;
- }
-}
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
deleted file mode 100644
index 0a5d98cd1..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.javadoc;
-
-
-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.JavaColorProvider;
-import org.eclipse.ui.examples.javaeditor.util.JavaWhitespaceDetector;
-
-/**
- * A rule based JavaDoc scanner.
- */
-public class JavaDocScanner extends RuleBasedScanner {
-
- /**
- * A key word detector.
- */
- static class JavaDocWordDetector implements IWordDetector {
-
- /* (non-Javadoc)
- * Method declared on IWordDetector
- */
- public boolean isWordStart(char c) {
- return (c == '@');
- }
-
- /* (non-Javadoc)
- * Method declared on IWordDetector
- */
- public boolean isWordPart(char c) {
- return Character.isLetter(c);
- }
- }
-
- private static String[] fgKeywords= { "@author", "@deprecated", "@exception", "@param", "@return", "@see", "@serial", "@serialData", "@serialField", "@since", "@throws", "@version" }; //$NON-NLS-12$ //$NON-NLS-11$ //$NON-NLS-10$ //$NON-NLS-7$ //$NON-NLS-9$ //$NON-NLS-8$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- /**
- * Create a new java doc scanner.
- */
- public JavaDocScanner(JavaColorProvider provider) {
- super();
-
- IToken keyword= new Token(new TextAttribute(provider.getColor(JavaColorProvider.JAVADOC_KEYWORD)));
- IToken tag= new Token(new TextAttribute(provider.getColor(JavaColorProvider.JAVADOC_TAG)));
- IToken link= new Token(new TextAttribute(provider.getColor(JavaColorProvider.JAVADOC_LINK)));
-
- List list= new ArrayList();
-
- // Add rule for tags.
- list.add(new SingleLineRule("<", ">", tag)); //$NON-NLS-2$ //$NON-NLS-1$
-
- // Add rule for links.
- list.add(new SingleLineRule("{", "}", link)); //$NON-NLS-2$ //$NON-NLS-1$
-
- // Add generic whitespace rule.
- list.add(new WhitespaceRule(new JavaWhitespaceDetector()));
-
- // Add word rule for keywords.
- WordRule wordRule= new WordRule(new JavaDocWordDetector());
- for (int i= 0; i < fgKeywords.length; i++)
- wordRule.addWord(fgKeywords[i], keyword);
- list.add(wordRule);
-
- IRule[] result= new IRule[list.size()];
- list.toArray(result);
- setRules(result);
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/togglepresentation.gif b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/togglepresentation.gif
deleted file mode 100644
index a0831f04b..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/togglepresentation.gif
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 05ec622e6..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.util;
-
-
-import java.util.*;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Manager for colors used in the Java editor
- */
-public class JavaColorProvider {
-
- public static final RGB MULTI_LINE_COMMENT= new RGB(128, 0, 0);
- public static final RGB SINGLE_LINE_COMMENT= new RGB(128, 128, 0);
- public static final RGB KEYWORD= new RGB(0, 0, 128);
- public static final RGB TYPE= new RGB(0, 0, 128);
- public static final RGB STRING= new RGB(0, 128, 0);
- public static final RGB DEFAULT= new RGB(0, 0, 0);
- public static final RGB JAVADOC_KEYWORD= new RGB(0, 128, 0);
- public static final RGB JAVADOC_TAG= new RGB(128, 128, 128);
- public static final RGB JAVADOC_LINK= new RGB(128, 128, 128);
- public static final RGB JAVADOC_DEFAULT= new RGB(0, 128, 128);
-
- protected Map fColorTable= new HashMap(10);
-
- /**
- * 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 as rgb.
- */
- public Color getColor(RGB rgb) {
- Color color= (Color) fColorTable.get(rgb);
- if (color == null) {
- color= new Color(Display.getCurrent(), rgb);
- fColorTable.put(rgb, color);
- }
- return color;
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWhitespaceDetector.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWhitespaceDetector.java
deleted file mode 100644
index 971522caa..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWhitespaceDetector.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.util;
-
-
-import org.eclipse.jface.text.rules.IWhitespaceDetector;
-
-/**
- * A java aware white space detector.
- */
-public class JavaWhitespaceDetector implements IWhitespaceDetector {
-
- /* (non-Javadoc)
- * Method declared on IWhitespaceDetector
- */
- public boolean isWhitespace(char character) {
- return Character.isWhitespace(character);
- }
-}
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
deleted file mode 100644
index 977acf6ae..000000000
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.javaeditor.util;
-
-
-import org.eclipse.jface.text.rules.IWordDetector;
-
-/**
- * A Java aware word detector.
- */
-public class JavaWordDetector implements IWordDetector {
-
- /* (non-Javadoc)
- * Method declared on IWordDetector.
- */
- public boolean isWordPart(char character) {
- return Character.isJavaIdentifierPart(character);
- }
-
- /* (non-Javadoc)
- * Method declared on IWordDetector.
- */
- public boolean isWordStart(char character) {
- return Character.isJavaIdentifierStart(character);
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java
deleted file mode 100644
index 5c064e4ed..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-public class ColorManager {
-
- protected Map fColorTable = new HashMap(10);
-
- public void dispose() {
- Iterator e = fColorTable.values().iterator();
- while (e.hasNext())
- ((Color) e.next()).dispose();
- }
- public Color getColor(RGB rgb) {
- Color color = (Color) fColorTable.get(rgb);
- if (color == null) {
- color = new Color(Display.getCurrent(), rgb);
- fColorTable.put(rgb, color);
- }
- return color;
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/IXMLColorConstants.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/IXMLColorConstants.java
deleted file mode 100644
index 3f015b334..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/IXMLColorConstants.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.swt.graphics.RGB;
-
-public interface IXMLColorConstants {
- RGB XML_COMMENT = new RGB(128, 0, 0);
- RGB PROC_INSTR = new RGB(128, 128, 128);
- RGB STRING = new RGB(0, 128, 0);
- RGB DEFAULT = new RGB(0, 0, 0);
- RGB TAG = new RGB(0, 0, 128);
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/NonRuleBasedDamagerRepairer.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/NonRuleBasedDamagerRepairer.java
deleted file mode 100644
index b6d4165a0..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/NonRuleBasedDamagerRepairer.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.presentation.IPresentationDamager;
-import org.eclipse.jface.text.presentation.IPresentationRepairer;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.swt.custom.StyleRange;
-
-public class NonRuleBasedDamagerRepairer
- implements IPresentationDamager, IPresentationRepairer {
-
- /** The document this object works on */
- protected IDocument fDocument;
- /** The default text attribute if non is returned as data by the current token */
- protected TextAttribute fDefaultTextAttribute;
-
- /**
- * Constructor for NonRuleBasedDamagerRepairer.
- */
- public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute) {
- Assert.isNotNull(defaultTextAttribute);
-
- fDefaultTextAttribute = defaultTextAttribute;
- }
-
- /**
- * @see IPresentationRepairer#setDocument(IDocument)
- */
- public void setDocument(IDocument document) {
- fDocument = document;
- }
-
- /**
- * Returns the end offset of the line that contains the specified offset or
- * if the offset is inside a line delimiter, the end offset of the next line.
- *
- * @param offset the offset whose line end offset must be computed
- * @return the line end offset for the given offset
- * @exception BadLocationException if offset is invalid in the current document
- */
- protected int endOfLineOf(int offset) throws BadLocationException {
-
- IRegion info = fDocument.getLineInformationOfOffset(offset);
- if (offset <= info.getOffset() + info.getLength())
- return info.getOffset() + info.getLength();
-
- int line = fDocument.getLineOfOffset(offset);
- try {
- info = fDocument.getLineInformation(line + 1);
- return info.getOffset() + info.getLength();
- } catch (BadLocationException x) {
- return fDocument.getLength();
- }
- }
-
- /**
- * @see IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean)
- */
- public IRegion getDamageRegion(
- ITypedRegion partition,
- DocumentEvent event,
- boolean documentPartitioningChanged) {
- if (!documentPartitioningChanged) {
- try {
-
- IRegion info =
- fDocument.getLineInformationOfOffset(event.getOffset());
- int start = Math.max(partition.getOffset(), info.getOffset());
-
- int end =
- event.getOffset()
- + (event.getText() == null
- ? event.getLength()
- : event.getText().length());
-
- if (info.getOffset() <= end
- && end <= info.getOffset() + info.getLength()) {
- // optimize the case of the same line
- end = info.getOffset() + info.getLength();
- } else
- end = endOfLineOf(end);
-
- end =
- Math.min(
- partition.getOffset() + partition.getLength(),
- end);
- return new Region(start, end - start);
-
- } catch (BadLocationException x) {
- }
- }
-
- return partition;
- }
-
- /**
- * @see IPresentationRepairer#createPresentation(TextPresentation, ITypedRegion)
- */
- public void createPresentation(
- TextPresentation presentation,
- ITypedRegion region) {
- addRange(
- presentation,
- region.getOffset(),
- region.getLength(),
- fDefaultTextAttribute);
- }
-
- /**
- * Adds style information to the given text presentation.
- *
- * @param presentation the text presentation to be extended
- * @param offset the offset of the range to be styled
- * @param length the length of the range to be styled
- * @param attr the attribute describing the style of the range to be styled
- */
- protected void addRange(
- TextPresentation presentation,
- int offset,
- int length,
- TextAttribute attr) {
- if (attr != null)
- presentation.addStyleRange(
- new StyleRange(
- offset,
- length,
- attr.getForeground(),
- attr.getBackground(),
- attr.getStyle()));
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TagRule.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TagRule.java
deleted file mode 100644
index fbba78c9d..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TagRule.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.rules.*;
-
-public class TagRule extends MultiLineRule {
-
- public TagRule(IToken token) {
- super("<", ">", token); //$NON-NLS-1$//$NON-NLS-2$
- }
- protected boolean sequenceDetected(
- ICharacterScanner scanner,
- char[] sequence,
- boolean eofAllowed) {
- int c = scanner.read();
- if (sequence[0] == '<') {
- if (c == '?') {
- // processing instruction - abort
- scanner.unread();
- return false;
- }
- if (c == '!') {
- scanner.unread();
- // comment - abort
- return false;
- }
- } else if (sequence[0] == '>') {
- scanner.unread();
- }
- return super.sequenceDetected(scanner, sequence, eofAllowed);
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java
deleted file mode 100644
index 5faa901ed..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.action.IAction;
-
-import org.eclipse.jface.text.source.ISourceViewer;
-
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.TextOperationAction;
-
-/**
- * A simple xml editor with template capabilities.
- */
-public class TemplateEditor extends AbstractDecoratedTextEditor {
-
- private static final String TEMPLATE_PROPOSALS= "template_proposals_action"; //$NON-NLS-1$
- private ColorManager colorManager;
-
- /**
- * Creates a new template editor.
- */
- public TemplateEditor() {
- super();
- colorManager = new ColorManager();
- setSourceViewerConfiguration(new XMLConfiguration(colorManager));
- setDocumentProvider(new XMLDocumentProvider());
- }
-
- public void dispose() {
- colorManager.dispose();
- super.dispose();
- }
-
- protected void createActions() {
- super.createActions();
-
- IAction action= new TextOperationAction(
- TemplateMessages.getResourceBundle(),
- "Editor." + TEMPLATE_PROPOSALS + ".", //$NON-NLS-1$ //$NON-NLS-2$
- this,
- ISourceViewer.CONTENTASSIST_PROPOSALS);
- action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- setAction(TEMPLATE_PROPOSALS, action);
- markAsStateDependentAction(TEMPLATE_PROPOSALS, true);
- }
-
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditorUI.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditorUI.java
deleted file mode 100644
index 3c0ed678f..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditorUI.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-
-import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
-import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
-import org.eclipse.ui.examples.javaeditor.JavaEditorExamplePlugin;
-import org.eclipse.ui.examples.templateeditor.template.XMLContextType;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class TemplateEditorUI {
- /** Key to store custom templates. */
- private static final String CUSTOM_TEMPLATES_KEY= "org.eclipse.ui.examples.templateeditor.customtemplates"; //$NON-NLS-1$
-
- /** The shared instance. */
- private static TemplateEditorUI fInstance;
-
- /** The template store. */
- private TemplateStore fStore;
- /** The context type registry. */
- private ContributionContextTypeRegistry fRegistry;
-
- private TemplateEditorUI() {
- }
-
- /**
- * Returns the shared instance.
- *
- * @return the shared instance
- */
- public static TemplateEditorUI getDefault() {
- if (fInstance == null)
- fInstance= new TemplateEditorUI();
- return fInstance;
- }
-
- /**
- * Returns this plug-in's template store.
- *
- * @return the template store of this plug-in instance
- */
- public TemplateStore getTemplateStore() {
- if (fStore == null) {
- fStore= new ContributionTemplateStore(getContextTypeRegistry(), JavaEditorExamplePlugin.getDefault().getPreferenceStore(), CUSTOM_TEMPLATES_KEY);
- try {
- fStore.load();
- } catch (IOException e) {
- JavaEditorExamplePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, "org.eclipse.ui.examples.javaeditor", IStatus.OK, "", e)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return fStore;
- }
-
- /**
- * Returns this plug-in's context type registry.
- *
- * @return the context type registry for this plug-in instance
- */
- public ContextTypeRegistry getContextTypeRegistry() {
- if (fRegistry == null) {
- // create an configure the contexts available in the template editor
- fRegistry= new ContributionContextTypeRegistry();
- fRegistry.addContextType(XMLContextType.XML_CONTEXT_TYPE);
- }
- return fRegistry;
- }
-
- /* Forward plug-in methods to javaeditor example plugin default instance */
- public ImageRegistry getImageRegistry() {
- return JavaEditorExamplePlugin.getDefault().getImageRegistry();
- }
-
- public static ImageDescriptor imageDescriptorFromPlugin(String string, String default_image) {
- return JavaEditorExamplePlugin.imageDescriptorFromPlugin(string, default_image);
- }
-
- public IPreferenceStore getPreferenceStore() {
- return JavaEditorExamplePlugin.getDefault().getPreferenceStore();
- }
-
- public void savePluginPreferences() {
- JavaEditorExamplePlugin.getDefault().savePluginPreferences();
- }
-
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.java
deleted file mode 100644
index bc5ade447..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-class TemplateMessages {
-
- private static final String RESOURCE_BUNDLE= TemplateMessages.class.getName();
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private TemplateMessages() {
- }
-
- /**
- * @param key
- * @return
- */
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- * @param arg
- * @return
- */
- public static String getFormattedString(String key, Object arg) {
- return MessageFormat.format(getString(key), new Object[] { arg });
- }
-
-
- /**
- * Gets a string from the resource bundle and formats it with arguments
- * @param key
- * @param args
- * @return
- */
- public static String getFormattedString(String key, Object[] args) {
- return MessageFormat.format(getString(key), args);
- }
-
- /**
- * @return
- */
- public static ResourceBundle getResourceBundle() {
- return fgResourceBundle;
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.properties b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.properties
deleted file mode 100644
index 1f7bf7a20..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 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
-###############################################################################
-Editor.template_proposals_action.label= Template Assist
-Editor.template_proposals_action.description= Shows the available templates
-Editor.template_proposals_action.tooltip= Show Template Proposals
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLConfiguration.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLConfiguration.java
deleted file mode 100644
index bd3305a88..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLConfiguration.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.source.ISourceViewer;
-
-import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
-import org.eclipse.ui.examples.templateeditor.template.XMLCompletionProcessor;
-
-public class XMLConfiguration extends TextSourceViewerConfiguration {
-
- private XMLDoubleClickStrategy doubleClickStrategy;
- private XMLTagScanner tagScanner;
- private XMLScanner scanner;
- private ColorManager colorManager;
-
- public XMLConfiguration(ColorManager colorManager) {
- this.colorManager= colorManager;
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return new String[]{IDocument.DEFAULT_CONTENT_TYPE, XMLPartitionScanner.XML_COMMENT,
- XMLPartitionScanner.XML_TAG};
- }
-
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- if (doubleClickStrategy == null)
- doubleClickStrategy= new XMLDoubleClickStrategy();
- return doubleClickStrategy;
- }
-
- protected XMLScanner getXMLScanner() {
- if (scanner == null) {
- scanner= new XMLScanner(colorManager);
- scanner.setDefaultReturnToken(new Token(
- new TextAttribute(colorManager.getColor(IXMLColorConstants.DEFAULT))));
- }
- return scanner;
- }
-
- protected XMLTagScanner getXMLTagScanner() {
- if (tagScanner == null) {
- tagScanner= new XMLTagScanner(colorManager);
- tagScanner
- .setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(IXMLColorConstants.TAG))));
- }
- return tagScanner;
- }
-
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
- PresentationReconciler reconciler= new PresentationReconciler();
-
- DefaultDamagerRepairer dr= new DefaultDamagerRepairer(getXMLTagScanner());
- reconciler.setDamager(dr, XMLPartitionScanner.XML_TAG);
- reconciler.setRepairer(dr, XMLPartitionScanner.XML_TAG);
-
- dr= new DefaultDamagerRepairer(getXMLScanner());
- reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
- reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
-
- NonRuleBasedDamagerRepairer ndr= new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager
- .getColor(IXMLColorConstants.XML_COMMENT)));
- reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
- reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);
-
- return reconciler;
- }
-
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant assistant= new ContentAssistant();
- assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
- IContentAssistProcessor processor= new XMLCompletionProcessor();
- assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
- assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG);
-
- assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
- assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
-
- return assistant;
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDocumentProvider.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDocumentProvider.java
deleted file mode 100644
index c1da4536b..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDocumentProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.DefaultPartitioner;
-import org.eclipse.ui.editors.text.FileDocumentProvider;
-
-public class XMLDocumentProvider extends FileDocumentProvider {
-
- protected IDocument createDocument(Object element) throws CoreException {
- IDocument document = super.createDocument(element);
- if (document != null) {
- IDocumentPartitioner partitioner =
- new DefaultPartitioner(
- new XMLPartitionScanner(),
- new String[] {
- XMLPartitionScanner.XML_TAG,
- XMLPartitionScanner.XML_COMMENT });
- partitioner.connect(document);
- document.setDocumentPartitioner(partitioner);
- }
- return document;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDoubleClickStrategy.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDoubleClickStrategy.java
deleted file mode 100644
index 49195c61e..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDoubleClickStrategy.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.*;
-
-public class XMLDoubleClickStrategy implements ITextDoubleClickStrategy {
- protected ITextViewer fText;
-
- public void doubleClicked(ITextViewer part) {
- int pos = part.getSelectedRange().x;
-
- if (pos < 0)
- return;
-
- fText = part;
-
- if (!selectComment(pos)) {
- selectWord(pos);
- }
- }
- protected boolean selectComment(int caretPos) {
- IDocument doc = fText.getDocument();
- int startPos, endPos;
-
- try {
- int pos = caretPos;
- char c = ' ';
-
- while (pos >= 0) {
- c = doc.getChar(pos);
- if (c == '\\') {
- pos -= 2;
- continue;
- }
- if (c == Character.LINE_SEPARATOR || c == '\"')
- break;
- --pos;
- }
-
- if (c != '\"')
- return false;
-
- startPos = pos;
-
- pos = caretPos;
- int length = doc.getLength();
- c = ' ';
-
- while (pos < length) {
- c = doc.getChar(pos);
- if (c == Character.LINE_SEPARATOR || c == '\"')
- break;
- ++pos;
- }
- if (c != '\"')
- return false;
-
- endPos = pos;
-
- int offset = startPos + 1;
- int len = endPos - offset;
- fText.setSelectedRange(offset, len);
- return true;
- } catch (BadLocationException x) {
- }
-
- return false;
- }
- protected boolean selectWord(int caretPos) {
-
- IDocument doc = fText.getDocument();
- int startPos, endPos;
-
- try {
-
- int pos = caretPos;
- char c;
-
- while (pos >= 0) {
- c = doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- --pos;
- }
-
- startPos = pos;
-
- pos = caretPos;
- int length = doc.getLength();
-
- while (pos < length) {
- c = doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- ++pos;
- }
-
- endPos = pos;
- selectRange(startPos, endPos);
- return true;
-
- } catch (BadLocationException x) {
- }
-
- return false;
- }
-
- private void selectRange(int startPos, int stopPos) {
- int offset = startPos + 1;
- int length = stopPos - offset;
- fText.setSelectedRange(offset, length);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLPartitionScanner.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLPartitionScanner.java
deleted file mode 100644
index 1eb5b96d8..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLPartitionScanner.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.rules.*;
-
-public class XMLPartitionScanner extends RuleBasedPartitionScanner {
- public final static String XML_DEFAULT = "__xml_default"; //$NON-NLS-1$
- public final static String XML_COMMENT = "__xml_comment"; //$NON-NLS-1$
- public final static String XML_TAG = "__xml_tag"; //$NON-NLS-1$
-
- public XMLPartitionScanner() {
-
- IToken xmlComment = new Token(XML_COMMENT);
- IToken tag = new Token(XML_TAG);
-
- IPredicateRule[] rules = new IPredicateRule[2];
-
- rules[0] = new MultiLineRule("<!--", "-->", xmlComment); //$NON-NLS-1$//$NON-NLS-2$
- rules[1] = new TagRule(tag);
-
- setPredicateRules(rules);
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLScanner.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLScanner.java
deleted file mode 100644
index d35061e7b..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLScanner.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.rules.*;
-import org.eclipse.jface.text.*;
-
-public class XMLScanner extends RuleBasedScanner {
-
- public XMLScanner(ColorManager manager) {
- IToken procInstr =
- new Token(
- new TextAttribute(
- manager.getColor(IXMLColorConstants.PROC_INSTR)));
-
- IRule[] rules = new IRule[2];
- //Add rule for processing instructions
- rules[0] = new SingleLineRule("<?", "?>", procInstr); //$NON-NLS-1$//$NON-NLS-2$
- // Add generic whitespace rule.
- rules[1] = new WhitespaceRule(new XMLWhitespaceDetector());
-
- setRules(rules);
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLTagScanner.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLTagScanner.java
deleted file mode 100644
index c9944ab59..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLTagScanner.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.*;
-import org.eclipse.jface.text.rules.*;
-
-public class XMLTagScanner extends RuleBasedScanner {
-
- public XMLTagScanner(ColorManager manager) {
- IToken string =
- new Token(
- new TextAttribute(manager.getColor(IXMLColorConstants.STRING)));
-
- IRule[] rules = new IRule[3];
-
- // Add rule for double quotes
- rules[0] = new SingleLineRule("\"", "\"", string, '\\'); //$NON-NLS-1$//$NON-NLS-2$
- // Add a rule for single quotes
- rules[1] = new SingleLineRule("'", "'", string, '\\'); //$NON-NLS-1$//$NON-NLS-2$
- // Add generic whitespace rule.
- rules[2] = new WhitespaceRule(new XMLWhitespaceDetector());
-
- setRules(rules);
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLWhitespaceDetector.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLWhitespaceDetector.java
deleted file mode 100644
index 621b14268..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLWhitespaceDetector.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.editors;
-
-import org.eclipse.jface.text.rules.IWhitespaceDetector;
-
-public class XMLWhitespaceDetector implements IWhitespaceDetector {
-
- public boolean isWhitespace(char c) {
- return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/preferences/TemplatesPreferencePage.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/preferences/TemplatesPreferencePage.java
deleted file mode 100644
index d1677f4f4..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/preferences/TemplatesPreferencePage.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.preferences;
-
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.examples.templateeditor.editors.TemplateEditorUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-
-/**
- * @see org.eclipse.jface.preference.PreferencePage
- */
-public class TemplatesPreferencePage extends TemplatePreferencePage implements IWorkbenchPreferencePage {
-
- public TemplatesPreferencePage() {
- setPreferenceStore(TemplateEditorUI.getDefault().getPreferenceStore());
- setTemplateStore(TemplateEditorUI.getDefault().getTemplateStore());
- setContextTypeRegistry(TemplateEditorUI.getDefault().getContextTypeRegistry());
- }
-
- protected boolean isShowFormatterSetting() {
- return false;
- }
-
-
- public boolean performOk() {
- boolean ok= super.performOk();
-
- TemplateEditorUI.getDefault().savePluginPreferences();
-
- return ok;
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/AntVariableResolver.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/AntVariableResolver.java
deleted file mode 100644
index 2cf42ca66..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/AntVariableResolver.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.template;
-
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateVariableResolver;
-
-/**
- * Looks up existing ant variables and proposes them. The proposals are sorted by
- * their prefix-likeness with the variable type.
- */
-public class AntVariableResolver extends TemplateVariableResolver {
- /*
- * @see org.eclipse.jface.text.templates.TemplateVariableResolver#resolveAll(org.eclipse.jface.text.templates.TemplateContext)
- */
- protected String[] resolveAll(TemplateContext context) {
- String[] proposals= new String[] { "${srcDir}", "${dstDir}" }; //$NON-NLS-1$ //$NON-NLS-2$
-
- Arrays.sort(proposals, new Comparator() {
-
- public int compare(Object o1, Object o2) {
- return getCommonPrefixLength(getType(), (String) o2) - getCommonPrefixLength(getType(), (String) o1);
- }
-
- private int getCommonPrefixLength(String type, String var) {
- int i= 0;
- CharSequence vSeq= var.subSequence(2, var.length() - 1); // strip away ${}
- while (i < type.length() && i < vSeq.length())
- if (Character.toLowerCase(type.charAt(i)) == Character.toLowerCase(vSeq.charAt(i)))
- i++;
- else
- break;
- return i;
- }
- });
-
- return proposals;
- }
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLCompletionProcessor.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLCompletionProcessor.java
deleted file mode 100644
index 8342216f1..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLCompletionProcessor.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.template;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
-
-import org.eclipse.ui.examples.templateeditor.editors.TemplateEditorUI;
-
-
-/**
- * A completion processor for XML templates.
- */
-public class XMLCompletionProcessor extends TemplateCompletionProcessor {
- private static final String DEFAULT_IMAGE= "icons/template.gif"; //$NON-NLS-1$
-
- /**
- * We watch for angular brackets since those are often part of XML
- * templates.
- */
- protected String extractPrefix(ITextViewer viewer, int offset) {
- IDocument document= viewer.getDocument();
- int i= offset;
- if (i > document.getLength())
- return ""; //$NON-NLS-1$
-
- try {
- while (i > 0) {
- char ch= document.getChar(i - 1);
- if (ch != '<' && !Character.isJavaIdentifierPart(ch))
- break;
- i--;
- }
-
- return document.get(i, offset - i);
- } catch (BadLocationException e) {
- return ""; //$NON-NLS-1$
- }
- }
-
- /**
- * Cut out angular brackets for relevance sorting, since the template name
- * does not contain the brackets.
- */
- protected int getRelevance(Template template, String prefix) {
- if (prefix.startsWith("<")) //$NON-NLS-1$
- prefix= prefix.substring(1);
- if (template.getName().startsWith(prefix))
- return 90;
- return 0;
- }
-
- /**
- * Simply return all templates.
- */
- protected Template[] getTemplates(String contextTypeId) {
- return TemplateEditorUI.getDefault().getTemplateStore().getTemplates();
- }
-
- /**
- * Return the XML context type that is supported by this plugin.
- */
- protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
- return TemplateEditorUI.getDefault().getContextTypeRegistry().getContextType(XMLContextType.XML_CONTEXT_TYPE);
- }
-
- /**
- * Always return the default image.
- */
- protected Image getImage(Template template) {
- ImageRegistry registry= TemplateEditorUI.getDefault().getImageRegistry();
- Image image= registry.get(DEFAULT_IMAGE);
- if (image == null) {
- ImageDescriptor desc= TemplateEditorUI.imageDescriptorFromPlugin("org.eclipse.ui.examples.javaeditor", DEFAULT_IMAGE); //$NON-NLS-1$
- registry.put(DEFAULT_IMAGE, desc);
- image= registry.get(DEFAULT_IMAGE);
- }
- return image;
- }
-
-}
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLContextType.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLContextType.java
deleted file mode 100644
index 7e78c021e..000000000
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLContextType.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 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 org.eclipse.ui.examples.templateeditor.template;
-
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-
-
-/**
- * A very simple context type.
- */
-public class XMLContextType extends TemplateContextType {
-
- /** This context's id */
- public static final String XML_CONTEXT_TYPE= "org.eclipse.ui.examples.templateeditor.xml"; //$NON-NLS-1$
-
- /**
- * Creates a new XML context type.
- */
- public XMLContextType() {
- addGlobalResolvers();
- }
-
- private void addGlobalResolvers() {
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- }
-
-}
diff --git a/org.eclipse.ui.examples.javaeditor/about.html b/org.eclipse.ui.examples.javaeditor/about.html
deleted file mode 100644
index 9db411aab..000000000
--- a/org.eclipse.ui.examples.javaeditor/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/org.eclipse.ui.examples.javaeditor/build.properties b/org.eclipse.ui.examples.javaeditor/build.properties
deleted file mode 100644
index ab2f4786c..000000000
--- a/org.eclipse.ui.examples.javaeditor/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 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
-###############################################################################
-source.javaeditorexample.jar = Eclipse Java Editor Example/
-source.templateeditorexample.jar = Template Editor Example/
-
-bin.includes = doc-html/,\
- icons/,\
- templates/,\
- .options,\
- about.html,\
- plugin.properties,\
- plugin.xml,\
- *.jar
-
-src.includes = about.html
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/hglegal.htm b/org.eclipse.ui.examples.javaeditor/doc-html/hglegal.htm
deleted file mode 100644
index c59811321..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/hglegal2002.htm b/org.eclipse.ui.examples.javaeditor/doc-html/hglegal2002.htm
deleted file mode 100644
index 3c8646735..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/hglegal2002.htm
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. and others 2000, 2002. All Rights Reserved.
-</body>
-</html>
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/hglegal2003.htm b/org.eclipse.ui.examples.javaeditor/doc-html/hglegal2003.htm
deleted file mode 100644
index f5871b79e..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/hglegal2003.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <LINK REL="stylesheet" HREF="../../../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.
-</body>
-</html>
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy.gif b/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy.gif
deleted file mode 100644
index 360f8e998..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2002.gif b/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2002.gif
deleted file mode 100644
index 61cef4852..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2002.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2003.gif b/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2003.gif
deleted file mode 100644
index c786e43e1..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2003.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/ui_javaeditor_ex.html b/org.eclipse.ui.examples.javaeditor/doc-html/ui_javaeditor_ex.html
deleted file mode 100644
index 3302957b2..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/ui_javaeditor_ex.html
+++ /dev/null
@@ -1,237 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
- <title>Desktop - Java Editor Example</title>
-</head>
-<body>
-
-<h2>
-<b>Example - Java Editor</b></h2>
-
-<h3>
-Introduction</h3>
-The Java Editor example demonstrates the standard features available for
-custom text editors.&nbsp; It also shows how&nbsp; to register an editor
-for a file extension (in this case .jav) and how to define a custom Document
-provider for use by that editor. This example is only for demonstration
-purposes. Java editing support is provided by the&nbsp; Eclipse Java Tooling.
-<h3>
-<b>Features demonstrated in the example editor</b></h3>
-
-<ul>
-<li>
-syntax highlighting</li>
-
-<li>
-content type sensitive content assist (JavaDoc and Java code)</li>
-
-<li>
-communication between content outliner and editor, i.e. content outliner
-selection feeds the highlight range of the editor</li>
-
-<li>
-two different presentation modes</li>
-
-<ul>
-<li>
-&nbsp;marking the highlight range using a visual range indicator</li>
-
-<li>
-confining the editor to show only text within the highlight range (e.g.
-show a single method of a Java class)</li>
-</ul>
-
-<li>
-marker handling</li>
-
-<li>
-document sharing</li>
-</ul>
-
-<h3>
-Features not demonstrated</h3>
-
-<ul>
-<li>
-content formatting</li>
-
-<li>
-dynamic reconciling of content outline page</li>
-</ul>
-
-<h3>
-Running the example editor</h3>
-
-<ol>
-<li>
-Create a project</li>
-
-<li>
-Create a file with the file extension ".jav" in the newly created project.
-The Java example editor opens automatically.</li>
-
-<li>
-Insert Java code. The Java code is dynamically colored. The example editor
-presents the following language elements in different colors: multi-line
-comments, single line comments, Java language reserved words, string and
-character constants, regular Java code, as well as multi-line comments
-following the JavaDoc guidelines. Inside those JavaDoc comments, JavaDoc
-keywords and tags are differently colored.</li>
-
-<li>
-Open a new Java multi-line comment by inserting "/*" outside a Java comment.
-All the text between the inserted "/*" and the first occurrence of "*/"
-or the end of the text changes its color to red. Append another "*". The
-red range changes color to green as the regular multi-line comment now
-is considered containing JavaDoc. Invoke code assist using CTRL-SPACE.
-The function of content assist is to support the user in writing code.
-So on invocation, content assist should list all possible valid completions
-at the invocation location. Inside JavaDoc, the example editor always proposes
-all JavaDoc keywords.</li>
-
-<li>
-Outside a Java comment invoke content tip using CTRL+SHIFT+SPACE. Five
-proposals are listed. Select one and press ENTER. A small floating red
-window appears above the current line displaying the selected proposal.
-The anticipated use of content tips is to let the user express her intention,
-e.g. to enter a method call and to present contextual information which
-guides the user by doing so. In the example editor, the proposal is considered
-valid five characters around the initial invocation location. While the
-content tip is visible, invoke content assist using CTRL+SPACE. Content
-assist invoked in this situation should help the user to accomplish her
-stated intention visible in the content tip. Inside regular Java code,
-the example editor always proposes all Java keywords.</li>
-
-<li>
-Save the Java code. Saving updates the content outliner. The content outliner
-contains ten entries each of them representing one of ten equally sized
-segments of the Java code in the editor. This style of content outline
-has been chosen to show that the semantics of highlight ranges can arbitrarily
-be defined. (See next steps.)</li>
-
-<li>
-Select one of the entries in the content outliner. The corresponding lines
-are marked with a blue bar in the editor's left vertical ruler.</li>
-
-<li>
-Now switch to the segmented presentation mode of the Java editor. For that
-make sure that the editor has the focus and press that button in the desktop's
-toolbar whose hover help says "Enable/Disable segmented source viewer".&nbsp;
-This functionality is anticipated to be used, e.g., for single method views.</li>
-
-<li>
-Select a different entry in the content outliner. Now the editor only shows
-the selected segment. By deselecting the entry in the content outliner,
-the complete Java code is shown again.</li>
-
-<li>
-Select an entry in the content outliner, select a fraction of the visible
-text, and add a task for the selection. The task shows up in the task list.
-Modify the visible code. In the task list, select the previously created
-task and press the "Go to file" button. The task is selected in the visible
-area, correctly taking the previously applied modifications into account.</li>
-
-<li>
-Select another entry in the content outliner. Reveal the previously added
-task from the task list. The editor's highlight range is automatically
-enlarged to enclose the range of the revealed task.</li>
-
-<li>
-Open a new workspace. In the new workspace, open a Java editor for the
-same file as in the original workspace. Modify the editor content. Switch
-back to the original workspace. The editor shows the changes made in the
-other workspace. The two editors showing the same file are lively linked.</li>
-</ol>
-
-<h3>
-Principles for creating custom text editors</h3>
-The following steps are usually necessary do develop a custom text editor.
-<ol>
-<li>
-Create a document provider. A document provider (see IDocumentProvider)
-produces and manages documents (see IDocument) containing a textual representation
-of editor input elements. It is important to decide how the translation
-between element and textual representation looks like and whether the document
-provider should be shared between multiple editors or not. See the class
-FileDocumentProvider in the Java example editor.</li>
-
-<li>
-Create a document partitioner. A document partitioner (see IDocumentPartitioner)
-divides a document into disjoint regions. The partitioner assigns each
-region one content type out of a set of content types predefined by the
-partitioner. On each document change the document's partitioning must be
-updated. See the class JavaPartitioner in the Java example editor. The
-JavaPartitioner determines regions of the types multi-line comments, JavaDoc
-comments, and everything else. It must be ensured that the document provider
-is set on each document produced by the document provider.</li>
-
-<li>
-Determine which of the source viewer plugins should be provided. Among
-other supported plugins are auto indent strategies, double click strategies,
-content formatter, and text presentation reconciler. The subsequent description
-will be restricted to the text presentation reconciler (see IPresentationReconciler).
-In the Java example editor, the text presentation reconciler is utilized
-to implement syntax highlighting.</li>
-
-<li>
-Create for all source viewer plugins the appropriate extensions for each
-supported content type. As seen above, the document partitioner defines
-the supported content types. The default implementation of IPresentationReconciler
-supports IPresentationDamagers and IPresentationRepairers as extensions.
-Those extensions are considered being specific for a particular content
-type. Thus, for a custom editor, the user must first select a subset of
-the supported content types. Regions of a type being a member of the selected
-subset will, e.g., be syntax highlighted. For each of those types the extensions
-must be implemented. See JavaDamagerRepairer and JavaDocDamagerRepairer
-in the example editor.</li>
-
-<li>
-Build a source viewer configuration using the previously created plugins
-and extensions. See JavaSourceViewerConfiguration in the example editor.</li>
-
-<li>
-Customize the class TextEditor or AbstractTextEditor with the developed
-document partitioner and source viewer configuration. Add or replace actions
-and adapt the construction of the editor's context menu. In the actual
-version, this customization must be done in a subclass. See JavaEditor
-in the example editor.</li>
-
-<li>
-Set up an appropriate action bar contributor who contributes editor-related
-actions to the desktop's toolbar and menus. See JavaActionContributor in
-the example editor.</li>
-
-<li>
-Extend the XML configuration file of the editor's plugin, so that the editor
-registers at the predefined editor extension point for a specific set of
-file extensions. Also set up the action bar contributor in the XML file.
-See plugin.xml of this example.</li>
-</ol>
-
-<h3>
-Code organization of the example</h3>
-The example code is organized in four packages:
-<ul>
-<li>
-<tt>org.eclipse.ui.examples.javaeditor </tt>contains all the editor specific
-classes.</li>
-
-<li>
-<tt>org.eclipse.ui.examples.javaeditor.java</tt> contains all Java specific
-source viewer plugins such as the JavaDamagerRepairer as well as the Java
-specific document partitioner.</li>
-
-<li>
-<tt>org.eclipse.ui.examples.javaeditor.javadoc </tt>contains all JavaDoc
-specific source viewer plugins such as the JavaDocDamagerRepairer.</li>
-
-<br><tt>org.eclipse.ui.examples.javaeditor.util</tt> contains convenience
-classes shared by the three other packages.</ul>
-
-<br>&nbsp;
-<p><a href="hglegal2003.htm"><img src="ngibmcpy2003.gif" alt="Copyright IBM Corporation and others 2000, 2003" border="0" width="324" height="14"></a>
-</p>
-</body>
-</html>
diff --git a/org.eclipse.ui.examples.javaeditor/doc-html/ui_templateeditor_ex.html b/org.eclipse.ui.examples.javaeditor/doc-html/ui_templateeditor_ex.html
deleted file mode 100644
index 68ed57db7..000000000
--- a/org.eclipse.ui.examples.javaeditor/doc-html/ui_templateeditor_ex.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
- <title>Desktop - Template Editor Example</title>
-</head>
-<body>
-
-<h2>
-<b>Example - Template Editor</b></h2>
-
-<h3>
-Introduction</h3>
-The Template Editor example demonstrates how to add template support to an editor. The example is
-based on the PDE example editor project that can be created using the new project wizard. The editor
-is a simple XML editor; it is only for demonstration purposes.
-<h3>
-<b>Features demonstrated in the template editor</b></h3>
-
-<ul>
-<li>
-creating a template context for an editor</li>
-
-<li>
-setting up a content assist processor that will propose template completions</li>
-
-<li>
-contributing a context type and variable resolvers to an editor via plugin.xml</li>
-
-<li>
-contributing templates to a context type via plugin.xml</li>
-
-<li>
-adding a preference page for handling templates, both contributed and user-added</li>
-
-</ul>
-
-<h3>
-Features not demonstrated</h3>
-
-<ul>
-<li>
-template formatting</li>
-</ul>
-
-<h3>
-Code organization of the template editor example</h3>
-The example code is organized in three packages:
-<ul>
-<li>
-<tt>org.eclipse.ui.examples.templateeditor.editors</tt> contains all the editor specific
-classes. See <code>XMLConfiguration</code> to see how the <code>TemplateCompletionProcessor</code>
-is added in the <code>getContentAssistant</code> method.</li>
-
-<li>
-<tt>org.eclipse.ui.examples.templateeditor.preferences</tt> contains the contributed template
-preference page.</li>
-
-<li>
-<tt>org.eclipse.ui.examples.templateeditor.template</tt> contains the example context type, the
-completion processor and the variable resolver that is contributed via plugin.xml.</li>
-</ul>
-
-<br>&nbsp;
-<p><a href="hglegal2003.htm"><img src="ngibmcpy2003.gif" alt="Copyright IBM Corporation and others 2000, 2003" border="0" width="324" height="14"></a>
-</p>
-</body>
-</html>
diff --git a/org.eclipse.ui.examples.javaeditor/icons/obj16/java.gif b/org.eclipse.ui.examples.javaeditor/icons/obj16/java.gif
deleted file mode 100644
index 83de817b7..000000000
--- a/org.eclipse.ui.examples.javaeditor/icons/obj16/java.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.examples.javaeditor/icons/resolver.gif b/org.eclipse.ui.examples.javaeditor/icons/resolver.gif
deleted file mode 100644
index 34fb3c9d8..000000000
--- a/org.eclipse.ui.examples.javaeditor/icons/resolver.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.examples.javaeditor/icons/sample.gif b/org.eclipse.ui.examples.javaeditor/icons/sample.gif
deleted file mode 100644
index 34fb3c9d8..000000000
--- a/org.eclipse.ui.examples.javaeditor/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.examples.javaeditor/icons/template.gif b/org.eclipse.ui.examples.javaeditor/icons/template.gif
deleted file mode 100644
index 65c2632fd..000000000
--- a/org.eclipse.ui.examples.javaeditor/icons/template.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.examples.javaeditor/plugin.properties b/org.eclipse.ui.examples.javaeditor/plugin.properties
deleted file mode 100644
index b7297a125..000000000
--- a/org.eclipse.ui.examples.javaeditor/plugin.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 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
-###############################################################################
-#
-# Resource strings for Java Example Editor
-#
-pluginName=JFace Text Example
-providerName = Eclipse.org
-
-#
-# Java Example Editor
-#
-javaEditorName=Example Java Editor
-javaFileExtensions=jav
-documentSetupParticipantName=Example Java Document Setup Participant
-
-#
-# XML / Template Editor
-#
-xml.editor.name= Template Editor
-xml.editor.extensions= xml
-
-xml.contextType.name= Ant Script
-
-ant.tasks.copy.name= copy
-ant.tasks.copy.description= Copy task
-
-ant.resolvers.src= Source Fileset
-ant.resolvers.src.description= A source fileset
-ant.resolvers.dst= Destination Fileset
-ant.resolvers.dst.description= An output fileset
diff --git a/org.eclipse.ui.examples.javaeditor/plugin.xml b/org.eclipse.ui.examples.javaeditor/plugin.xml
deleted file mode 100644
index 229ee97c9..000000000
--- a/org.eclipse.ui.examples.javaeditor/plugin.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.ui.examples.javaeditor"
- name="%pluginName"
- version="3.0.0"
- provider-name="%providerName"
- class="org.eclipse.ui.examples.javaeditor.JavaEditorExamplePlugin">
-
- <runtime>
- <library name="javaeditorexample.jar">
- <export name="*"/>
- </library>
- <library name="templateeditorexample.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.filebuffers"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.ui.editors"/>
- <import plugin="org.eclipse.ui.views"/>
- </requires>
-
-
-<!-- =========================================================================== -->
-<!-- Java Editor Example -->
-<!-- =========================================================================== -->
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="%javaEditorName"
- icon="icons/obj16/java.gif"
- extensions="%javaFileExtensions"
- contributorClass="org.eclipse.ui.examples.javaeditor.JavaActionContributor"
- class="org.eclipse.ui.examples.javaeditor.JavaEditor"
- id="org.eclipse.ui.JavaEditor">
- </editor>
- </extension>
-
- <extension
- id="ExampleJavaDocumentSetupParticipant"
- name="%documentSetupParticipantName"
- point="org.eclipse.core.filebuffers.documentSetup">
- <participant
- extensions="%javaFileExtensions"
- class="org.eclipse.ui.examples.javaeditor.JavaDocumentSetupParticipant">
- </participant>
- </extension>
-
-<!-- =========================================================================== -->
-<!-- Template Editor Example -->
-<!-- =========================================================================== -->
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="%xml.editor.name"
- icon="icons/sample.gif"
- extensions="%xml.editor.extensions"
- contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
- class="org.eclipse.ui.examples.templateeditor.editors.TemplateEditor"
- id="org.eclipse.ui.examples.templateeditor.editors.TemplateEditor">
- </editor>
- </extension>
-
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- name="Template Editor"
- class="org.eclipse.ui.examples.templateeditor.preferences.TemplatesPreferencePage"
- id="org.eclipse.ui.examples.templateeditor.preferencepage">
- </page>
- </extension>
-
- <extension
- point="org.eclipse.ui.editors.templates">
- <contextType
- name="%xml.contextType.name"
- class="org.eclipse.ui.examples.templateeditor.template.XMLContextType"
- id="org.eclipse.ui.examples.templateeditor.xml">
- </contextType>
- <template
- name="%ant.tasks.copy.name"
- icon="icons/template.gif"
- description="%ant.tasks.copy.description"
- contextTypeId="org.eclipse.ui.examples.templateeditor.xml"
- id="org.eclipse.ui.examples.templateeditor.ant.copy">
- <pattern>&lt;copy todir=&quot;${dst}&quot;&gt;
- &lt;fileset dir=&quot;${src}&quot;/&gt;
-&lt;/copy&gt;</pattern>
- </template>
- <resolver
- name="%ant.resolvers.src"
- type="src"
- icon="icons/resolver.gif"
- description="%ant.resolvers.src.description"
- contextTypeId="org.eclipse.ui.examples.templateeditor.xml"
- class="org.eclipse.ui.examples.templateeditor.template.AntVariableResolver">
- </resolver>
- <resolver
- name="%ant.resolvers.dst"
- type="dst"
- icon="icons/resolver.gif"
- description="%ant.resolvers.dst.description"
- contextTypeId="org.eclipse.ui.examples.templateeditor.xml"
- class="org.eclipse.ui.examples.templateeditor.template.AntVariableResolver">
- </resolver>
- <include
- file="templates/ant.xml"
- translations="templates/ant.properties">
- </include>
- </extension>
-
-</plugin>
diff --git a/org.eclipse.ui.examples.javaeditor/templates/ant.properties b/org.eclipse.ui.examples.javaeditor/templates/ant.properties
deleted file mode 100644
index 366dbdb67..000000000
--- a/org.eclipse.ui.examples.javaeditor/templates/ant.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 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
-###############################################################################
-ant.tasks.javac.name= javac
-ant.tasks.javac.desc= Add a javac task
diff --git a/org.eclipse.ui.examples.javaeditor/templates/ant.xml b/org.eclipse.ui.examples.javaeditor/templates/ant.xml
deleted file mode 100644
index 025cf7a94..000000000
--- a/org.eclipse.ui.examples.javaeditor/templates/ant.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-
-<template
- context="org.eclipse.ui.examples.templateeditor.xml"
- description="%ant.tasks.javac.desc"
- id="org.eclipse.ui.examples.templateeditor.ant.javac1"
- name="%ant.tasks.javac.name">&lt;javac srcdir=&quot;${src}&quot;
- destdir=&quot;${dst}&quot;
- classpath=&quot;${jarfile}&quot;
- debug=&quot;${on}&quot;
-/&gt;${cursor}</template>
-
-</templates>

Back to the top