Index: plugin.xml
===================================================================
RCS file: /home/eclipse/org.eclipse.ui.tests/plugin.xml,v
retrieving revision 1.138
diff -u -r1.138 plugin.xml
--- plugin.xml 20 Jun 2005 13:33:18 -0000 1.138
+++ plugin.xml 5 Jul 2005 18:34:20 -0000
@@ -646,6 +646,21 @@
id="org.eclipse.ui.tests.markers.delete">
+
+
+
+
@@ -1995,7 +2010,21 @@
default="true"
name="Editor w/Outline"
id="org.eclipse.ui.tests.perf_outline"
- extensions="perf_outline"/>
+ extensions="perf_outline"/>
+
+
@@ -2318,4 +2347,13 @@
icon="icons/anything.gif"
id="org.eclipse.category1"/>
-
\ No newline at end of file
+
+
+
+
+
+
+
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/MultiEditorTest.java
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/MultiEditorTest.java
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/MultiEditorTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/MultiEditorTest.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,437 @@
+package org.eclipse.ui.tests.multieditor;
+
+import junit.framework.TestSuite;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.ToolBarContributionItem;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IActionBars2;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.internal.WorkbenchPage;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.IContributedContentsView;
+import org.eclipse.ui.part.MultiEditor;
+import org.eclipse.ui.part.MultiEditorInput;
+import org.eclipse.ui.tests.util.CallHistory;
+import org.eclipse.ui.tests.util.UITestCase;
+
+/**
+ * Test MultiEditor behaviour to highlight some of the broken functionality.
+ *
+ * @since 3.1
+ */
+public class MultiEditorTest extends UITestCase {
+ private static final String PROJECT_NAME = "TiledEditorProject";
+
+ private static final String CONTENT_OUTLINE = "org.eclipse.ui.views.ContentOutline";
+
+ private static final String TESTEDITOR_COOLBAR = "org.eclipse.ui.tests.multieditor.TestEditor";
+
+ private static final String TILED_EDITOR_ID = "org.eclipse.ui.tests.multieditor.TiledEditor";
+
+ private static final String EDITOR_FAIL_LOG = "Unable to create editor ID ";
+
+ // tiled editor test files
+ private static final String TEST01_TXT = "test01.txt";
+
+ private static final String TEST02_TXT = "test02.txt";
+
+ private static final String TEST03_ETEST = "test03.etest";
+
+ private static final String TEST04_PROPERTIES = "test04.properties";
+
+ private static final String BUILD_XML = "build.xml";
+
+ public static TestSuite suite() {
+ return new TestSuite(MultiEditorTest.class);
+ }
+
+ /**
+ * Can catch a MultiEditor NPE on init.
+ */
+ private NPEListener fNpeListener;
+
+ public MultiEditorTest(String tc) {
+ super(tc);
+ }
+
+ /**
+ * Test that the test tiled editor can be opened with a basic
+ * MultiEditorInput with the same type of files.
+ *
+ * @throws Throwable
+ * on an error
+ */
+ public void testOpenBasicEditor() throws Throwable {
+ final String[] simpleFiles = { TEST01_TXT, TEST02_TXT };
+
+ setupNpe();
+
+ IWorkbenchWindow window = fWorkbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = window.getActivePage();
+
+ IProject testProject = findOrCreateProject(PROJECT_NAME);
+
+ MultiEditorInput input = generateEditorInput(simpleFiles, testProject);
+
+ // validate there are no NullPointerExceptions during editor
+ // initialization
+ openAndValidateEditor(page, input);
+ }
+
+ /**
+ * Test that the public methods in TiledEditor (and MultiEditor) are called
+ * in the correct order from 3.0 to 3.1.
+ *
+ * @throws Throwable
+ */
+ public void testOpenTestFile() throws Throwable {
+ final String[] simpleFiles = { TEST01_TXT, TEST03_ETEST };
+
+ setupNpe();
+
+ IWorkbenchWindow window = fWorkbench.getActiveWorkbenchWindow();
+ WorkbenchPage page = (WorkbenchPage) window.getActivePage();
+
+ IProject testProject = findOrCreateProject(PROJECT_NAME);
+
+ MultiEditorInput input = generateEditorInput(simpleFiles, testProject);
+
+ // catches the framework NPE
+ IEditorPart editor = openAndValidateEditor(page, input);
+
+ // did we get a multieditor back?
+ assertTrue(editor instanceof MultiEditor);
+ MultiEditor multiEditor = (MultiEditor) editor;
+
+ chewUpEvents();
+
+ // swap focus to the last editor, which is the test editor
+ // with the test coolbar contribution
+ IEditorPart[] innerEditors = multiEditor.getInnerEditors();
+ innerEditors[innerEditors.length - 1].setFocus();
+
+ chewUpEvents();
+
+ final String[] publicMethodTrace = { "init", "init",
+ "createPartControl", "createInnerPartControl",
+ "updateInnerEditorTitle", "createInnerPartControl",
+ "updateInnerEditorTitle", "setFocus", "updateGradient",
+ "updateGradient", "updateGradient", "updateGradient",
+ "setFocus", "updateGradient", "updateGradient",
+ "updateGradient", };
+ assertTrue("The public methods weren't called in the correct order",
+ ((TiledEditor) multiEditor).callHistory
+ .verifyOrder(publicMethodTrace));
+ }
+
+ /**
+ * Test that various items in the workbench are updated when focus moves
+ * through the different inner editors.
+ *
+ * @throws Throwable
+ * on an error
+ */
+ public void testOpenBuildFile() throws Throwable {
+ final String[] simpleFiles = { TEST01_TXT, TEST02_TXT,
+ TEST04_PROPERTIES, BUILD_XML, TEST03_ETEST };
+
+ setupNpe();
+
+ IWorkbenchWindow window = fWorkbench.getActiveWorkbenchWindow();
+ WorkbenchPage page = (WorkbenchPage) window.getActivePage();
+
+ IProject testProject = findOrCreateProject(PROJECT_NAME);
+
+ MultiEditorInput input = generateEditorInput(simpleFiles, testProject);
+
+ // catches the framework NPE
+ IEditorPart editor = openAndValidateEditor(page, input);
+
+ // did we get a multieditor back?
+ assertTrue(editor instanceof MultiEditor);
+ MultiEditor multiEditor = (MultiEditor) editor;
+
+ chewUpEvents();
+
+ // get access to the appropriate coolbar
+ IContributionItem contribution = findMyCoolBar(page);
+
+ // our test editor contribution should not be visible
+ // but it should be enabled
+ assertFalse("We open in the default text editor", contribution
+ .isVisible());
+ assertTrue("And we're good to go", contribution.isEnabled());
+
+ // swap focus to the last editor, which is the test editor
+ // with the test coolbar contribution
+ IEditorPart[] innerEditors = multiEditor.getInnerEditors();
+ innerEditors[innerEditors.length - 1].setFocus();
+
+ chewUpEvents();
+
+ // our test editor contribution should now be visible and
+ // enabled
+ assertTrue("We are in the test editor", contribution.isVisible());
+ assertTrue("And we're good to go", contribution.isEnabled());
+
+ // Swap to the second last editor, which should be the ant
+ // build editor.
+ innerEditors[innerEditors.length - 2].setFocus();
+ chewUpEvents();
+
+ // get the outline view part
+ IViewPart outline = window.getActivePage().findView(CONTENT_OUTLINE);
+ assertNotNull(outline);
+
+ // find out who is contributing the outline view.
+ IContributedContentsView view = (IContributedContentsView) outline
+ .getAdapter(IContributedContentsView.class);
+ IWorkbenchPart part = view.getContributingPart();
+ assertNotNull("The Outline view has not been updated by the editor",
+ part);
+ assertTrue("The Outline view is not talking to an editor",
+ part instanceof IEditorPart);
+
+ IEditorPart outlineEditor = (IEditorPart) part;
+
+ // the active inner editor (the ant editor) should also
+ // be the outline editor contributor ... this works in
+ // 3.0, fails in 3.1
+ assertEquals("The Outline view is not talking to the correct editor",
+ multiEditor.getActiveEditor(), outlineEditor);
+ }
+
+ /**
+ * Return the test editor coolbar.
+ *
+ * @param page
+ * the workbench page
+ * @return the IContributionItem for the test editor cool bar.
+ */
+ private IContributionItem findMyCoolBar(WorkbenchPage page) {
+ IContributionItem contribution = ((IActionBars2) page.getActionBars())
+ .getCoolBarManager().find(TESTEDITOR_COOLBAR);
+ assertNotNull(contribution);
+
+ return contribution;
+ }
+
+ /**
+ * Create the project to work in. If it already exists, just open it.
+ *
+ * @param projectName
+ * the name of the project to create
+ * @return the newly opened project
+ * @throws CoreException
+ */
+ private IProject findOrCreateProject(String projectName)
+ throws CoreException {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ IProject testProject = workspace.getRoot().getProject(projectName);
+ if (!testProject.exists()) {
+ testProject.create(null);
+ }
+ testProject.open(null);
+ return testProject;
+ }
+
+ /**
+ * Internal printing method, only used for investigation.
+ *
+ * @param page
+ * the workbench page
+ */
+ private void checkView(WorkbenchPage page) {
+ IViewPart[] views = page.getViews();
+ for (int i = 0; i < views.length; ++i) {
+ System.err.println("view: " + views[i].getViewSite().getId() + "/"
+ + views[i].getViewSite().getRegisteredName());
+ }
+ }
+
+ /**
+ * Print the call history to console. Only used for investigation.
+ *
+ * @param history
+ * the editor call history object.
+ */
+ private void listHistory(CallHistory history) {
+ history.printToConsole();
+ }
+
+ /**
+ * List bits and internals of the coolbar manager contribution items. Only
+ * used for investigation.
+ *
+ * @param page
+ * the workbench page
+ */
+ private void listItems(WorkbenchPage page) {
+ checkView(page);
+ IContributionItem[] items = ((IActionBars2) page.getActionBars())
+ .getCoolBarManager().getItems();
+ System.err.println("Length: " + items.length);
+ for (int i = 0; i < items.length; ++i) {
+ System.err.println("" + items[i].isEnabled() + ":"
+ + items[i].isVisible() + " " + items[i].getId() + "\n\t"
+ + items[i].getClass().getName());
+ if (items[i] instanceof ToolBarContributionItem) {
+ displayItem(items[i]);
+ }
+ }
+ System.err.println("----");
+ }
+
+ /**
+ * Display bits of contribution item internals to the console. Only used for
+ * investigation.
+ *
+ * @param contributionItem
+ * the IContributionItem to display
+ */
+ private void displayItem(IContributionItem contributionItem) {
+ ToolBarManager toolBarManager = (ToolBarManager) ((ToolBarContributionItem) contributionItem)
+ .getToolBarManager();
+ ToolBar bar = toolBarManager.getControl();
+ if (bar == null) {
+ System.err.println("\tInfo-items: -1");
+ } else {
+ System.err.println("\tInfo-items: " + bar.getItemCount() + "/"
+ + bar.getEnabled() + "/" + bar.isEnabled() + "/"
+ + bar.isVisible());
+ ToolItem[] tools = bar.getItems();
+ for (int t = 0; t < tools.length; ++t) {
+ System.err.println("\t\titem: " + tools[t].getEnabled() + " "
+ + tools[t].getToolTipText());
+ }
+ }
+ }
+
+ /**
+ * After an internal action, see if there are any outstanding SWT events.
+ */
+ private void chewUpEvents() throws InterruptedException {
+ Thread.sleep(250);
+ Display display = Display.getCurrent();
+ while (display.readAndDispatch())
+ ;
+ }
+
+ /**
+ * Open the test editor. It does basic validation that there is no
+ * NullPointerException during initialization.
+ *
+ * @param page
+ * the workbench page
+ * @param input
+ * the editor input with multiple files
+ * @return the MultiEditor
+ * @throws PartInitException
+ */
+ private IEditorPart openAndValidateEditor(IWorkbenchPage page,
+ MultiEditorInput input) throws PartInitException {
+ IEditorPart editorPart = page.openEditor(input,
+ MultiEditorTest.TILED_EDITOR_ID);
+ assertNotNull(editorPart);
+
+ // 3.1.0 only
+ // assertFalse("The editor never actualized",
+ // editorPart instanceof ErrorEditorPart);
+
+ assertTrue("Unable to create " + MultiEditorTest.TILED_EDITOR_ID,
+ fNpeListener.noNPE);
+ return editorPart;
+ }
+
+ /**
+ * Set up to catch any editor initialization NullPointerExceptions.
+ *
+ */
+ private void setupNpe() {
+ final ILog log = WorkbenchPlugin.getDefault().getLog();
+ fNpeListener = new NPEListener();
+ log.addLogListener(fNpeListener);
+ }
+
+ /**
+ * Create the multi editor input in the given project. Creates the files in
+ * the project from template files in the classpath if they don't already
+ * exist.
+ *
+ * @param simpleFiles
+ * the array of filenames to copy over
+ * @param testProject
+ * the project to create the files in
+ * @return the editor input used to open the multieditor
+ * @throws CoreException
+ */
+ private MultiEditorInput generateEditorInput(String[] simpleFiles,
+ IProject testProject) throws CoreException {
+ String[] ids = new String[simpleFiles.length];
+ IEditorInput[] inputs = new IEditorInput[simpleFiles.length];
+ IEditorRegistry registry = fWorkbench.getEditorRegistry();
+
+ for (int f = 0; f < simpleFiles.length; ++f) {
+ IFile f1 = testProject.getFile(simpleFiles[f]);
+ if (!f1.exists()) {
+ f1.create(getClass().getResourceAsStream(simpleFiles[f]), true,
+ null);
+ }
+ ids[f] = registry.getDefaultEditor(f1.getName()).getId();
+ inputs[f] = new FileEditorInput(f1);
+ }
+
+ MultiEditorInput input = new MultiEditorInput(ids, inputs);
+ return input;
+ }
+
+ /**
+ * Close any editors at the end of a test, so the next test can be clean.
+ */
+ protected void doTearDown() throws Exception {
+ fWorkbench.getActiveWorkbenchWindow().getActivePage().closeAllEditors(
+ false);
+ super.doTearDown();
+ }
+
+ /**
+ * Listens for the standard message that indicates the MultiEditor failed
+ * ... usually caused by incorrect framework initialization that doesn't set
+ * the innerChildren.
+ *
+ * @since 3.1
+ *
+ */
+ public static class NPEListener implements ILogListener {
+ public boolean noNPE = true;
+
+ public void logging(IStatus status, String plugin) {
+ String msg = status.getMessage();
+ if (msg != null
+ && msg.indexOf(MultiEditorTest.EDITOR_FAIL_LOG
+ + MultiEditorTest.TILED_EDITOR_ID) >= 0) {
+ noNPE = false;
+ }
+ }
+ }
+}
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestActionBarContributor.java
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestActionBarContributor.java
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestActionBarContributor.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestActionBarContributor.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,18 @@
+package org.eclipse.ui.tests.multieditor;
+
+import org.eclipse.jface.action.ICoolBarManager;
+import org.eclipse.ui.part.EditorActionBarContributor;
+
+public class TestActionBarContributor extends EditorActionBarContributor {
+
+ public TestActionBarContributor() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToCoolBar(org.eclipse.jface.action.ICoolBarManager)
+ */
+ public void contributeToCoolBar(ICoolBarManager coolBarManager) {
+ super.contributeToCoolBar(coolBarManager);
+ }
+}
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestEditor.java
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestEditor.java
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestEditor.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TestEditor.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,80 @@
+package org.eclipse.ui.tests.multieditor;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+
+/**
+ * A test editor that does pretty-well nothing. Activating it will
+ * update the coolbar, and possibly eventually the outline as well.
+ *
+ * @since 3.1
+ *
+ */
+public class TestEditor extends EditorPart {
+
+ private Composite fMainPanel;
+
+ public TestEditor() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public void doSave(IProgressMonitor monitor) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void doSaveAs() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void init(IEditorSite site, IEditorInput input)
+ throws PartInitException {
+ if (!(input instanceof IFileEditorInput))
+ throw new PartInitException(
+ "Invalid Input: Must be IFileEditorInput");
+ setSite(site);
+ setInput(input);
+
+ }
+
+ public boolean isDirty() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isSaveAsAllowed() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void createPartControl(Composite parent) {
+ fMainPanel = new Composite(parent, SWT.NONE);
+ fMainPanel.setLayout(new RowLayout(SWT.VERTICAL));
+
+ Label l = new Label(fMainPanel, SWT.NONE);
+ l.setText("Editor Title:");
+
+ l = new Label(fMainPanel, SWT.BORDER);
+ l.setText(getEditorInput().getName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+ */
+ public void setFocus() {
+ fMainPanel.setFocus();
+ }
+
+}
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TiledEditor.java
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TiledEditor.java
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TiledEditor.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/TiledEditor.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,162 @@
+/*
+ * (c) Copyright 2001 MyCorporation.
+ * All Rights Reserved.
+ */
+package org.eclipse.ui.tests.multieditor;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.ViewForm;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.MultiEditor;
+import org.eclipse.ui.part.MultiEditorInput;
+import org.eclipse.ui.tests.util.CallHistory;
+
+/**
+ * Implementation of a TiledEditor. This is the testable version
+ * copied from bug 42641.
+ */
+public class TiledEditor extends MultiEditor {
+
+ private CLabel innerEditorTitle[];
+ public CallHistory callHistory;
+
+ public TiledEditor() {
+ super();
+ callHistory = new CallHistory(this);
+ }
+
+ /*
+ * @see IWorkbenchPart#createPartControl(Composite)
+ */
+ public void createPartControl(Composite parent) {
+ callHistory.add("createPartControl");
+
+ parent = new Composite(parent, SWT.BORDER);
+
+ parent.setLayout(new FillLayout());
+ SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
+ IEditorPart innerEditors[] = getInnerEditors();
+
+ for (int i = 0; i < innerEditors.length; i++) {
+ final IEditorPart e = innerEditors[i];
+ ViewForm viewForm = new ViewForm(sashForm, SWT.NONE);
+ viewForm.marginWidth = 0;
+ viewForm.marginHeight = 0;
+
+ createInnerEditorTitle(i, viewForm);
+
+ Composite content = createInnerPartControl(viewForm,e);
+
+ viewForm.setContent(content);
+ updateInnerEditorTitle(e, innerEditorTitle[i]);
+
+ final int index = i;
+ e.addPropertyListener(new IPropertyListener() {
+ public void propertyChanged(Object source, int property) {
+ if (property == IEditorPart.PROP_DIRTY || property == IWorkbenchPart.PROP_TITLE)
+ if (source instanceof IEditorPart)
+ updateInnerEditorTitle((IEditorPart) source, innerEditorTitle[index]);
+ }
+ });
+ }
+ }
+
+ /**
+ * Draw the gradient for the specified editor.
+ */
+ protected void drawGradient(IEditorPart innerEditor, Gradient g) {
+ CLabel label = innerEditorTitle[getIndex(innerEditor)];
+ if((label == null) || label.isDisposed())
+ return;
+
+ label.setForeground(g.fgColor);
+ label.setBackground(g.bgColors, g.bgPercents);
+ }
+
+ /*
+ * Create the label for each inner editor.
+ */
+ protected void createInnerEditorTitle(int index, ViewForm parent) {
+
+ CLabel titleLabel = new CLabel(parent, SWT.SHADOW_NONE);
+ //hookFocus(titleLabel);
+ titleLabel.setAlignment(SWT.LEFT);
+ titleLabel.setBackground(null, null);
+ parent.setTopLeft(titleLabel);
+ if (innerEditorTitle == null)
+ innerEditorTitle = new CLabel[getInnerEditors().length];
+ innerEditorTitle[index] = titleLabel;
+ }
+
+ /*
+ * Update the tab for an editor. This is typically called
+ * by a site when the tab title changes.
+ */
+ public void updateInnerEditorTitle(IEditorPart editor, CLabel label) {
+ callHistory.add("updateInnerEditorTitle");
+
+ if((label == null) || label.isDisposed())
+ return;
+ String title = editor.getTitle();
+ if (editor.isDirty())
+ title = "*" + title; //$NON-NLS-1$
+ label.setText(title);
+ Image image = editor.getTitleImage();
+ if (image != null)
+ if (!image.equals(label.getImage()))
+ label.setImage(image);
+ label.setToolTipText(editor.getTitleToolTip());
+ }
+
+ /*
+ *
+ */
+ protected int getIndex(IEditorPart editor) {
+ IEditorPart innerEditors[] = getInnerEditors();
+ for (int i = 0; i < innerEditors.length; i++) {
+ if (innerEditors[i] == editor)
+ return i;
+ }
+ return -1;
+ }
+
+ //
+ // These are public methods from the parent that are overriden to
+ // add them to the call history.
+ //
+
+ public Composite createInnerPartControl(Composite parent, IEditorPart e) {
+ callHistory.add("createInnerPartControl");
+ return super.createInnerPartControl(parent, e);
+ }
+
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ callHistory.add("init");
+ super.init(site, input);
+ }
+
+ public void init(IEditorSite site, MultiEditorInput input) throws PartInitException {
+ callHistory.add("init");
+ super.init(site, input);
+ }
+
+ public void setFocus() {
+ callHistory.add("setFocus");
+ super.setFocus();
+ }
+
+ public void updateGradient(IEditorPart editor) {
+ callHistory.add("updateGradient");
+ super.updateGradient(editor);
+ }
+}
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/build.xml
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/build.xml
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/build.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/build.xml 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,29 @@
+
+
+
+
+ description
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test01.txt
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test01.txt
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test01.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test01.txt 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,3 @@
+test file 01
+
+test for MultiEditor
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test02.txt
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test02.txt
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test02.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test02.txt 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,3 @@
+test file 02
+
+test for MultiEditor
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test03.etest
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test03.etest
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test03.etest
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test03.etest 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,3 @@
+test file 03
+
+test for MultiEditor
Index: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test04.properties
===================================================================
RCS file: Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test04.properties
diff -N Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test04.properties
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Eclipse UI Tests/org/eclipse/ui/tests/multieditor/test04.properties 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,2 @@
+org.eclipse.ui.tests.multieditor.good = MultiEditorTest
+org.eclipse.ui.tests.multieditor.bad = TiledEditor
Index: icons/editor.gif
===================================================================
RCS file: icons/editor.gif
diff -N icons/editor.gif
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ icons/editor.gif 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,2 @@
+GIF89a � ??�?��߿�߿����ߟ������___��� !� , G0�I+=8�SO1`hH'�� ��
+�e l��t�a.��˗��6q��d�쩛�n˦�3�z��bL.[Ε ;