Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples')
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java107
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java109
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java79
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java154
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java85
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java62
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java54
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java23
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java128
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java87
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java51
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java40
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java58
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java132
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java174
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java42
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java36
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java125
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java185
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java171
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java203
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java63
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java24
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java154
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java54
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java310
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java68
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java53
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java40
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java55
-rw-r--r--examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties85
31 files changed, 0 insertions, 3011 deletions
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java
deleted file mode 100644
index a14bd528c1e..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AdaptableList.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import java.util.*;
-
-/**
- * A list of adaptable objects. This is a generic list that can
- * be used to display an arbitrary set of adaptable objects in the workbench.
- * Also implements the IWorkbenchAdapter interface for simple display
- * and navigation.
- */
-public class AdaptableList implements IWorkbenchAdapter, IAdaptable {
- protected List children = new ArrayList();
-/**
- * Creates a new adaptable list with the given children.
- */
-public AdaptableList() {
-}
-/**
- * Creates a new adaptable list with the given children.
- */
-public AdaptableList(IAdaptable[] newChildren) {
- for (int i = 0; i < newChildren.length; i++) {
- children.add(newChildren[i]);
- }
-}
-/**
- * Adds all the adaptable objects in the given enumeration to this list.
- * Returns this list.
- */
-public AdaptableList add(Iterator iterator) {
- while (iterator.hasNext()) {
- add((IAdaptable)iterator.next());
- }
- return this;
-}
-/**
- * Adds the given adaptable object to this list.
- * Returns this list.
- */
-public AdaptableList add(IAdaptable adaptable) {
- children.add(adaptable);
- return this;
-}
-/* (non-Javadoc)
- * Method declared on IAdaptable
- */
-public Object getAdapter(Class adapter) {
- if (adapter == IWorkbenchAdapter.class) return this;
- return null;
-}
-/**
- * Returns the elements in this list.
- */
-public Object[] getChildren() {
- return children.toArray();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object[] getChildren(Object o) {
- return children.toArray();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public ImageDescriptor getImageDescriptor(Object object) {
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public String getLabel(Object object) {
- return object == null ? "" : object.toString(); //$NON-NLS-1$
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object getParent(Object object) {
- return null;
-}
-/**
- * Removes the given adaptable object from this list.
- */
-public void remove(IAdaptable adaptable) {
- children.remove(adaptable);
-}
-/**
- * Returns the number of items in the list
- */
-public int size() {
- return children.size();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java
deleted file mode 100644
index d5255965f03..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddReadmeMarkerAction.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.MarkerUtilities;
-
-
-
-/**
- * Action for creating a readme marker with a specfic id
- * attribute value.
- */
-public class AddReadmeMarkerAction extends Action {
- private ITextEditor textEditor;
- private Object[][] customAttributes;
- private String message;
- private final static String MARKER_TYPE = "org.eclipse.ui.examples.readmetool.readmemarker"; //$NON-NLS-1$
-
- /**
- * Creates a new action for the given text editor.
- *
- * @param editor the text editor
- * @param label the label for the action
- * @param attributes the custom attributes for this marker
- * @param message the message for the marker
- */
- public AddReadmeMarkerAction(ITextEditor editor, String label, Object[][] attributes, String message) {
- textEditor = editor;
- setText(label);
- this.customAttributes = attributes;
- this.message = message;
- }
-
- /*
- * @see IAction#run()
- */
- public void run() {
- Map attributes= new HashMap(11);
-
- ITextSelection selection= (ITextSelection) textEditor.getSelectionProvider().getSelection();
- if (!selection.isEmpty()) {
-
- int start= selection.getOffset();
- int length= selection.getLength();
-
- if (length < 0) {
- length= -length;
- start -= length;
- }
-
- MarkerUtilities.setCharStart(attributes, start);
- MarkerUtilities.setCharEnd(attributes, start + length);
-
- // marker line numbers are 1-based
- int line= selection.getStartLine();
- MarkerUtilities.setLineNumber(attributes, line == -1 ? -1 : line + 1);
-
- // set custom attribute values
- for (int i = 0; i < customAttributes.length; i++) {
- attributes.put(customAttributes[i][0], customAttributes[i][1]);
- }
-
- MarkerUtilities.setMessage(attributes, message);
- }
-
- try {
- MarkerUtilities.createMarker(getResource(), attributes, MARKER_TYPE);
- } catch (CoreException x) {
- Platform.getPlugin(PlatformUI.PLUGIN_ID).getLog().log(x.getStatus());
-
- Shell shell= textEditor.getSite().getShell();
- String title= MessageUtil.getString("Add_readme_marker_error_title"); //$NON-NLS-1$
- String msg= MessageUtil.getString("Add_readme_marker_error_message"); //$NON-NLS-1$
-
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
- }
-
- /**
- * Returns the resource on which to create the marker,
- * or <code>null</code> if there is no applicable resource. This
- * queries the editor's input using <code>getAdapter(IResource.class)</code>.
- *
- * @return the resource to which to attach the newly created marker
- */
- protected IResource getResource() {
- IEditorInput input= textEditor.getEditorInput();
- return (IResource) ((IAdaptable) input).getAdapter(IResource.class);
- }
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java
deleted file mode 100644
index 75b3e9bada0..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/AddSentenceResolution.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * A resolution which inserts a sentence into the readme file
- */
-public class AddSentenceResolution implements IMarkerResolution {
- /* (non-Javadoc)
- * Method declared on IMarkerResolution.
- */
- public String getLabel() {
- return MessageUtil.getString("Add_Sentence"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * Method declared on IMarkerResolution.
- */
- public void run(IMarker marker) {
- // Se if there is an open editor on the file containing the marker
- IWorkbenchWindow w = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (w == null)
- return;
- IWorkbenchPage page = w.getActivePage();
- if (page == null)
- return;
- IFileEditorInput input = new FileEditorInput((IFile)marker.getResource());
- IEditorPart editorPart = page.findEditor(input);
-
- if (editorPart == null) {
- // open an editor
- try {
- editorPart = page.openEditor((IFile)marker.getResource());
- } catch (PartInitException e) {
- MessageDialog.openError(
- w.getShell(),
- MessageUtil.getString("Resolution_Error"), //$NON-NLS-1$
- MessageUtil.getString("Unable_to_open_file_editor")); //$NON-NLS-1$
- }
- }
- if (editorPart == null || !(editorPart instanceof ReadmeEditor))
- return;
- // insert the sentence
- ReadmeEditor editor = (ReadmeEditor)editorPart;
- IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
- String s = MessageUtil.getString("Simple_sentence"); //$NON-NLS-1$
- try {
- doc.replace(marker.getAttribute(IMarker.CHAR_START, -1), 0, s);
- } catch (BadLocationException e) {
- // ignore
- return;
- }
- // delete the marker
- try {
- marker.delete();
- } catch (CoreException e) {
- e.printStackTrace();
- // ignore
- }
-
- }
-
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java
deleted file mode 100644
index 4f8cbb0118a..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DefaultSectionsParser.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.CoreException;
-import java.io.*;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- * This class is a simple parser implementing the IReadmeFileParser
- * interface. It parses a Readme file into sections based on the
- * existence of numbered section tags in the input. A line beginning
- * with a number followed by a dot will be taken as a section indicator
- * (for example, 1., 2., or 12.).
- * As well, a line beginning with a subsection-style series of numbers
- * will also be taken as a section indicator, and can be used to
- * indicate subsections (for example, 1.1, or 1.1.12).
- */
-public class DefaultSectionsParser implements IReadmeFileParser {
-/**
- * Returns the mark element that is the logical parent
- * of the given mark number. Each dot in a mark number
- * represents a parent-child separation. For example,
- * the parent of 1.2 is 1, the parent of 1.4.1 is 1.4.
- * Returns null if there is no appropriate parent.
- */
-protected IAdaptable getParent(Hashtable toc, String number) {
- int lastDot = number.lastIndexOf('.');
- if (lastDot < 0)
- return null;
- String parentNumber = number.substring(0, lastDot);
- return (IAdaptable) toc.get(parentNumber);
-}
-/**
- * Returns a string containing the contents of the given
- * file. Returns an empty string if there were any errors
- * reading the file.
- */
-protected String getText(IFile file) {
- try {
- InputStream in = file.getContents();
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte[] buf = new byte[1024];
- int read = in.read(buf);
- while (read > 0) {
- out.write(buf, 0, read);
- read = in.read(buf);
- }
- return out.toString();
- } catch (CoreException e) {
- } catch (IOException e) {
- }
- return ""; //$NON-NLS-1$
-}
-/**
- * Parses the input given by the argument.
- *
- * @param file the element containing the input text
- * @return an element collection representing the parsed input
- */
-public MarkElement[] parse(IFile file) {
- Hashtable markTable = new Hashtable(40);
- Vector topLevel = new Vector();
- String s = getText(file);
- int start = 0;
- int end = -1;
- int lineno = 0;
- int lastlineno = 0;
- MarkElement lastme = null;
- int ix;
-
- // parse content for headings
- ix = s.indexOf('\n', start);
- while (ix != -1) {
- start = end + 1;
- end = ix = s.indexOf('\n', start);
- lineno++;
- if (ix != -1) {
- // skip blanks
- while (s.charAt(start) == ' ' || s.charAt(start) == '\t') {
- start++;
- }
- if (Character.isDigit(s.charAt(start))) {
- if (lastme != null) {
- lastme.setNumberOfLines(lineno - lastlineno - 1);
- }
- lastlineno = lineno;
- String markName = parseHeading(s, start, end);
-
- //get the parent mark, if any.
- String markNumber = parseNumber(markName);
- IAdaptable parent = getParent(markTable, markNumber);
- if (parent == null)
- parent = file;
-
- MarkElement me = new MarkElement(parent, markName, start, end - start);
- lastme = me;
-
- markTable.put(markNumber, me);
- if (parent == file) {
- topLevel.add(me);
- }
- }
- }
- }
- if (lastme != null) {
- // set the number of lines for the last section
- lastme.setNumberOfLines(lineno - lastlineno - 1);
- }
- MarkElement[] results = new MarkElement[topLevel.size()];
- topLevel.copyInto(results);
- return results;
-}
-/**
- * Creates a section name from the buffer and trims trailing
- * space characters.
- *
- * @param buffer the string from which to create the section name
- * @param start the start index
- * @param end the end index
- * @return a section name
- */
-private String parseHeading(String buffer, int start, int end) {
- while (Character.isWhitespace(buffer.charAt(end-1)) && end >start) {
- end--;
- }
- return buffer.substring(start, end);
-}
-/**
- * Returns the number for this heading. A heading consists
- * of a number (an arbitrary string of numbers and dots), followed by
- * arbitrary text.
- */
-protected String parseNumber(String heading) {
- int start = 0;
- int end = heading.length();
- char c;
- do {
- c = heading.charAt(start++);
- } while ((c == '.' || Character.isDigit(c)) && start < end);
-
- //disregard trailing dots
- while (heading.charAt(start-1) == '.' && start > 0) {
- start--;
- }
- return heading.substring(0, start);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java
deleted file mode 100644
index 750fb71d95c..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/DirtyStateContribution.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-
-/**
- * This class demonstrates the contribution of a custom control to the
- * status line for the readme editor. The control shows the
- * dirty status of the editor.
- */
-public class DirtyStateContribution extends ControlContribution
- implements IPropertyListener
-{
- private Composite composite;
- private Label label;
- private IEditorPart activeEditor;
-/**
- * Creates a new DirtyStateContribution.
- */
-protected DirtyStateContribution() {
- super("DirtyState"); //$NON-NLS-1$
-}
-/* (non-Javadoc)
- * Method declared on ControlContribution
- */
-protected Control createControl(Composite parent) {
- // If the composite is good just return it.
- if (composite != null && !composite.isDisposed())
- return composite;
-
- // Create composite for border.
- composite = new Composite(parent, SWT.BORDER);
- composite.setData(this);
-
- // Create label inside composite.
- label = new Label(composite, SWT.NONE);
- label.setSize(80, 15);
-
- updateState();
- return composite;
-}
-/**
- * Called when an editor is activated.
- *
- * @see ReadmeEditorActionBarContributor#setActiveEditor(IEditorPart)
- */
-public void editorChanged(IEditorPart part) {
- if (activeEditor != null) {
- activeEditor.removePropertyListener(this);
- }
- activeEditor = part;
- if (activeEditor != null) {
- activeEditor.addPropertyListener(this);
- }
- updateState();
-}
-/* (non-Javadoc)
- * Method declared on IPropertyListener
- */
-public void propertyChanged(Object source, int propID) {
- if (source instanceof IEditorPart)
- updateState();
-}
-/**
- * Updates the state of the label.
- */
-private void updateState() {
- if (label == null || label.isDisposed())
- return;
-
- boolean saveNeeded = false;
- if (activeEditor != null)
- saveNeeded = activeEditor.isDirty();
- if (saveNeeded)
- label.setText(MessageUtil.getString("Save_Needed")); //$NON-NLS-1$
- else
- label.setText(MessageUtil.getString("Clean")); //$NON-NLS-1$
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java
deleted file mode 100644
index c5db72258f5..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/EditorActionDelegate.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.*;
-
-/**
- * This class is used to demonstrate editor action extensions.
- * An extension should be defined in the readme plugin.xml.
- */
-public class EditorActionDelegate implements IEditorActionDelegate {
- private IEditorPart editor;
-/**
- * Creates a new EditorActionDelegate.
- */
-public EditorActionDelegate() {
-}
-/* (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void run(IAction action) {
- MessageDialog.openInformation(editor.getSite().getShell(),
- MessageUtil.getString("Readme_Editor"), //$NON-NLS-1$
- MessageUtil.getString("Editor_Action_executed")); //$NON-NLS-1$
-}
-/**
- * The <code>EditorActionDelegate</code> implementation of this
- * <code>IActionDelegate</code> method
- *
- * Selection in the desktop has changed. Plugin provider
- * can use it to change the availability of the action
- * or to modify other presentation properties.
- *
- * <p>Action delegate cannot be notified about
- * selection changes before it is loaded. For that reason,
- * control of action's enable state should also be performed
- * through simple XML rules defined for the extension
- * point. These rules allow enable state control before
- * the delegate has been loaded.</p>
- */
-public void selectionChanged(IAction action, ISelection selection) {
-}
-/**
- * The <code>EditorActionDelegate</code> implementation of this
- * <code>IEditorActionDelegate</code> method
- *
- * The matching editor has been activated. Notification
- * guarantees that only editors that match the type for which
- * this action has been registered will be tracked.
- *
- * @param action action proxy that represents this delegate in the desktop
- * @param editor the matching editor that has been activated
- */
-public void setActiveEditor(IAction action, IEditorPart editor) {
- this.editor = editor;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java
deleted file mode 100644
index 5869b87b531..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeConstants.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-/**
- * This interface contains constants for use only within the
- * Readme example.
- */
-public interface IReadmeConstants {
- public static final String PLUGIN_ID ="org.eclipse.ui.examples.readmetool"; //$NON-NLS-1$
- public static final String PREFIX = PLUGIN_ID+"."; //$NON-NLS-1$
- public static final String P_CONTENT_OUTLINE=PREFIX+"content_outline"; //$NON-NLS-1$
- public static final String P_SECTIONS=PREFIX+"sections"; //$NON-NLS-1$
- public static final String EXTENSION = "readme"; //$NON-NLS-1$
- public static final String TAG_PARSER = "parser"; //$NON-NLS-1$
- public static final String ATT_CLASS = "class"; //$NON-NLS-1$
- public static final String PP_SECTION_PARSER = "sectionParser"; //$NON-NLS-1$
-
- // Global actions
- public static final String RETARGET2 = PREFIX + "retarget2";
- public static final String LABELRETARGET3 = PREFIX + "labelretarget3";
-
- public static final String ACTION_SET_RETARGET4 = "org_eclipse_ui_examples_readmetool_readmeRetargetAction";
- public static final String ACTION_SET_LABELRETARGET5 = "org_eclipse_ui_examples_readmetool_readmeRelabelRetargetAction";
-
- // Preference constants
- public static final String PRE_CHECK1=PREFIX+"check1"; //$NON-NLS-1$
- public static final String PRE_CHECK2=PREFIX+"check2"; //$NON-NLS-1$
- public static final String PRE_CHECK3=PREFIX+"check3"; //$NON-NLS-1$
- public static final String PRE_RADIO_CHOICE = PREFIX+"radio_choice"; //$NON-NLS-1$
- public static final String PRE_TEXT = PREFIX+"text"; //$NON-NLS-1$
-
- // Help context ids
- public static final String EDITOR_ACTION1_CONTEXT = PREFIX+"editor_action1_context"; //$NON-NLS-1$
- public static final String EDITOR_ACTION2_CONTEXT = PREFIX+"editor_action2_context"; //$NON-NLS-1$
- public static final String EDITOR_ACTION3_CONTEXT = PREFIX+"editor_action3_context"; //$NON-NLS-1$
- public static final String SECTIONS_VIEW_CONTEXT = PREFIX+"sections_view_context"; //$NON-NLS-1$
- public static final String PREFERENCE_PAGE_CONTEXT = PREFIX+"preference_page_context"; //$NON-NLS-1$
- public static final String PROPERTY_PAGE_CONTEXT = PREFIX+"property_page_context"; //$NON-NLS-1$
- public static final String PROPERTY_PAGE2_CONTEXT = PREFIX+"property_page2_context"; //$NON-NLS-1$
- public static final String EDITOR_CONTEXT = PREFIX+"editor_context"; //$NON-NLS-1$
- public static final String SECTIONS_DIALOG_CONTEXT = PREFIX+"sections_dialog_context"; //$NON-NLS-1$
- public static final String CONTENT_OUTLINE_PAGE_CONTEXT = PREFIX+"content_outline_page_context"; //$NON-NLS-1$
- public static final String CREATION_WIZARD_PAGE_CONTEXT = PREFIX+"creation_wizard_page_context"; //$NON-NLS-1$
-
- // Marker attributes
- public static final String MARKER_ATT_ID = PREFIX+"id"; //$NON-NLS-1$
- public static final String MARKER_ATT_LEVEL = PREFIX+"level"; //$NON-NLS-1$
- public static final String MARKER_ATT_DEPT = PREFIX+"department"; //$NON-NLS-1$
- public static final String MARKER_ATT_CODE = PREFIX+"code"; //$NON-NLS-1$
- public static final String MARKER_ATT_LANG = PREFIX+"language"; //$NON-NLS-1$
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java
deleted file mode 100644
index 3f51c06acbb..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/IReadmeFileParser.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-
-/**
- * This interface is used as API for the Readme parser extension
- * point. The default implementation simply looks for lines
- * in the file that start with a number and assumes that they
- * represent sections. Tools are allowed to replace this
- * algorithm by defining an extension and supplying an
- * alternative that implements this interface.
- */
-public interface IReadmeFileParser {
-/**
- * Parses the contents of the provided file
- * and generates a collection of sections.
- */
-public MarkElement[] parse(IFile readmeFile);
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java
deleted file mode 100644
index e611e8ea725..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElement.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.model.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import java.util.Iterator;
-import java.util.Vector;
-
-/**
- * This class represents a marked location in the Readme
- * file text.
- *
- * TIP: By implementing the <code>IWorkbenchAdapter</code> interface,
- * we can easily add objects of this type to viewers and parts in
- * the workbench. When a viewer contains <code>IWorkbenchAdapter</code>,
- * the generic <code>WorkbenchContentProvider</code> and
- * <code>WorkbenchLabelProvider</code> can be used to provide
- * navigation and display for that viewer.
- */
-public class MarkElement implements IWorkbenchAdapter,IAdaptable {
- private String headingName;
- private IAdaptable parent;
- private int offset;
- private int numberOfLines;
- private int length;
- private Vector children;
-/**
- * Creates a new MarkElement and stores parent element and
- * location in the text.
- *
- * @param parent the parent of this element
- * @param heading text corresponding to the heading
- * @param offset the offset into the Readme text
- * @param length the length of the element
- */
-public MarkElement(IAdaptable parent, String heading, int offset, int length) {
- this.parent = parent;
- if (parent instanceof MarkElement) {
- ((MarkElement)parent).addChild(this);
- }
- this.headingName = heading;
- this.offset = offset;
- this.length = length;
-}
-/**
- * Adds a child to this element
- */
-private void addChild(MarkElement child) {
- if (children == null) {
- children = new Vector();
- }
- children.add(child);
-}
-/* (non-Javadoc)
- * Method declared on IAdaptable
- */
-public Object getAdapter(Class adapter) {
- if (adapter == IWorkbenchAdapter.class)
- return this;
- if (adapter == IPropertySource.class)
- return new MarkElementProperties(this);
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object[] getChildren(Object object) {
- if (children != null) {
- return children.toArray();
- }
- return new Object[0];
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public ImageDescriptor getImageDescriptor(Object object) {
- IWorkbenchAdapter parentElement = (IWorkbenchAdapter)parent.getAdapter(IWorkbenchAdapter.class);
- if (parentElement != null) {
- return parentElement.getImageDescriptor(object);
- }
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public String getLabel(Object o) {
- return headingName;
-}
-/**
- * Returns the number of characters in this section.
- */
-public int getLength() {
- return length;
-}
-/**
- * Returns the number of lines in the element.
- *
- * @return the number of lines in the element
- */
-public int getNumberOfLines() {
- return numberOfLines;
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchAdapter
- */
-public Object getParent(Object o) {
- return null;
-}
-/**
- * Returns the offset of this section in the file.
- */
-public int getStart() {
- return offset;
-}
-/**
- * Sets the number of lines in the element
- *
- * @param newNumberOfLines the number of lines in the element
- */
-public void setNumberOfLines(int newNumberOfLines) {
- numberOfLines = newNumberOfLines;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java
deleted file mode 100644
index 7120ae890f7..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MarkElementProperties.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.views.properties.*;
-import org.eclipse.ui.views.properties.*;
-import java.util.List;
-import java.util.Vector;
-
-/**
- * This class encapsulates property sheet properties
- * for MarkElement. This will display properties for
- * the MarkElement when selected in the readme editor's
- * content outline.
- */
-public class MarkElementProperties implements IPropertySource {
- protected MarkElement element;
-
- protected static final String PROPERTY_LINECOUNT = "lineno"; //$NON-NLS-1$
- protected static final String PROPERTY_START = "start"; //$NON-NLS-1$
- protected static final String PROPERTY_LENGTH = "length"; //$NON-NLS-1$
-/**
- * Creates a new MarkElementProperties.
- *
- * @param element the element whose properties this instance represents
- */
-public MarkElementProperties(MarkElement element) {
- super();
- this.element = element;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getEditableValue() {
- return this;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public IPropertyDescriptor[] getPropertyDescriptors() {
- // Create the property vector.
- IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[3];
-
- // Add each property supported.
- PropertyDescriptor descriptor;
-
- descriptor = new PropertyDescriptor(PROPERTY_LINECOUNT, MessageUtil.getString("Line_count")); //$NON-NLS-1$
- propertyDescriptors[0] = descriptor;
- descriptor = new PropertyDescriptor(PROPERTY_START, MessageUtil.getString("Title_start")); //$NON-NLS-1$
- propertyDescriptors[1] = descriptor;
- descriptor = new PropertyDescriptor(PROPERTY_LENGTH, MessageUtil.getString("Title_length")); //$NON-NLS-1$
- propertyDescriptors[2] = descriptor;
-
- // Return it.
- return propertyDescriptors;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public Object getPropertyValue(Object name) {
- if (name.equals(PROPERTY_LINECOUNT))
- return new Integer(element.getNumberOfLines());
- if (name.equals(PROPERTY_START))
- return new Integer(element.getStart());
- if (name.equals(PROPERTY_LENGTH))
- return new Integer(element.getLength());
- return null;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public boolean isPropertySet(Object property) {
- return false;
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void resetPropertyValue(Object property) {
-}
-/* (non-Javadoc)
- * Method declared on IPropertySource
- */
-public void setPropertyValue(Object name, Object value) {
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java
deleted file mode 100644
index 75d181563c9..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/MessageUtil.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.ui.examples.readmetool;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps with managing messages.
- */
-/* package */ class MessageUtil {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.examples.readmetool.messages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private MessageUtil() {
- // prevent instantiation of class
- }
-
- /**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
- public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key),args);
- }
-
- /**
- * Returns the resource object with the given key in
- * the resource bundle. If there isn't any value under
- * the given key, the key is returned, surrounded by '!'s.
- *
- * @param key the resource name
- * @return the string
- */
- 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/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java
deleted file mode 100644
index d9e53d12bbd..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/PopupMenuActionDelegate.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Action delegate for handling popup menu actions on a readme file.
- */
-public class PopupMenuActionDelegate implements IObjectActionDelegate {
-
- private IWorkbenchPart part;
-/** (non-Javadoc)
- * Method declared on IDropActionDelegate
- */
-public void run(IAction action) {
- MessageDialog.openInformation(
- this.part.getSite().getShell(),
- MessageUtil.getString("Readme_Example"), //$NON-NLS-1$
- MessageUtil.getString("Popup_Menu_Action_executed")); //$NON-NLS-1$
-}
-/** (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void selectionChanged(IAction action, ISelection selection) {
- //Ignored for this example
-}
-/** (non-Javadoc)
- * Method declared on IObjectActionDelegate
- */
-public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.part = targetPart;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java
deleted file mode 100644
index fbd6b46e9f9..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlineDragListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.part.PluginTransferData;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.dnd.*;
-
-/**
- * A drag listener for the readme editor's content outline page.
- * Allows dragging of content segments into views that support
- * the <code>TextTransfer</code> or <code>PluginTransfer</code> transfer types.
- */
-public class ReadmeContentOutlineDragListener extends DragSourceAdapter {
- private ReadmeContentOutlinePage page;
-/**
- * Creates a new drag listener for the given page.
- */
-public ReadmeContentOutlineDragListener(ReadmeContentOutlinePage page) {
- this.page = page;
-}
-/* (non-Javadoc)
- * Method declared on DragSourceListener
- */
-public void dragSetData(DragSourceEvent event) {
- if (PluginTransfer.getInstance().isSupportedType(event.dataType)) {
- byte[] segmentData = getSegmentText().getBytes();
- event.data = new PluginTransferData(ReadmeDropActionDelegate.ID, segmentData);
- return;
- }
- if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
- event.data = getSegmentText();
- return;
- }
-}
-/**
- * Returns the text of the currently selected readme segment.
- */
-private String getSegmentText() {
- StringBuffer result = new StringBuffer();
- ISelection selection = page.getSelection();
- if (selection instanceof org.eclipse.jface.viewers.IStructuredSelection) {
- Object[] selected = ((IStructuredSelection) selection).toArray();
- result.append("\n"); //$NON-NLS-1$
- for (int i = 0; i < selected.length; i++) {
- if (selected[i] instanceof MarkElement) {
- result.append(((MarkElement) selected[i]).getLabel(selected[i]));
- result.append("\n"); //$NON-NLS-1$
- }
- }
- }
- return result.toString();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java
deleted file mode 100644
index 7853c22b2a7..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeContentOutlinePage.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.resources.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.model.*;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.views.contentoutline.*;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * Content outline page for the readme editor.
- */
-public class ReadmeContentOutlinePage extends ContentOutlinePage {
- protected IFile input;
-
- class OutlineAction extends Action {
- private Shell shell;
- public OutlineAction(String label) {
- super(label);
- getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- setEnabled(!event.getSelection().isEmpty());
- }
- });
- }
- public void setShell(Shell shell) {
- this.shell = shell;
- }
- public void run() {
- MessageDialog.openInformation(shell,
- MessageUtil.getString("Readme_Outline"), //$NON-NLS-1$
- MessageUtil.getString("ReadmeOutlineActionExecuted")); //$NON-NLS-1$
- }
- }
-
-/**
- * Creates a new ReadmeContentOutlinePage.
- */
-public ReadmeContentOutlinePage(IFile input) {
- super();
- this.input = input;
-}
-/**
- * Creates the control and registers the popup menu for this page
- * Menu id "org.eclipse.ui.examples.readmetool.outline"
- */
-public void createControl(Composite parent) {
- super.createControl(parent);
-
- WorkbenchHelp.setHelp(getControl(), IReadmeConstants.CONTENT_OUTLINE_PAGE_CONTEXT);
-
- TreeViewer viewer = getTreeViewer();
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
- viewer.setInput(getContentOutline(input));
- initDragAndDrop();
-
- // Configure the context menu.
- MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end")); //$NON-NLS-1$
-
- Menu menu = menuMgr.createContextMenu(viewer.getTree());
- viewer.getTree().setMenu(menu);
- // Be sure to register it so that other plug-ins can add actions.
- getSite().registerContextMenu("org.eclipse.ui.examples.readmetool.outline", menuMgr, viewer); //$NON-NLS-1$
-
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.RETARGET2,
- new OutlineAction(MessageUtil.getString("Outline_Action2"))); //$NON-NLS-1$
-
- OutlineAction action = new OutlineAction(MessageUtil.getString("Outline_Action3")); //$NON-NLS-1$
- action.setToolTipText(MessageUtil.getString("Readme_Outline_Action3")); //$NON-NLS-1$
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.LABELRETARGET3,
- action);
- action = new OutlineAction(MessageUtil.getString("Outline_Action4")); //$NON-NLS-1$
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.ACTION_SET_RETARGET4,
- action);
- action = new OutlineAction(MessageUtil.getString("Outline_Action5")); //$NON-NLS-1$
- action.setToolTipText(MessageUtil.getString("Readme_Outline_Action5")); //$NON-NLS-1$
- getSite().getActionBars().setGlobalActionHandler(
- IReadmeConstants.ACTION_SET_LABELRETARGET5,
- action);
-}
-/**
- * Gets the content outline for a given input element.
- * Returns the outline (a list of MarkElements), or null
- * if the outline could not be generated.
- */
-private IAdaptable getContentOutline(IAdaptable input) {
- return ReadmeModelFactory.getInstance().getContentOutline(input);
-}
-/**
- * Initializes drag and drop for this content outline page.
- */
-private void initDragAndDrop() {
- int ops = DND.DROP_COPY | DND.DROP_MOVE;
- Transfer[] transfers = new Transfer[] {TextTransfer.getInstance(), PluginTransfer.getInstance()};
- getTreeViewer().addDragSupport(ops, transfers, new ReadmeContentOutlineDragListener(this));
-}
-/**
- * Forces the page to update its contents.
- *
- * @see ReadmeEditor#doSave(IProgressMonitor)
- */
-public void update() {
- getControl().setRedraw(false);
- getTreeViewer().setInput(getContentOutline(input));
- getTreeViewer().expandAll();
- getControl().setRedraw(true);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java
deleted file mode 100644
index bc346671b5a..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationPage.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.*;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.io.*;
-
-/**
- * This class is the only page of the Readme file resource creation wizard.
- * It subclasses the standard file resource creation page class,
- * and consequently inherits the file resource creation functionality.
- *
- * This page provides users with the choice of creating sample headings for
- * sections and subsections. Additionally, the option is presented to open
- * the file immediately for editing after creation.
- */
-public class ReadmeCreationPage extends WizardNewFileCreationPage {
- private IWorkbench workbench;
-
- // widgets
- private Button sectionCheckbox;
- private Button subsectionCheckbox;
- private Button openFileCheckbox;
-
- // constants
- private static int nameCounter = 1;
-/**
- * Creates the page for the readme creation wizard.
- *
- * @param workbench the workbench on which the page should be created
- * @param selection the current selection
- */
-public ReadmeCreationPage(IWorkbench workbench, IStructuredSelection selection) {
- super("sampleCreateReadmePage1", selection); //$NON-NLS-1$
- this.setTitle(MessageUtil.getString("Create_Readme_File")); //$NON-NLS-1$
- this.setDescription(MessageUtil.getString("Create_a_new_Readme_file_resource")); //$NON-NLS-1$
- this.workbench = workbench;
-}
-/** (non-Javadoc)
- * Method declared on IDialogPage.
- */
-public void createControl(Composite parent) {
- // inherit default container and name specification widgets
- super.createControl(parent);
- Composite composite = (Composite)getControl();
-
- WorkbenchHelp.setHelp(composite, IReadmeConstants.CREATION_WIZARD_PAGE_CONTEXT);
-
- GridData data = (GridData)composite.getLayoutData();
- this.setFileName("sample" + nameCounter + ".readme"); //$NON-NLS-1$ //$NON-NLS-2$
-
- new Label(composite,SWT.NONE); // vertical spacer
-
- // sample section generation group
- Group group = new Group(composite,SWT.NONE);
- group.setLayout(new GridLayout());
- group.setText(MessageUtil.getString("Automatic_sample_section_generation")); //$NON-NLS-1$
- group.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
-
- // sample section generation checkboxes
- sectionCheckbox = new Button(group,SWT.CHECK);
- sectionCheckbox.setText(MessageUtil.getString("Generate_sample_section_titles")); //$NON-NLS-1$
- sectionCheckbox.setSelection(true);
- sectionCheckbox.addListener(SWT.Selection,this);
-
- subsectionCheckbox = new Button(group,SWT.CHECK);
- subsectionCheckbox.setText(MessageUtil.getString("Generate_sample_subsection_titles")); //$NON-NLS-1$
- subsectionCheckbox.setSelection(true);
- subsectionCheckbox.addListener(SWT.Selection,this);
-
- new Label(composite,SWT.NONE); // vertical spacer
-
- // open file for editing checkbox
- openFileCheckbox = new Button(composite,SWT.CHECK);
- openFileCheckbox.setText(MessageUtil.getString("Open_file_for_editing_when_done")); //$NON-NLS-1$
- openFileCheckbox.setSelection(true);
-
- setPageComplete(validatePage());
-
-}
-/**
- * Creates a new file resource as requested by the user. If everything
- * is OK then answer true. If not, false will cause the dialog
- * to stay open.
- *
- * @return whether creation was successful
- * @see ReadmeCreationWizard#performFinish()
- */
-public boolean finish() {
- // create the new file resource
- IFile newFile = createNewFile();
- if (newFile == null)
- return false; // ie.- creation was unsuccessful
-
- // Since the file resource was created fine, open it for editing
- // if requested by the user
- try {
- if (openFileCheckbox.getSelection()) {
- IWorkbenchWindow dwindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = dwindow.getActivePage();
- if (page != null)
- page.openEditor(newFile);
- }
- } catch (PartInitException e) {
- e.printStackTrace();
- return false;
- }
- nameCounter++;
- return true;
-}
-/**
- * The <code>ReadmeCreationPage</code> implementation of this
- * <code>WizardNewFileCreationPage</code> method
- * generates sample headings for sections and subsections in the
- * newly-created Readme file according to the selections of self's
- * checkbox widgets
- */
-protected InputStream getInitialContents() {
- if (!sectionCheckbox.getSelection())
- return null;
-
- StringBuffer sb = new StringBuffer();
- sb.append(MessageUtil.getString("SAMPLE_README_FILE")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_1_BODY_1")); //$NON-NLS-1$
-
- if (subsectionCheckbox.getSelection()) {
- sb.append(MessageUtil.getString("Subsection_1_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_1_1_Body_1")); //$NON-NLS-1$
- }
-
- sb.append(MessageUtil.getString("SECTION_2")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_2_BODY_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("SECTION_2_BODY_2")); //$NON-NLS-1$
-
- if (subsectionCheckbox.getSelection()) {
- sb.append(MessageUtil.getString("Subsection_2_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_2_1_BODY_1")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_2_2")); //$NON-NLS-1$
- sb.append(MessageUtil.getString("Subsection_2_2_BODY_1")); //$NON-NLS-1$
- }
-
- return new ByteArrayInputStream(sb.toString().getBytes());
-}
-/** (non-Javadoc)
- * Method declared on WizardNewFileCreationPage.
- */
-protected String getNewFileLabel() {
- return MessageUtil.getString("Readme_file_name"); //$NON-NLS-1$
-}
-/** (non-Javadoc)
- * Method declared on WizardNewFileCreationPage.
- */
-public void handleEvent(Event e) {
- Widget source = e.widget;
-
- if (source == sectionCheckbox) {
- if (!sectionCheckbox.getSelection())
- subsectionCheckbox.setSelection(false);
- subsectionCheckbox.setEnabled(sectionCheckbox.getSelection());
- }
-
- super.handleEvent(e);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java
deleted file mode 100644
index d06fa2a5054..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeCreationWizard.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-
-/**
- * This class implements the interface required by the desktop
- * for all 'New' wizards. This wizard creates readme files.
- */
-public class ReadmeCreationWizard extends Wizard implements INewWizard {
- private IStructuredSelection selection;
- private IWorkbench workbench;
- private ReadmeCreationPage mainPage;
-/** (non-Javadoc)
- * Method declared on Wizard.
- */
-public void addPages() {
- mainPage = new ReadmeCreationPage(workbench, selection);
- addPage(mainPage);
-}
-/** (non-Javadoc)
- * Method declared on INewWizard
- */
-public void init(IWorkbench workbench,IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(MessageUtil.getString("New_Readme_File")); //$NON-NLS-1$
- setDefaultPageImageDescriptor(ReadmeImages.README_WIZARD_BANNER);
-}
-/** (non-Javadoc)
- * Method declared on IWizard
- */
-public boolean performFinish() {
- return mainPage.finish();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java
deleted file mode 100644
index 0919590f845..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeDropActionDelegate.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.part.IDropActionDelegate;
-import java.io.ByteArrayInputStream;
-
-/**
- * Adapter for handling the dropping of readme segments into
- * another plugin. In this case, we expect the segments
- * to be dropped onto <code>IFile</code> object, or an adapter
- * that supports <code>IFile</code>.
- */
-public class ReadmeDropActionDelegate implements IDropActionDelegate {
- public static final String ID = "org_eclipse_ui_examples_readmetool_drop_actions"; //$NON-NLS-1$
-/** (non-Javadoc)
- * Method declared on IDropActionDelegate
- */
-public boolean run(Object source, Object target) {
- if (source instanceof byte[] && target instanceof IFile) {
- IFile file = (IFile)target;
- try {
- file.appendContents(new ByteArrayInputStream((byte[])source), false, true, null);
- } catch (CoreException e) {
- System.out.println(MessageUtil.getString("Exception_in_readme_drop_adapter") + e.getStatus().getMessage()); //$NON-NLS-1$
- return false;
- }
- return true;
- }
- return false;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java
deleted file mode 100644
index 9b7e52dbb18..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditor.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-
-/**
- * This class implements the Readme editor. Since the readme
- * editor is mostly just a text editor, there is very little
- * implemented in this actual class. It can be regarded as
- * simply decorating the text editor with a content outline.
- */
-public class ReadmeEditor extends TextEditor {
- protected ReadmeContentOutlinePage page;
-
- private final static String ATT_1 = IReadmeConstants.PREFIX + "attribute1"; //$NON-NLS-1$
- private final static String ATT_2 = IReadmeConstants.PREFIX + "attribute2"; //$NON-NLS-1$
- private final static String ATT_3 = IReadmeConstants.PREFIX + "attribute3"; //$NON-NLS-1$
- private final static String ATT_4 = IReadmeConstants.PREFIX + "attribute4"; //$NON-NLS-1$
- private final static String ATT_5 = IReadmeConstants.PREFIX + "attribute5"; //$NON-NLS-1$
-
- /**
- * Creates a new ReadmeEditor.
- */
- public ReadmeEditor() {
- super();
- }
- /** (non-Javadoc)
- * Method declared on IEditorPart
- */
- public void doSave(IProgressMonitor monitor) {
- super.doSave(monitor);
- if (page != null)
- page.update();
- }
- /** (non-Javadoc)
- * Method declared on IAdaptable
- */
- public Object getAdapter(Class key) {
- if (key.equals(IContentOutlinePage.class)) {
- IEditorInput input = getEditorInput();
- if (input instanceof IFileEditorInput) {
- page = new ReadmeContentOutlinePage(((IFileEditorInput)input).getFile());
- return page;
- }
- }
- return super.getAdapter(key);
- }
-
- /** (non-Javadoc)
- * Method declared on AbstractTextEditor
- */
- protected void editorContextMenuAboutToShow(IMenuManager parentMenu) {
- super.editorContextMenuAboutToShow(parentMenu);
- parentMenu.add(new Separator());
- IMenuManager subMenu = new MenuManager(MessageUtil.getString("Add"));
- parentMenu.add(subMenu);
- if (subMenu != null) {
- // Add readme actions with various attributes
- Object[][] att = new Object[][] {{IReadmeConstants.MARKER_ATT_ID, new Integer(1234)}};
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "1", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " id=1234")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_LEVEL, new Integer(7)}};
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "2", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " level=7")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_LEVEL, new Integer(7)},
- {IReadmeConstants.MARKER_ATT_DEPT, "infra"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "3", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " level=7, department=infra")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_CODE, "red"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "4", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " code=red")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_LANG, "english"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "5", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " language=english")); //$NON-NLS-1$ //$NON-NLS-2$
-
- att = new Object[][] {{IReadmeConstants.MARKER_ATT_ID, new Integer(1234)},
- {IReadmeConstants.MARKER_ATT_LEVEL, new Integer(7)},
- {IReadmeConstants.MARKER_ATT_DEPT, "infra"}, //$NON-NLS-1$
- {IReadmeConstants.MARKER_ATT_CODE, "red"}, //$NON-NLS-1$
- {IReadmeConstants.MARKER_ATT_LANG, "english"}}; //$NON-NLS-1$
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "6", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + //$NON-NLS-1$
- " id=1234, level=7, department=infra, code=red, language=english")); //$NON-NLS-1$
-
- att = new Object[0][0];
- subMenu.add(new AddReadmeMarkerAction(this,
- MessageUtil.getString("Add_readme_marker_action_label") + "7", //$NON-NLS-1$ //$NON-NLS-2$
- att,
- MessageUtil.getString("Readme_marker_message_example") + " No attributes specified")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java
deleted file mode 100644
index 7b11af96d18..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeEditorActionBarContributor.java
+++ /dev/null
@@ -1,185 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.ui.*;
-import org.eclipse.ui.actions.LabelRetargetAction;
-import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.action.ControlContribution;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
-
-/**
- * This class demonstrates action contribution for the readme editor.
- * A number of menu, toolbar, and status line contributions are defined
- * in the workbench window. These actions are shared among all
- * readme editors, and are only visible when a readme editor is
- * active. Otherwise, they are invisible.
- */
-public class ReadmeEditorActionBarContributor extends BasicTextEditorActionContributor
-{
- private EditorAction action1;
- private RetargetAction action2;
- private LabelRetargetAction action3;
- private EditorAction handler2;
- private EditorAction handler3;
- private EditorAction handler4;
- private EditorAction handler5;
- private DirtyStateContribution dirtyStateContribution;
-
- class EditorAction extends Action {
- private Shell shell;
- private IEditorPart activeEditor;
- public EditorAction(String label) {
- super(label);
- }
- public void setShell(Shell shell) {
- this.shell = shell;
- }
- public void run() {
- String editorName = MessageUtil.getString("Empty_Editor_Name"); //$NON-NLS-1$
- if (activeEditor != null)
- editorName = activeEditor.getTitle();
- MessageDialog.openInformation(shell,
- MessageUtil.getString("Readme_Editor"), //$NON-NLS-1$
- MessageUtil.format("ReadmeEditorActionExecuted", new Object[] {getText(), editorName})); //$NON-NLS-1$
- }
- public void setActiveEditor(IEditorPart part) {
- activeEditor = part;
- }
- }
-/**
- * Creates a new ReadmeEditorActionBarContributor.
- */
-public ReadmeEditorActionBarContributor() {
- ImageRegistry registry = ReadmePlugin.getDefault().getImageRegistry();
- action1 = new EditorAction(MessageUtil.getString("Editor_Action1")); //$NON-NLS-1$
- action1.setToolTipText(MessageUtil.getString("Readme_Editor_Action1")); //$NON-NLS-1$
- action1.setDisabledImageDescriptor(ReadmeImages.EDITOR_ACTION1_IMAGE_DISABLE);
- action1.setImageDescriptor(ReadmeImages.EDITOR_ACTION1_IMAGE_ENABLE);
- action1.setHoverImageDescriptor(ReadmeImages.EDITOR_ACTION1_IMAGE);
- WorkbenchHelp.setHelp(action1, IReadmeConstants.EDITOR_ACTION1_CONTEXT);
-
- action2 = new RetargetAction(IReadmeConstants.RETARGET2, MessageUtil.getString("Editor_Action2")); //$NON-NLS-1$
- action2.setToolTipText(MessageUtil.getString("Readme_Editor_Action2")); //$NON-NLS-1$
- action2.setDisabledImageDescriptor(ReadmeImages.EDITOR_ACTION2_IMAGE_DISABLE);
- action2.setImageDescriptor(ReadmeImages.EDITOR_ACTION2_IMAGE_ENABLE);
- action2.setHoverImageDescriptor(ReadmeImages.EDITOR_ACTION2_IMAGE);
-
- action3 = new LabelRetargetAction(IReadmeConstants.LABELRETARGET3, MessageUtil.getString("Editor_Action3")); //$NON-NLS-1$
- action3.setDisabledImageDescriptor(ReadmeImages.EDITOR_ACTION3_IMAGE_DISABLE);
- action3.setImageDescriptor(ReadmeImages.EDITOR_ACTION3_IMAGE_ENABLE);
- action3.setHoverImageDescriptor(ReadmeImages.EDITOR_ACTION3_IMAGE);
-
- handler2 = new EditorAction(MessageUtil.getString("Editor_Action2")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(action2, IReadmeConstants.EDITOR_ACTION2_CONTEXT);
-
- handler3 = new EditorAction(MessageUtil.getString("Editor_Action3")); //$NON-NLS-1$
- handler3.setToolTipText(MessageUtil.getString("Readme_Editor_Action3")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(action3, IReadmeConstants.EDITOR_ACTION3_CONTEXT);
-
- handler4 = new EditorAction(MessageUtil.getString("Editor_Action4")); //$NON-NLS-1$
- handler5 = new EditorAction(MessageUtil.getString("Editor_Action5")); //$NON-NLS-1$
- handler5.setToolTipText(MessageUtil.getString("Readme_Editor_Action5")); //$NON-NLS-1$
-
- dirtyStateContribution = new DirtyStateContribution();
-}
-/** (non-Javadoc)
- * Method declared on EditorActionBarContributor
- */
-public void contributeToMenu(IMenuManager menuManager) {
- // Run super.
- super.contributeToMenu(menuManager);
-
- // Editor-specitic menu
- MenuManager readmeMenu = new MenuManager(MessageUtil.getString("Readme_Menu")); //$NON-NLS-1$
- // It is important to append the menu to the
- // group "additions". This group is created
- // between "Project" and "Tools" menus
- // for this purpose.
- menuManager.insertAfter("additions", readmeMenu); //$NON-NLS-1$
- readmeMenu.add(action1);
- readmeMenu.add(action2);
- readmeMenu.add(action3);
-}
-/** (non-Javadoc)
- * Method declared on EditorActionBarContributor
- */
-public void contributeToStatusLine(IStatusLineManager statusLineManager) {
- // Run super.
- super.contributeToStatusLine(statusLineManager);
- // Test status line.
- statusLineManager.setMessage(MessageUtil.getString("Editor_is_active")); //$NON-NLS-1$
- statusLineManager.add(dirtyStateContribution);
-}
-
-/** (non-Javadoc)
- * Method declared on EditorActionBarContributor
- */
-public void contributeToToolBar(IToolBarManager toolBarManager) {
- // Run super.
- super.contributeToToolBar(toolBarManager);
-
- // Add toolbar stuff.
- toolBarManager.add(new Separator("ReadmeEditor")); //$NON-NLS-1$
- toolBarManager.add(action1);
- toolBarManager.add(action2);
- toolBarManager.add(action3);
-}
-/** (non-Javadoc)
- * Method declared on IEditorActionBarContributor
- */
-public void dispose() {
- // Remove retarget actions as page listeners
- getPage().removePartListener(action2);
- getPage().removePartListener(action3);
-}
-
-/** (non-Javadoc)
- * Method declared on IEditorActionBarContributor
- */
-public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- bars.setGlobalActionHandler(IReadmeConstants.RETARGET2, handler2);
- bars.setGlobalActionHandler(IReadmeConstants.LABELRETARGET3, handler3);
- bars.setGlobalActionHandler(IReadmeConstants.ACTION_SET_RETARGET4, handler4);
- bars.setGlobalActionHandler(IReadmeConstants.ACTION_SET_LABELRETARGET5, handler5);
-
- // Hook retarget actions as page listeners
- page.addPartListener(action2);
- page.addPartListener(action3);
- IWorkbenchPart activePart = page.getActivePart();
- if (activePart != null) {
- action2.partActivated(activePart);
- action3.partActivated(activePart);
- }
-}
-
-/** (non-Javadoc)
- * Method declared on IEditorActionBarContributor
- */
-public void setActiveEditor(IEditorPart editor) {
- // Run super.
- super.setActiveEditor(editor);
-
- // Target shared actions to new editor
- action1.setActiveEditor(editor);
- handler2.setActiveEditor(editor);
- handler3.setActiveEditor(editor);
- handler4.setActiveEditor(editor);
- handler5.setActiveEditor(editor);
- dirtyStateContribution.editorChanged(editor);
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java
deleted file mode 100644
index fc6c558b9a2..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage.java
+++ /dev/null
@@ -1,171 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.help.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.io.*;
-
-/**
- * This page will be added to the property page dialog
- * when the "Properties..." popup menu item is selected
- * for Readme files.
- */
-public class ReadmeFilePropertyPage extends PropertyPage {
-
-/**
- * Utility method that creates a new composite and
- * sets up its layout data.
- *
- * @param parent the parent of the composite
- * @param numColumns the number of columns in the new composite
- * @return the newly-created composite
- */
-protected Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public Control createContents(Composite parent) {
-
- // ensure the page has no special buttons
- noDefaultAndApplyButton();
- Composite panel = createComposite(parent, 2);
-
- WorkbenchHelp.setHelp(panel, IReadmeConstants.PROPERTY_PAGE_CONTEXT);
-
- // layout the page
-
- IResource resource = (IResource) getElement();
- IStatus result = null;
- if (resource.getType() == IResource.FILE) {
- Label l = createLabel(panel, MessageUtil.getString("File_name")); //$NON-NLS-1$
- l = createLabel(panel, resource.getName());
- grabExcessSpace(l);
-
- //
- createLabel(panel, MessageUtil.getString("Path")); //$NON-NLS-1$
- l = createLabel(panel, resource.getFullPath().setDevice(null).toString());
- grabExcessSpace(l);
-
- //
- createLabel(panel, MessageUtil.getString("Size")); //$NON-NLS-1$
- InputStream contentStream = null;
- try {
- IFile file = (IFile) resource;
- if (!file.isLocal(IResource.DEPTH_ZERO))
- l = createLabel(panel,MessageUtil.getString("<file_contents_not_local>")); //$NON-NLS-1$
- else {
- contentStream = file.getContents();
- Reader in = new InputStreamReader(contentStream);
- int chunkSize = contentStream.available();
- StringBuffer buffer = new StringBuffer(chunkSize);
- char[] readBuffer = new char[chunkSize];
- int n = in.read(readBuffer);
-
- while (n > 0) {
- buffer.append(readBuffer);
- n = in.read(readBuffer);
- }
-
- contentStream.close();
- l = createLabel(panel, Integer.toString(buffer.length()));
- }
- } catch (CoreException e) {
- result = e.getStatus();
- String message = result.getMessage();
- if (message == null)
- l = createLabel(panel, MessageUtil.getString("<Unknown>")); //$NON-NLS-1$
- else
- l = createLabel(panel, message);
- } catch (IOException e) {
- l = createLabel(panel, MessageUtil.getString("<Unknown>")); //$NON-NLS-1$
- } finally {
- if (contentStream != null) {
- try {
- contentStream.close();
- } catch (IOException e) {
- }
- }
- }
- grabExcessSpace(l);
- createLabel(panel, MessageUtil.getString("Number_of_sections")); //$NON-NLS-1$
- // We will get the sections property and simply
- // report number of elements found.
- IAdaptable sections = getSections(resource);
- if (sections instanceof AdaptableList) {
- AdaptableList list = (AdaptableList)sections;
- l = createLabel(panel, String.valueOf(list.size()));
- grabExcessSpace(l);
- }
- }
-
- //
- Label l = createLabel(panel, MessageUtil.getString("Additional_information")); //$NON-NLS-1$
- grabExcessSpace(l);
- GridData gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- return new Canvas(panel, 0);
-}
-/**
- * Utility method that creates a new label and sets up its layout data.
- *
- * @param parent the parent of the label
- * @param text the text of the label
- * @return the newly-created label
- */
-protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
-}
-/**
- * Returns the readme sections for this resource, or null
- * if not applicable (resource is not a readme file).
- */
-private AdaptableList getSections(IAdaptable adaptable) {
- if (adaptable instanceof IFile)
- return ReadmeModelFactory.getInstance().getSections((IFile)adaptable);
- else
- return null;
-}
-/**
- * Sets this control to grab any excess horizontal space
- * left in the window.
- *
- * @param control the control for which to grab excess space
- */
-private void grabExcessSpace(Control control) {
- GridData gd = (GridData) control.getLayoutData();
- if (gd != null) {
- gd.grabExcessHorizontalSpace = true;
- }
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public boolean performOk() {
- // nothing to do - read-only page
- return true;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java
deleted file mode 100644
index b2f0aaa4258..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeFilePropertyPage2.java
+++ /dev/null
@@ -1,203 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.help.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.io.*;
-
-/**
- * This page will be added to the property page dialog
- * when "Properties..." popup menu item is selected
- * for Readme files.
- *
- * This page demonstrates conditional property pages which look
- * different depending on the state of the element. In this example,
- * the arbitrary condition chosen is whether the Readme file is
- * greater than 256 bytes in length. If it is smaller than 256 bytes
- * in length, this will be a placeholder page containing
- * a simple message. If it is 256 bytes or larger, additional
- * information will be provided. This information is determined at
- * runtime.
- *
- * This class may be reused to implement a conditional property page.
- * The getPageIndex() method tests the condition and returns the
- * index of the page to create. The createPage*() methods are called
- * upon to create the actual pages.
- */
-public class ReadmeFilePropertyPage2 extends PropertyPage {
-
-/**
- * Utility method that creates a new composite and
- * sets up its layout data.
- *
- * @param parent the parent of the composite
- * @param numColumns the number of columns in the new composite
- * @return the newly-created composite
- */
-protected Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public Control createContents(Composite parent) {
- // ensure the page has no special buttons
- noDefaultAndApplyButton();
- Composite panel = createComposite(parent, 2);
-
- WorkbenchHelp.setHelp(panel, IReadmeConstants.PROPERTY_PAGE2_CONTEXT);
-
- // layout the page
- int page = getPageIndex();
- switch (page) {
- case 1:
- createPageOne(panel);
- break;
- case 2:
- createPageTwo(panel);
- break;
- default:
- }
- return new Canvas(panel, 0);
-}
-/**
- * Utility method that creates a new label and sets up
- * its layout data.
- *
- * @param parent the parent of the label
- * @param text the text of the label
- * @return the newly-created label
- */
-protected Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
-}
-/**
- * Creates the first version of the page. This is a placeholder page which
- * notified the user that the page is not available.
- *
- * @param panel the panel in which to create the page
- */
-protected void createPageOne(Composite panel) {
- Label l = createLabel(panel, MessageUtil.getString("Additional_Readme_properties_not_available.")); //$NON-NLS-1$
- GridData gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("This_illustrates_a_property_page_that_is_dynamically_determined")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("not_to_be_available_based_on_the_state_of_the_object.")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
-}
-/**
- * Creates the second version of the page. This page might contain more information
- * about the file or other information.
- *
- * @param panel the panel in which to create the page
- */
-protected void createPageTwo(Composite panel) {
- Label l = createLabel(panel, MessageUtil.getString("The_size_of_the_Readme_file_is_at_least_256_bytes.")); //$NON-NLS-1$
- GridData gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("Had_it_been_less_than_256_bytes_this_page_would_be_a_placeholder_page.")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("Additional_information")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("This_illustrates_a_property_page_that_is_dynamically_determined")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
- l = createLabel(panel, MessageUtil.getString("to_be_available_based_on_the_state_of_the_object.")); //$NON-NLS-1$
- gd = (GridData) l.getLayoutData();
- gd.horizontalSpan = 2;
- gd.grabExcessHorizontalSpace = true;
-}
-/**
- * Returns which page to display. This implementation
- * answers 1 if the size of the Readme file is less than 256 bytes
- * and 2 otherwise.
- *
- * @return the index of the page to display
- */
-protected int getPageIndex() {
- IResource resource = (IResource) getElement();
-
- if (resource.getType() == IResource.FILE) {
- InputStream contentStream = null;
- int length = 0;
- try {
- IFile file = (IFile) resource;
-
- if (file.isLocal(IResource.DEPTH_ZERO)) {
- contentStream = file.getContents();
- Reader in = new InputStreamReader(contentStream);
- int chunkSize = contentStream.available();
- StringBuffer buffer = new StringBuffer(chunkSize);
- char[] readBuffer = new char[chunkSize];
- int n = in.read(readBuffer);
-
- while (n > 0) {
- buffer.append(readBuffer);
- n = in.read(readBuffer);
- }
-
- contentStream.close();
- length = buffer.length();
- }
- } catch (CoreException e) {
- length = 0;
- } catch (IOException e) {
- } finally {
- if (contentStream != null) {
- try {
- contentStream.close();
- } catch (IOException e) {
- }
- }
- }
-
- if (length < 256)
- return 1;
- else
- return 2;
- }
-
- return 0;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-public boolean performOk() {
- // nothing to do - read-only page
- return true;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java
deleted file mode 100644
index 7fd5baa71f4..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeImages.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Display;
-import java.net.MalformedURLException;
-import java.net.URL;
-/**
- * Convenience class for storing references to image descriptors
- * used by the readme tool.
- */
-public class ReadmeImages {
- static final URL BASE_URL = ReadmePlugin.getDefault().getDescriptor().getInstallURL();
- static final ImageDescriptor EDITOR_ACTION1_IMAGE;
- static final ImageDescriptor EDITOR_ACTION2_IMAGE;
- static final ImageDescriptor EDITOR_ACTION3_IMAGE;
- static final ImageDescriptor EDITOR_ACTION1_IMAGE_DISABLE;
- static final ImageDescriptor EDITOR_ACTION2_IMAGE_DISABLE;
- static final ImageDescriptor EDITOR_ACTION3_IMAGE_DISABLE;
- static final ImageDescriptor EDITOR_ACTION1_IMAGE_ENABLE;
- static final ImageDescriptor EDITOR_ACTION2_IMAGE_ENABLE;
- static final ImageDescriptor EDITOR_ACTION3_IMAGE_ENABLE;
- static final ImageDescriptor README_WIZARD_BANNER;
-
- static {
- String iconPath = "icons/";
-
- String prefix = iconPath + "ctool16/"; //$NON-NLS-1$
- EDITOR_ACTION1_IMAGE = createImageDescriptor(prefix + "action1.gif"); //$NON-NLS-1$
- EDITOR_ACTION2_IMAGE = createImageDescriptor(prefix + "action2.gif"); //$NON-NLS-1$
- EDITOR_ACTION3_IMAGE = createImageDescriptor(prefix + "action3.gif"); //$NON-NLS-1$
-
- prefix = iconPath + "dtool16/"; //$NON-NLS-1$
- EDITOR_ACTION1_IMAGE_DISABLE = createImageDescriptor(prefix + "action1.gif"); //$NON-NLS-1$
- EDITOR_ACTION2_IMAGE_DISABLE = createImageDescriptor(prefix + "action2.gif"); //$NON-NLS-1$
- EDITOR_ACTION3_IMAGE_DISABLE = createImageDescriptor(prefix + "action3.gif"); //$NON-NLS-1$
-
- prefix = iconPath + "etool16/"; //$NON-NLS-1$
- EDITOR_ACTION1_IMAGE_ENABLE = createImageDescriptor(prefix + "action1.gif"); //$NON-NLS-1$
- EDITOR_ACTION2_IMAGE_ENABLE = createImageDescriptor(prefix + "action2.gif"); //$NON-NLS-1$
- EDITOR_ACTION3_IMAGE_ENABLE = createImageDescriptor(prefix + "action3.gif"); //$NON-NLS-1$
-
- prefix = iconPath + "wizban/"; //$NON-NLS-1$
- README_WIZARD_BANNER = createImageDescriptor(prefix + "newreadme_wiz.gif"); //$NON-NLS-1$
- }
-/**
- * Utility method to create an <code>ImageDescriptor</code>
- * from a path to a file.
- */
-private static ImageDescriptor createImageDescriptor(String path) {
- try {
- URL url = new URL(BASE_URL, path);
- return ImageDescriptor.createFromURL(url);
- } catch (MalformedURLException e) {
- }
- return ImageDescriptor.getMissingImageDescriptor();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java
deleted file mode 100644
index 2b7012027e0..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeMarkerResolutionGenerator.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * Copyright (c) 2000, 2002 IBM Corp. All rights reserved.
- * This file is 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
- */
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IMarkerResolutionGenerator;
-
-/**
- * Creates resolutions for readme markers.
- */
-public class ReadmeMarkerResolutionGenerator implements IMarkerResolutionGenerator {
- /*(non-Javadoc)
- * Method declared on IMarkerResolutionGenerator.
- */
- public IMarkerResolution[] getResolutions(IMarker marker) {
- return new IMarkerResolution[] {new AddSentenceResolution()};
- }
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java
deleted file mode 100644
index 187aa3f7bb3..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeModelFactory.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-/**
- * Creates the sections used in the <code>ContentOutline</code>
- *
- * @see ReadmeContentOutlinePage#getContentOutline(IAdaptable)
- */
-public class ReadmeModelFactory {
- private static ReadmeModelFactory instance = new ReadmeModelFactory();
- private boolean registryLoaded = false;
- IReadmeFileParser parser = null;
-/**
- * Creates a new ReadmeModelFactory.
- */
-private ReadmeModelFactory() {
-}
-/**
- * Adds all mark elements to the list for the subtree rooted
- * at the given mark element.
- */
-protected void addSections(AdaptableList list, MarkElement element) {
- list.add(element);
- Object[] children = element.getChildren(element);
- for (int i = 0; i < children.length; ++i) {
- addSections(list, (MarkElement) children[i]);
- }
-}
-/**
- * Returns the content outline for the given Readme file.
- *
- * @param adaptable the element for which to return the content outline
- * @return the content outline for the argument
- */
-public AdaptableList getContentOutline(IAdaptable adaptable) {
- return new AdaptableList(getToc((IFile)adaptable));
-}
-/**
- * Returns the singleton readme adapter.
- */
-public static ReadmeModelFactory getInstance() {
- return instance;
-}
-/**
- * Returns a list of all sections in this readme file.
- *
- * @param file the file for which to return section heading and subheadings
- * @return A list containing headings and subheadings
- */
-public AdaptableList getSections(IFile file) {
- MarkElement[] topLevel = getToc(file);
- AdaptableList list = new AdaptableList();
- for (int i = 0; i < topLevel.length; i++) {
- addSections(list, topLevel[i]);
- }
- return list;
-}
-/**
- * Convenience method. Looks for a readme file in the selection,
- * and if one is found, returns the sections for it. Returns null
- * if there is no readme file in the selection.
- */
-public AdaptableList getSections(ISelection sel) {
- // If sel is not a structured selection just return.
- if (!(sel instanceof IStructuredSelection))
- return null;
- IStructuredSelection structured = (IStructuredSelection)sel;
-
- //if the selection is a readme file, get its sections.
- Object object = structured.getFirstElement();
- if (object instanceof IFile) {
- IFile file = (IFile) object;
- String extension = file.getFileExtension();
- if (extension != null && extension.equals(IReadmeConstants.EXTENSION)) {
- return getSections(file);
- }
- }
-
- //the selected object is not a readme file
- return null;
-}
-/**
- * Parses the contents of the Readme file by looking for lines
- * that start with a number.
- *
- * @param file the file representing the Readme file
- * @return an element collection representing the table of contents
- */
-private MarkElement[] getToc(IFile file) {
- if (registryLoaded == false) loadParser();
- return parser.parse(file);
-}
-/**
- * Loads the parser from the registry by searching for
- * extensions that satisfy our published extension point.
- * For the sake of simplicity, we will pick the last extension,
- * allowing tools to override what is used. In a more
- * elaborate tool, all the extensions would be processed.
- */
-private void loadParser() {
- IPluginRegistry pluginRegistry = Platform.getPluginRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(IReadmeConstants.PLUGIN_ID, IReadmeConstants.PP_SECTION_PARSER);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IExtension currentExtension = extensions[i];
- // in a real application, we would collection
- // the entire list and probably expose it
- // as a drop-down list. For the sake
- // of simplicity, we will pick the last extension only.
- if (i == extensions.length - 1) {
- IConfigurationElement[] configElements = currentExtension.getConfigurationElements();
- for (int j = 0; j < configElements.length; j++) {
- IConfigurationElement config = configElements[i];
- if (config.getName().equals(IReadmeConstants.TAG_PARSER)) {
- // process the first 'parser' element and stop
- processParserElement(config);
- break;
- }
- }
- }
- }
- }
- if (parser == null)
- parser = new DefaultSectionsParser();
- registryLoaded = true;
-}
-/**
- * Tries to create the Readme file parser. If an error occurs during
- * the creation of the parser, print an error and set the parser
- * to null.
- *
- * @param element the element to process
- */
-private void processParserElement(IConfigurationElement element) {
- try {
- parser = (IReadmeFileParser)element.createExecutableExtension(IReadmeConstants.ATT_CLASS);
- } catch (CoreException e) {
- // since this is an example just write to the console
- System.out.println(MessageUtil.getString("Unable_to_create_file_parser") + e.getStatus().getMessage()); //$NON-NLS-1$
- parser = null;
- }
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java
deleted file mode 100644
index 6b1b57be51d..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePlugin.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.*;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-
-/**
- * This is the top-level class of the Readme plugin tool.
- *
- * @see AbstractUIPlugin for additional information on UI plugins
- */
-public class ReadmePlugin extends AbstractUIPlugin {
- // Default instance of the receiver
-
- private static ReadmePlugin inst;
-/**
- * Creates the Readme plugin and caches its default instance
- *
- * @param descriptor the plugin descriptor which the receiver is made from
- */
-public ReadmePlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- if (inst==null) inst = this;
-}
-/**
- * Gets the plugin singleton.
- *
- * @return the default ReadmePlugin instance
- */
-static public ReadmePlugin getDefault() {
- return inst;
-}
-/**
- * Sets default preference values. These values will be used
- * until some preferences are actually set using Preference dialog.
- */
-protected void initializeDefaultPreferences(IPreferenceStore store) {
- // These settings will show up when Preference dialog
- // opens up for the first time.
- store.setDefault(IReadmeConstants.PRE_CHECK1, true);
- store.setDefault(IReadmeConstants.PRE_CHECK2, true);
- store.setDefault(IReadmeConstants.PRE_CHECK3, false);
- store.setDefault(IReadmeConstants.PRE_RADIO_CHOICE, 2);
- store.setDefault(IReadmeConstants.PRE_TEXT, MessageUtil.getString("Default_text")); //$NON-NLS-1$
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java
deleted file mode 100644
index 0ee7d336032..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java
+++ /dev/null
@@ -1,310 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.ui.help.*;
-import org.eclipse.jface.preference.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.events.*;
-
-/**
- * This class implements a sample preference page that is
- * added to the preference dialog based on the registration.
- */
-public class ReadmePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, SelectionListener, ModifyListener {
- private Button radioButton1;
- private Button radioButton2;
- private Button radioButton3;
-
- private Button checkBox1;
- private Button checkBox2;
- private Button checkBox3;
-
- private Text textField;
-
- private Button pushButton_textField;
-/**
- * Creates an new checkbox instance and sets the default
- * layout data.
- *
- * @param group the composite in which to create the checkbox
- * @param label the string to set into the checkbox
- * @return the new checkbox
- */
-private Button createCheckBox(Composite group, String label) {
- Button button = new Button(group, SWT.CHECK | SWT.LEFT);
- button.setText(label);
- button.addSelectionListener(this);
- GridData data = new GridData();
- button.setLayoutData(data);
- return button;
-}
-/**
- * Creates composite control and sets the default layout data.
- *
- * @param parent the parent of the new composite
- * @param numColumns the number of columns for the new composite
- * @return the newly-created coposite
- */
-private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- //GridData
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
-}
-/** (non-Javadoc)
- * Method declared on PreferencePage
- */
-protected Control createContents(Composite parent)
-{
- WorkbenchHelp.setHelp(parent, IReadmeConstants.PREFERENCE_PAGE_CONTEXT);
-
- //composite_textField << parent
- Composite composite_textField = createComposite(parent, 2);
- Label label_textField = createLabel(composite_textField, MessageUtil.getString("Text_Field")); //$NON-NLS-1$
- textField = createTextField(composite_textField);
- pushButton_textField = createPushButton(composite_textField, MessageUtil.getString("Change")); //$NON-NLS-1$
-
- //composite_tab << parent
- Composite composite_tab = createComposite(parent, 2);
- Label label1 = createLabel(composite_tab, MessageUtil.getString("Radio_Button_Options")); //$NON-NLS-1$
-
- //
- tabForward(composite_tab);
- //radio button composite << tab composite
- Composite composite_radioButton = createComposite(composite_tab, 1);
- radioButton1 = createRadioButton(composite_radioButton, MessageUtil.getString("Radio_button_1")); //$NON-NLS-1$
- radioButton2 = createRadioButton(composite_radioButton, MessageUtil.getString("Radio_button_2")); //$NON-NLS-1$
- radioButton3 = createRadioButton(composite_radioButton, MessageUtil.getString("Radio_button_3")); //$NON-NLS-1$
-
-
- //composite_tab2 << parent
- Composite composite_tab2 = createComposite(parent, 2);
- Label label2 = createLabel(composite_tab2, MessageUtil.getString("Check_Box_Options")); //$NON-NLS-1$
-
- //
- tabForward(composite_tab2);
- //composite_checkBox << composite_tab2
- Composite composite_checkBox = createComposite(composite_tab2, 1);
- checkBox1 = createCheckBox(composite_checkBox, MessageUtil.getString("Check_box_1")); //$NON-NLS-1$
- checkBox2 = createCheckBox(composite_checkBox, MessageUtil.getString("Check_box_2")); //$NON-NLS-1$
- checkBox3 = createCheckBox(composite_checkBox, MessageUtil.getString("Check_box_3")); //$NON-NLS-1$
-
- initializeValues();
-
- //font = null;
- return new Composite(parent, SWT.NULL);
-}
-/**
- * Utility method that creates a label instance
- * and sets the default layout data.
- *
- * @param parent the parent for the new label
- * @param text the text for the new label
- * @return the new label
- */
-private Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalSpan = 2;
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
-}
-/**
- * Utility method that creates a push button instance
- * and sets the default layout data.
- *
- * @param parent the parent for the new button
- * @param label the label for the new button
- * @return the newly-created button
- */
-private Button createPushButton(Composite parent, String label) {
- Button button = new Button(parent, SWT.PUSH);
- button.setText(label);
- button.addSelectionListener(this);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- return button;
-}
-/**
- * Utility method that creates a radio button instance
- * and sets the default layout data.
- *
- * @param parent the parent for the new button
- * @param label the label for the new button
- * @return the newly-created button
- */
-private Button createRadioButton(Composite parent, String label) {
- Button button = new Button(parent, SWT.RADIO | SWT.LEFT);
- button.setText(label);
- button.addSelectionListener(this);
- GridData data = new GridData();
- button.setLayoutData(data);
- return button;
-}
-/**
- * Create a text field specific for this application
- *
- * @param parent the parent of the new text field
- * @return the new text field
- */
-private Text createTextField(Composite parent) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- text.addModifyListener(this);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- text.setLayoutData(data);
- return text;
-}
-/**
- * The <code>ReadmePreferencePage</code> implementation of this
- * <code>PreferencePage</code> method
- * returns preference store that belongs to the our plugin.
- * This is important because we want to store
- * our preferences separately from the desktop.
- */
-protected IPreferenceStore doGetPreferenceStore() {
- return ReadmePlugin.getDefault().getPreferenceStore();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchPreferencePage
- */
-public void init(IWorkbench workbench){
-}
-/**
- * Initializes states of the controls using default values
- * in the preference store.
- */
-private void initializeDefaults() {
- IPreferenceStore store = getPreferenceStore();
- checkBox1.setSelection(store.getDefaultBoolean(IReadmeConstants.PRE_CHECK1));
- checkBox2.setSelection(store.getDefaultBoolean(IReadmeConstants.PRE_CHECK2));
- checkBox3.setSelection(store.getDefaultBoolean(IReadmeConstants.PRE_CHECK3));
-
- radioButton1.setSelection(false);
- radioButton2.setSelection(false);
- radioButton3.setSelection(false);
- int choice = store.getDefaultInt(IReadmeConstants.PRE_RADIO_CHOICE);
- switch (choice) {
- case 1:
- radioButton1.setSelection(true);
- break;
- case 2:
- radioButton2.setSelection(true);
- break;
- case 3:
- radioButton3.setSelection(true);
- break;
- }
- textField.setText(store.getDefaultString(IReadmeConstants.PRE_TEXT));
-}
-/**
- * Initializes states of the controls from the preference store.
- */
-private void initializeValues() {
- IPreferenceStore store = getPreferenceStore();
- checkBox1.setSelection(store.getBoolean(IReadmeConstants.PRE_CHECK1));
- checkBox2.setSelection(store.getBoolean(IReadmeConstants.PRE_CHECK2));
- checkBox3.setSelection(store.getBoolean(IReadmeConstants.PRE_CHECK3));
-
- int choice = store.getInt(IReadmeConstants.PRE_RADIO_CHOICE);
- switch (choice) {
- case 1:
- radioButton1.setSelection(true);
- break;
- case 2:
- radioButton2.setSelection(true);
- break;
- case 3:
- radioButton3.setSelection(true);
- break;
- }
- textField.setText(store.getString(IReadmeConstants.PRE_TEXT));
-}
-/** (non-Javadoc)
- * Method declared on ModifyListener
- */
-public void modifyText(ModifyEvent event) {
- //Do nothing on a modification in this example
-}
-/* (non-Javadoc)
- * Method declared on PreferencePage
- */
-protected void performDefaults() {
- super.performDefaults();
- initializeDefaults();
-}
-/* (non-Javadoc)
- * Method declared on PreferencePage
- */
-public boolean performOk() {
- storeValues();
- ReadmePlugin.getDefault().savePluginPreferences();
- return true;
-}
-/**
- * Stores the values of the controls back to the preference store.
- */
-private void storeValues() {
- IPreferenceStore store = getPreferenceStore();
- store.setValue(IReadmeConstants.PRE_CHECK1, checkBox1.getSelection());
- store.setValue(IReadmeConstants.PRE_CHECK2, checkBox2.getSelection());
- store.setValue(IReadmeConstants.PRE_CHECK3, checkBox3.getSelection());
-
- int choice = 1;
-
- if (radioButton2.getSelection()) choice = 2;
- else if (radioButton3.getSelection()) choice = 3;
-
- store.setValue(IReadmeConstants.PRE_RADIO_CHOICE, choice);
- store.setValue(IReadmeConstants.PRE_TEXT, textField.getText());
-}
-/**
- * Creates a tab of one horizontal spans.
- *
- * @param parent the parent in which the tab should be created
- */
-private void tabForward(Composite parent) {
- Label vfiller = new Label(parent, SWT.LEFT);
- GridData gridData = new GridData();
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.BEGINNING;
- gridData.grabExcessHorizontalSpace = false;
- gridData.verticalAlignment = GridData.CENTER;
- gridData.grabExcessVerticalSpace = false;
- vfiller.setLayoutData(gridData);
-}
-/** (non-Javadoc)
- * Method declared on SelectionListener
- */
-public void widgetDefaultSelected(SelectionEvent event) {
- //Handle a default selection. Do nothing in this example
-}
-/** (non-Javadoc)
- * Method declared on SelectionListener
- */
-public void widgetSelected(SelectionEvent event) {
- //Do nothing on selection in this example;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java
deleted file mode 100644
index 29fcd4ccaaf..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmeSectionsView.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.*;
-import org.eclipse.ui.help.*;
-import org.eclipse.ui.part.*;
-import org.eclipse.ui.model.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This class demonstrates a simple view containing a single viewer.
- */
-public class ReadmeSectionsView extends ViewPart implements ISelectionListener {
- ListViewer viewer;
-/**
- * Creates a new ReadmeSectionsView .
- */
-public ReadmeSectionsView() {
- super();
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchPart
- */
-public void createPartControl(Composite parent) {
- viewer = new ListViewer(parent);
-
- WorkbenchHelp.setHelp(viewer.getControl(), IReadmeConstants.SECTIONS_VIEW_CONTEXT);
-
- // if the objects in the viewer implement the IDesktopElement adapter,
- // these generic content and label providers can be used.
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
-
- // add myself as a global selection listener
- getSite().getPage().addSelectionListener(this);
-
- // prime the selection
- selectionChanged(null, getSite().getPage().getSelection());
-}
-/**
- * The <code>ReadmeSectionView</code> implementation of this
- * <code>IWorkbenchPart</code> method runs super
- * and removes itself from the global selection listener.
- */
-public void dispose() {
- super.dispose();
- getSite().getPage().removeSelectionListener(this);
-}
-/* (non-Javadoc)
- * Method declared on ISelectionListener
- */
-public void selectionChanged(IWorkbenchPart part, ISelection sel) {
- //if the selection is a readme file, get its sections.
- AdaptableList input = ReadmeModelFactory.getInstance().getSections(sel);
- viewer.setInput(input);
-}
-/* (non-Javadoc)
- * Method declared on IWorkbenchPart
- */
-public void setFocus() {
- viewer.getControl().setFocus();
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java
deleted file mode 100644
index 0c66a7bfaf7..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/SectionsDialog.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.model.*;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.*;
-/**
- * This dialog is an example of a detached window launched
- * from an action in the desktop.
- */
-public class SectionsDialog extends Dialog {
- protected IAdaptable input;
-/**
- * Creates a new SectionsDialog.
- */
-public SectionsDialog(Shell parentShell, IAdaptable input) {
- super(parentShell);
- this.input = input;
-}
-/* (non-Javadoc)
- * Method declared on Window.
- */
-protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(MessageUtil.getString("Readme_Sections")); //$NON-NLS-1$
- WorkbenchHelp.setHelp(newShell, IReadmeConstants.SECTIONS_DIALOG_CONTEXT);
-}
-/* (non-Javadoc)
- * Method declared on Dialog
- */
-protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite)super.createDialogArea(parent);
-
- List list = new List(composite, SWT.BORDER);
- GridData data = new GridData(GridData.FILL_BOTH);
- list.setLayoutData(data);
- ListViewer viewer = new ListViewer(list);
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
- viewer.setInput(input);
-
- return composite;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java
deleted file mode 100644
index 12614d02e4c..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ViewActionDelegate.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-
-/**
- * This class is used to demonstrate view action extensions.
- * An extension should be defined in the readme plugin.xml.
- */
-public class ViewActionDelegate implements IViewActionDelegate {
- public IViewPart view;
-/**
- * Creates a new ViewActionDelegate.
- */
-public ViewActionDelegate() {
- super();
-}
-/* (non-Javadoc)
- * Method declared on IViewActionDelegate
- */
-public void init(IViewPart view) {
- this.view = view;
-}
-/* (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void run(org.eclipse.jface.action.IAction action) {
- MessageDialog.openInformation(view.getSite().getShell(),
- MessageUtil.getString("Readme_Editor"), //$NON-NLS-1$
- MessageUtil.getString("View_Action_executed")); //$NON-NLS-1$
-}
-/* (non-Javadoc)
- * Method declared on IActionDelegate
- */
-public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java
deleted file mode 100644
index ec6df817483..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/WindowActionDelegate.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.ui.examples.readmetool;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.ui.*;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class shows how <code>IActionDelegate</code> implementations
- * should be used for global action registration for menu
- * and tool bars. Action proxy object is created in the
- * desktop based on presentation information in the plugin.xml
- * file. Delegate is not loaded until the first time the user
- * presses the button or selects the menu. Based on the action
- * availability, it is possible that the button will disable
- * instead of executing.
- */
-public class WindowActionDelegate implements IWorkbenchWindowActionDelegate {
- private IWorkbenchWindow window;
- private ISelection selection;
-/* (non-Javadoc)
- * Method declared on IWorkbenchActionDelegate
- */
-public void dispose() {}
-/* (non-Javadoc)
- * Method declared on IWorkbenchActionDelegate
- */
-public void init(IWorkbenchWindow window) {
- this.window = window;
-}
-/**
- * The <code>WindowActionDelegate</code> implementation of this
- * <code>IActionDelegate</code> method
- * launches a stand-alone dialog that contains a list of sections for
- * the selected readme file in the navigator.
- */
-public void run(IAction action) {
- SectionsDialog dialog = new SectionsDialog(window.getShell(),
- ReadmeModelFactory.getInstance().getSections(selection));
- dialog.open();
-}
-/**
- * The <code>WindowActionDelegate</code> implementation of this
- * <code>IActionDelegate</code> method
- * does nothing - we will let simple rules in the XML
- * config file react to selections.
- */
-public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
-}
-}
diff --git a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties b/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties
deleted file mode 100644
index 80368b8f7fd..00000000000
--- a/examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/messages.properties
+++ /dev/null
@@ -1,85 +0,0 @@
-Add=&Add
-Clean=Clean
-Save_Needed=Save Needed
-Editor_Action_executed=Editor Action executed
-Readme_Editor=Readme Editor
-Readme_Outline=Readme Outline
-Line_count=Line count
-Title_length=Title length
-Title_start=Title start
-Popup_Menu_Action_executed=Popup Menu Action executed
-Readme_Example=Readme Example
-Automatic_sample_section_generation=Automatic sample section generation
-Create_Readme_File=Create Readme File
-Create_a_new_Readme_file_resource=Create a new Readme file resource.
-Generate_sample_section_titles=&Generate sample section titles
-Generate_sample_subsection_titles=Generate sample subsection &titles
-Open_file_for_editing_when_done=&Open file for editing when done
-Readme_file_name=&Readme file name:
-SAMPLE_README_FILE=\n\n SAMPLE README FILE\n\n
-SECTION_1=1. SECTION 1\n
-SECTION_1_BODY_1=This text is a placeholder for the section body.\n
-SECTION_2=2. SECTION 2\n
-SECTION_2_BODY_1=This text is a placeholder for the section body. It is\n
-SECTION_2_BODY_2=a bit longer in order to span two lines.\n
-Subsection_1_1=\ \ \ 1.1 Subsection\n
-Subsection_1_1_Body_1=\ \ \ This text is a placeholder for the subsection body\n
-Subsection_2_1=\ \ \ 2.1 Subsection\n
-Subsection_2_1_BODY_1=\ \ \ This text is a placeholder for the subsection body\n
-Subsection_2_2=\ \ \ 2.2 Subsection\n
-Subsection_2_2_BODY_1=\ \ \ This text is a placeholder for the subsection body\n
-New_Readme_File=New Readme File
-Exception_in_readme_drop_adapter=Exception in readme drop adapter:
-Editor_Action1=Editor Action &1
-Editor_Action2=Editor Action &2
-Editor_Action3=Editor Action &3
-Editor_Action4=Editor Action &4
-Editor_Action5=Editor Action &5
-Outline_Action2=Outline Action &2
-Outline_Action3=Outline Action &3
-Outline_Action4=Outline Action &4
-Outline_Action5=Outline Action &5
-Editor_is_active=Editor is active
-Empty_Editor_Name=Empty
-Readme_Editor_Action1=Readme Editor Action 1
-Readme_Editor_Action2=Readme Retarget Editor Action 2
-Readme_Editor_Action3=Readme Label Retarget Editor Action 3
-Readme_Editor_Action5=Readme Label Retarget Editor Action 5
-Readme_Outline_Action3=Readme Label Retarget Outline Action 3
-Readme_Outline_Action5=Readme Label Retarget Outline Action 5
-Readme_Menu=&Readme
-ReadmeEditorActionExecuted=Readme Editor Action executed: {0} for: {1}
-ReadmeOutlineActionExecuted=Readme Outline Action executed
-<Unknown>=<Unknown>
-<file_contents_not_local>=<file contents not local>
-Additional_information=Additional information about the Readme file can go here.
-File_name=File name:
-Number_of_sections=Number of sections:
-Path=Path:
-Size=Size:
-Additional_Readme_properties_not_available.=Additional Readme properties not available.
-Had_it_been_less_than_256_bytes_this_page_would_be_a_placeholder_page.=Had it been less than 256 bytes, this page would be a placeholder page.
-The_size_of_the_Readme_file_is_at_least_256_bytes.=The size of the Readme file is at least 256 bytes.
-This_illustrates_a_property_page_that_is_dynamically_determined=This illustrates a property page that is dynamically determined
-not_to_be_available_based_on_the_state_of_the_object.=not to be available based on the state of the object.
-to_be_available_based_on_the_state_of_the_object.=to be available based on the state of the object.
-Unable_to_create_file_parser=Unable to create file parser.
-Default_text=Default text
-Change=Chan&ge
-Check_Box_Options=Check Box Options
-Check_box_1=&Check box 1
-Check_box_2=C&heck box 2
-Check_box_3=Check bo&x 3
-Radio_Button_Options=Radio Button Options
-Radio_button_1=&Radio button 1
-Radio_button_2=Rad&io button 2
-Radio_button_3=Radio b&utton 3
-Text_Field=&Text Field
-Readme_Sections=Readme Sections
-View_Action_executed=View Action executed
-Add_Sentence=Add Sentence
-Resolution_Error=Resolution Error
-Unable_to_open_file_editor=Unable to open file editor
-Simple_sentence=This is a simple sentence.\n
-Readme_marker_message_example=Readme marker example
-Add_readme_marker_action_label=Readme Marker Example & \ No newline at end of file

Back to the top