| <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| <title>Desktop - Multi-page Editor Example</title> |
| </head> |
| <body> |
| |
| <h2> |
| <b>Example - Multi-page Editor</b></h2> |
| |
| <h3> |
| Introduction</h3> |
| The Multi Page Editor Example adds an editor for files with the .mpe |
| extension. It shows how to create an editor that uses multiple pages by |
| defining both an editor and a page contributor that can add entries to |
| an action bar. |
| <h3> |
| Running the example</h3> |
| To start using the Multi-page Editor Example, create a new file with .mpe |
| extension. Select the file, bring up the popup menu, select the Open |
| With menu and from the sub-menu select the Multi Page Editor Example menu |
| item. You can then select the different editors by selecting the different |
| tabs. |
| <h4> |
| <b>Creating a new mpe file</b></h4> |
| Create a new file with file extension .mpe. From the File menu, select |
| New and then select Other... from the sub-menu. Click on Simple in |
| the wizard, then select |
| <br>File in the list on the left. Click on Next to supply the file |
| name (make sure the extension is .mpe) and the folder in which the file |
| should be contained. |
| <br> |
| <h3> |
| Details</h3> |
| The Multi Page Editor Example demonstrates how to create an multi |
| page editor with a custom page contributor. |
| <p>The Multi Page Editor Example is constructed with two extensions - a |
| document contributor (MultiPageContributor) and an editor (MultiPageEditor). |
| The document contributor is a subclass of <tt>org.eclipse.ui.part.MultiPageEditorActionBarContributor</tt> |
| and defines the actions that are added to an editor when the <tt>setActivePage</tt> |
| method is called. The editor is an <tt>org.eclipse.ui.part.MultiPageEditorPart</tt> |
| that creates 3 pages whose activation is handled by the <tt>pageChange</tt> |
| method that in turn sends <tt>setActivePage</tt> |
| to the contributor. These two classes do not refer to each other directly |
| - the contributor for the editor is set using the contributorClass tag |
| in the plugin.xml |
| |
| </body> |
| </html> |