Java Doc for MultiPageEditorPart.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » part » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » ui workbench » org.eclipse.ui.part 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.eclipse.ui.part.WorkbenchPart
   org.eclipse.ui.part.EditorPart
      org.eclipse.ui.part.MultiPageEditorPart

MultiPageEditorPart
abstract public class MultiPageEditorPart extends EditorPart (Code)
A multi-page editor is an editor with multiple pages, each of which may contain an editor or an arbitrary SWT control.

Subclasses must implement the following methods:

  • createPages - to create the required pages by calling one of the addPage methods
  • IEditorPart.doSave - to save contents of editor
  • IEditorPart.doSaveAs - to save contents of editor
  • IEditorPart.isSaveAsAllowed - to enable Save As
  • IEditorPart.gotoMarker - to scroll to a marker

Multi-page editors have a single action bar contributor, which manages contributions for all the pages. The contributor must be a subclass of AbstractMultiPageEditorActionBarContributor. Note that since any nested editors are created directly in code by callers of addPage(IEditorPart,IEditorInput), nested editors do not have their own contributors.


See Also:   org.eclipse.ui.part.MultiPageEditorActionBarContributor



Constructor Summary
protected  MultiPageEditorPart()
     Creates an empty multi-page editor with no pages.

Method Summary
public  intaddPage(Control control)
     Creates and adds a new page containing the given control to this multi-page editor.
public  voidaddPage(int index, Control control)
     Creates and adds a new page containing the given control to this multi-page editor.
public  intaddPage(IEditorPart editor, IEditorInput input)
     Creates and adds a new page containing the given editor to this multi-page editor.
public  voidaddPage(int index, IEditorPart editor, IEditorInput input)
     Creates and adds a new page containing the given editor to this multi-page editor.
protected  CompositecreatePageContainer(Composite parent)
     Creates the parent control for the container returned by MultiPageEditorPart.getContainer() .

Subclasses may extend and must call super implementation first.


Parameters:
  parent - the parent for all of the editors contents.
abstract protected  voidcreatePages()
     Creates the pages of this multi-page editor.
final public  voidcreatePartControl(Composite parent)
     The MultiPageEditor implementation of this IWorkbenchPart method creates the control for the multi-page editor by calling createContainer, then createPages.
protected  IEditorSitecreateSite(IEditorPart editor)
     Creates the site for the given nested editor.
public  voiddispose()
     The MultiPageEditorPart implementation of this IWorkbenchPart method disposes all nested editors.
final public  IEditorPart[]findEditors(IEditorInput input)
     Find the editors contained in this multi-page editor whose editor input match the provided input.
protected  IEditorPartgetActiveEditor()
     Returns the active nested editor if there is one.
protected  intgetActivePage()
     Returns the index of the currently active page, or -1 if there is no active page.
public  ObjectgetAdapter(Class adapter)
     If there is an adapter registered against the subclass of MultiPageEditorPart return that.
protected  CompositegetContainer()
     Returns the composite control containing this multi-page editor's pages. This should be used as the parent when creating controls for the individual pages.
protected  ControlgetControl(int pageIndex)
     Returns the control for the given page index, or null if no control has been set for the page.
protected  IEditorPartgetEditor(int pageIndex)
     Returns the editor for the given page index.
protected  intgetPageCount()
     Returns the number of pages in this multi-page editor.
protected  ImagegetPageImage(int pageIndex)
     Returns the image for the page with the given index, or null if no image has been set for the page.
protected  StringgetPageText(int pageIndex)
     Returns the text label for the page with the given index.
protected  voidhandlePropertyChange(int propertyId)
     Handles a property change notification from a nested editor.
public  voidinit(IEditorSite site, IEditorInput input)
     The MultiPageEditorPart implementation of this IEditorPart method sets its site to the given site, its input to the given input, and the site's selection provider to a MultiPageSelectionProvider.
public  booleanisDirty()
     The MultiPageEditorPart implementation of this IEditorPart method returns whether the contents of any of this multi-page editor's nested editors have changed since the last save.
protected  voidpageChange(int newPageIndex)
     Notifies this multi-page editor that the page with the given id has been activated.
public  voidremovePage(int pageIndex)
     Removes the page with the given index from this multi-page editor.
final public  voidsetActiveEditor(IEditorPart editorPart)
     Set the active page of this multi-page editor to the page that contains the given editor part.
protected  voidsetActivePage(int pageIndex)
     Sets the currently active page.
protected  voidsetControl(int pageIndex, Control control)
     Sets the control for the given page index.
public  voidsetFocus()
     The MultiPageEditor implementation of this IWorkbenchPart method sets focus on the active nested editor, if there is one.
protected  voidsetPageImage(int pageIndex, Image image)
     Sets the image for the page with the given index, or null to clear the image for the page.
protected  voidsetPageText(int pageIndex, String text)
     Sets the text label for the page with the given index.


Constructor Detail
MultiPageEditorPart
protected MultiPageEditorPart()(Code)
Creates an empty multi-page editor with no pages.




Method Detail
addPage
public int addPage(Control control)(Code)
Creates and adds a new page containing the given control to this multi-page editor. The control may be null, allowing it to be created and set later using setControl.
Parameters:
  control - the control, or null the index of the new page
See Also:   MultiPageEditorPart.setControl(intControl)



addPage
public void addPage(int index, Control control)(Code)
Creates and adds a new page containing the given control to this multi-page editor. The page is added at the given index. The control may be null, allowing it to be created and set later using setControl.
Parameters:
  index - the index at which to add the page (0-based)
Parameters:
  control - the control, or null
See Also:   MultiPageEditorPart.setControl(intControl)



addPage
public int addPage(IEditorPart editor, IEditorInput input) throws PartInitException(Code)
Creates and adds a new page containing the given editor to this multi-page editor. This also hooks a property change listener on the nested editor.
Parameters:
  editor - the nested editor
Parameters:
  input - the input for the nested editor the index of the new page
exception:
  PartInitException - if a new page could not be created
See Also:   MultiPageEditorPart.handlePropertyChange(int)
See Also:    the handler for
See Also:   property change events from the nested editor



addPage
public void addPage(int index, IEditorPart editor, IEditorInput input) throws PartInitException(Code)
Creates and adds a new page containing the given editor to this multi-page editor. The page is added at the given index. This also hooks a property change listener on the nested editor.
Parameters:
  index - the index at which to add the page (0-based)
Parameters:
  editor - the nested editor
Parameters:
  input - the input for the nested editor
exception:
  PartInitException - if a new page could not be created
See Also:   MultiPageEditorPart.handlePropertyChange(int)
See Also:    the handler for
See Also:   property change events from the nested editor



createPageContainer
protected Composite createPageContainer(Composite parent)(Code)
Creates the parent control for the container returned by MultiPageEditorPart.getContainer() .

Subclasses may extend and must call super implementation first.


Parameters:
  parent - the parent for all of the editors contents. the parent for this editor's container. Must not benull.
since:
   3.2



createPages
abstract protected void createPages()(Code)
Creates the pages of this multi-page editor.

Subclasses must implement this method.




createPartControl
final public void createPartControl(Composite parent)(Code)
The MultiPageEditor implementation of this IWorkbenchPart method creates the control for the multi-page editor by calling createContainer, then createPages. Subclasses should implement createPages rather than overriding this method.
Parameters:
  parent - The parent in which the editor should be created; must not benull.



createSite
protected IEditorSite createSite(IEditorPart editor)(Code)
Creates the site for the given nested editor. The MultiPageEditorPart implementation of this method creates an instance of MultiPageEditorSite. Subclasses may reimplement to create more specialized sites.
Parameters:
  editor - the nested editor the editor site



dispose
public void dispose()(Code)
The MultiPageEditorPart implementation of this IWorkbenchPart method disposes all nested editors. Subclasses may extend.



findEditors
final public IEditorPart[] findEditors(IEditorInput input)(Code)
Find the editors contained in this multi-page editor whose editor input match the provided input.
Parameters:
  input - the editor input the editors contained in this multi-page editorwhose editor input match the provided input
since:
   3.3



getActiveEditor
protected IEditorPart getActiveEditor()(Code)
Returns the active nested editor if there is one.

Subclasses should not override this method

the active nested editor, or null if none



getActivePage
protected int getActivePage()(Code)
Returns the index of the currently active page, or -1 if there is no active page.

Subclasses should not override this method

the index of the active page, or -1 if there is no active page



getAdapter
public Object getAdapter(Class adapter)(Code)
If there is an adapter registered against the subclass of MultiPageEditorPart return that. Otherwise, delegate to the internal editor.
See Also:   org.eclipse.ui.part.WorkbenchPart.getAdapter(java.lang.Class)



getContainer
protected Composite getContainer()(Code)
Returns the composite control containing this multi-page editor's pages. This should be used as the parent when creating controls for the individual pages. That is, when calling addPage(Control), the passed control should be a child of this container.

Warning: Clients should not assume that the container is any particular subclass of Composite. The actual class used may change in order to improve the look and feel of multi-page editors. Any code making assumptions on the particular subclass would thus be broken.

Subclasses should not override this method

the composite, or null ifcreatePartControl has not been called yet



getControl
protected Control getControl(int pageIndex)(Code)
Returns the control for the given page index, or null if no control has been set for the page. The page index must be valid.

Subclasses should not override this method


Parameters:
  pageIndex - the index of the page the control for the specified page, or null ifnone has been set



getEditor
protected IEditorPart getEditor(int pageIndex)(Code)
Returns the editor for the given page index. The page index must be valid.
Parameters:
  pageIndex - the index of the page the editor for the specified page, or null if thespecified page was not created withaddPage(IEditorPart,IEditorInput)



getPageCount
protected int getPageCount()(Code)
Returns the number of pages in this multi-page editor. the number of pages



getPageImage
protected Image getPageImage(int pageIndex)(Code)
Returns the image for the page with the given index, or null if no image has been set for the page. The page index must be valid.
Parameters:
  pageIndex - the index of the page the image, or null if none



getPageText
protected String getPageText(int pageIndex)(Code)
Returns the text label for the page with the given index. Returns the empty string if no text label has been set for the page. The page index must be valid.
Parameters:
  pageIndex - the index of the page the text label for the page



handlePropertyChange
protected void handlePropertyChange(int propertyId)(Code)
Handles a property change notification from a nested editor. The default implementation simply forwards the change to listeners on this multi-page editor by calling firePropertyChange with the same property id. For example, if the dirty state of a nested editor changes (property id IEditorPart.PROP_DIRTY), this method handles it by firing a property change event for IEditorPart.PROP_DIRTY to property listeners on this multi-page editor.

Subclasses may extend or reimplement this method.


Parameters:
  propertyId - the id of the property that changed



init
public void init(IEditorSite site, IEditorInput input) throws PartInitException(Code)
The MultiPageEditorPart implementation of this IEditorPart method sets its site to the given site, its input to the given input, and the site's selection provider to a MultiPageSelectionProvider. Subclasses may extend this method.
Parameters:
  site - The site for which this part is being created; must not benull.
Parameters:
  input - The input on which this editor should be created; must not benull.
throws:
  PartInitException - If the initialization of the part fails -- currently never.



isDirty
public boolean isDirty()(Code)
The MultiPageEditorPart implementation of this IEditorPart method returns whether the contents of any of this multi-page editor's nested editors have changed since the last save. Pages created with addPage(Control) are ignored.

Subclasses may extend or reimplement this method.

true if any of the nested editors are dirty;false otherwise.



pageChange
protected void pageChange(int newPageIndex)(Code)
Notifies this multi-page editor that the page with the given id has been activated. This method is called when the user selects a different tab.

The MultiPageEditorPart implementation of this method sets focus to the new page, and notifies the action bar contributor (if there is one). This checks whether the action bar contributor is an instance of MultiPageEditorActionBarContributor, and, if so, calls setActivePage with the active nested editor. This also fires a selection change event if required.

Subclasses may extend this method.


Parameters:
  newPageIndex - the index of the activated page



removePage
public void removePage(int pageIndex)(Code)
Removes the page with the given index from this multi-page editor. The controls for the page are disposed of; if the page has an editor, it is disposed of too. The page index must be valid.
Parameters:
  pageIndex - the index of the page
See Also:   MultiPageEditorPart.addPage(Control)
See Also:   MultiPageEditorPart.addPage(IEditorPartIEditorInput)



setActiveEditor
final public void setActiveEditor(IEditorPart editorPart)(Code)
Set the active page of this multi-page editor to the page that contains the given editor part. This method has no effect of the given editor part is not contained in this multi-page editor.
Parameters:
  editorPart - the editor part
since:
   3.3



setActivePage
protected void setActivePage(int pageIndex)(Code)
Sets the currently active page.
Parameters:
  pageIndex - the index of the page to be activated; the index must be valid



setControl
protected void setControl(int pageIndex, Control control)(Code)
Sets the control for the given page index. The page index must be valid.
Parameters:
  pageIndex - the index of the page
Parameters:
  control - the control for the specified page, or null toclear the control



setFocus
public void setFocus()(Code)
The MultiPageEditor implementation of this IWorkbenchPart method sets focus on the active nested editor, if there is one.

Subclasses may extend or reimplement.




setPageImage
protected void setPageImage(int pageIndex, Image image)(Code)
Sets the image for the page with the given index, or null to clear the image for the page. The page index must be valid.
Parameters:
  pageIndex - the index of the page
Parameters:
  image - the image, or null



setPageText
protected void setPageText(int pageIndex, String text)(Code)
Sets the text label for the page with the given index. The page index must be valid. The text label must not be null.
Parameters:
  pageIndex - the index of the page
Parameters:
  text - the text label



Methods inherited from org.eclipse.ui.part.EditorPart
final protected void checkSite(IWorkbenchPartSite site)(Code)(Java Doc)
abstract public void doSave(IProgressMonitor monitor)(Code)(Java Doc)
abstract public void doSaveAs()(Code)(Java Doc)
public IEditorInput getEditorInput()(Code)(Java Doc)
public IEditorSite getEditorSite()(Code)(Java Doc)
public String getTitleToolTip()(Code)(Java Doc)
abstract public void init(IEditorSite site, IEditorInput input) throws PartInitException(Code)(Java Doc)
abstract public boolean isDirty()(Code)(Java Doc)
abstract public boolean isSaveAsAllowed()(Code)(Java Doc)
public boolean isSaveOnCloseNeeded()(Code)(Java Doc)
protected void setContentDescription(String description)(Code)(Java Doc)
void setDefaultTitle()(Code)(Java Doc)
public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data)(Code)(Java Doc)
protected void setInput(IEditorInput input)(Code)(Java Doc)
protected void setInputWithNotify(IEditorInput input)(Code)(Java Doc)
protected void setPartName(String partName)(Code)(Java Doc)

Methods inherited from org.eclipse.ui.part.WorkbenchPart
public void addPartPropertyListener(IPropertyChangeListener listener)(Code)(Java Doc)
public void addPropertyListener(IPropertyListener l)(Code)(Java Doc)
protected void checkSite(IWorkbenchPartSite site)(Code)(Java Doc)
abstract public void createPartControl(Composite parent)(Code)(Java Doc)
public void dispose()(Code)(Java Doc)
protected void firePartPropertyChanged(String key, String oldValue, String newValue)(Code)(Java Doc)
protected void firePropertyChange(int propertyId)(Code)(Java Doc)
public Object getAdapter(Class adapter)(Code)(Java Doc)
protected IConfigurationElement getConfigurationElement()(Code)(Java Doc)
public String getContentDescription()(Code)(Java Doc)
protected Image getDefaultImage()(Code)(Java Doc)
public int getOrientation()(Code)(Java Doc)
public String getPartName()(Code)(Java Doc)
public Map getPartProperties()(Code)(Java Doc)
public String getPartProperty(String key)(Code)(Java Doc)
public IWorkbenchPartSite getSite()(Code)(Java Doc)
public String getTitle()(Code)(Java Doc)
public Image getTitleImage()(Code)(Java Doc)
public String getTitleToolTip()(Code)(Java Doc)
void internalSetContentDescription(String description)(Code)(Java Doc)
void internalSetPartName(String partName)(Code)(Java Doc)
public void removePartPropertyListener(IPropertyChangeListener listener)(Code)(Java Doc)
public void removePropertyListener(IPropertyListener l)(Code)(Java Doc)
protected void setContentDescription(String description)(Code)(Java Doc)
void setDefaultTitle()(Code)(Java Doc)
abstract public void setFocus()(Code)(Java Doc)
public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data)(Code)(Java Doc)
protected void setPartName(String partName)(Code)(Java Doc)
public void setPartProperty(String key, String value)(Code)(Java Doc)
protected void setSite(IWorkbenchPartSite site)(Code)(Java Doc)
protected void setTitle(String title)(Code)(Java Doc)
protected void setTitleImage(Image titleImage)(Code)(Java Doc)
protected void setTitleToolTip(String toolTip)(Code)(Java Doc)
public void showBusy(boolean busy)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.