Java Doc for IWorkbenchPart.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.eclipse.ui.IWorkbenchPart

IWorkbenchPart
public interface IWorkbenchPart extends IAdaptable(Code)
A workbench part is a visual component within a workbench page. There are two subtypes: view and editor, as defined by IViewPart and IEditorPart.

A view is typically used to navigate a hierarchy of information (like the workspace), open an editor, or display properties for the active editor. Modifications made in a view are saved immediately.

An editor is typically used to edit or browse a document or input object. The input is identified using an IEditorInput. Modifications made in an editor part follow an open-save-close lifecycle model.

This interface may be implemented directly. For convenience, a base implementation is defined in WorkbenchPart.

The lifecycle of a workbench part is as follows:

  • When a part extension is created:
    • instantiate the part
    • create a part site
    • call part.init(site)
  • When a part becomes visible in the workbench:
    • add part to presentation by calling part.createControl(parent) to create actual widgets
    • fire partOpened event to all listeners
  • When a part is activated or gets focus:
    • call part.setFocus()
    • fire partActivated event to all listeners
  • When a part is closed:
    • if save is needed, do save; if it fails or is canceled return
    • if part is active, deactivate part
    • fire partClosed event to all listeners
    • remove part from presentation; part controls are disposed as part of the SWT widget tree
    • call part.dispose()

After createPartControl has been called, the implementor may safely reference the controls created. When the part is closed these controls will be disposed as part of an SWT composite. This occurs before the IWorkbenchPart.dispose method is called. If there is a need to free SWT resources the part should define a dispose listener for its own control and free those resources from the dispose listener. If the part invokes any method on the disposed SWT controls after this point an SWTError will be thrown.

The last method called on IWorkbenchPart is dispose. This signals the end of the part lifecycle.

An important point to note about this lifecycle is that following a call to init, createControl may never be called. Thus in the dispose method, implementors must not assume controls were created.

Workbench parts implement the IAdaptable interface; extensions are managed by the platform's adapter manager.


See Also:   IViewPart
See Also:   IEditorPart


Field Summary
final public static  intPROP_TITLE
     The property id for getTitle, getTitleImage and getTitleToolTip.


Method Summary
public  voidaddPropertyListener(IPropertyListener listener)
     Adds a listener for changes to properties of this workbench part.
public  voidcreatePartControl(Composite parent)
     Creates the SWT controls for this workbench part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the site's IActionBars.
  4. Register any context menus with the site.
  5. Register a selection provider with the site, to make it available to the workbench's ISelectionService (optional).
public  voiddispose()
     Disposes of this workbench part.

This is the last method called on the IWorkbenchPart.

public  IWorkbenchPartSitegetSite()
     Returns the site for this workbench part.
public  StringgetTitle()
     Returns the title of this workbench part.
public  ImagegetTitleImage()
     Returns the title image of this workbench part.
public  StringgetTitleToolTip()
     Returns the title tool tip text of this workbench part.
public  voidremovePropertyListener(IPropertyListener listener)
     Removes the given property listener from this workbench part.
public  voidsetFocus()
     Asks this part to take focus within the workbench.

Clients should not call this method (the workbench calls this method at appropriate times).


Field Detail
PROP_TITLE
final public static int PROP_TITLE(Code)
The property id for getTitle, getTitleImage and getTitleToolTip.





Method Detail
addPropertyListener
public void addPropertyListener(IPropertyListener listener)(Code)
Adds a listener for changes to properties of this workbench part. Has no effect if an identical listener is already registered.

The property ids are defined in IWorkbenchPartConstants .


Parameters:
  listener - a property listener



createPartControl
public void createPartControl(Composite parent)(Code)
Creates the SWT controls for this workbench part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the site's IActionBars.
  4. Register any context menus with the site.
  5. Register a selection provider with the site, to make it available to the workbench's ISelectionService (optional).


Parameters:
  parent - the parent control



dispose
public void dispose()(Code)
Disposes of this workbench part.

This is the last method called on the IWorkbenchPart. At this point the part controls (if they were ever created) have been disposed as part of an SWT composite. There is no guarantee that createPartControl() has been called, so the part controls may never have been created.

Within this method a part may release any resources, fonts, images, etc.  held by this part. It is also very important to deregister all listeners from the workbench.

Clients should not call this method (the workbench calls this method at appropriate times).




getSite
public IWorkbenchPartSite getSite()(Code)
Returns the site for this workbench part. The site can be null while the workbench part is being initialized. After the initialization is complete, this value must be non-null for the remainder of the part's life cycle. The part site; this value may be null if the parthas not yet been initialized



getTitle
public String getTitle()(Code)
Returns the title of this workbench part. If this value changes the part must fire a property listener event with PROP_TITLE.

The title is used to populate the title bar of this part's visual container.

the workbench part title (not null)



getTitleImage
public Image getTitleImage()(Code)
Returns the title image of this workbench part. If this value changes the part must fire a property listener event with PROP_TITLE.

The title image is usually used to populate the title bar of this part's visual container. Since this image is managed by the part itself, callers must not dispose the returned image.

the title image



getTitleToolTip
public String getTitleToolTip()(Code)
Returns the title tool tip text of this workbench part. An empty string result indicates no tool tip. If this value changes the part must fire a property listener event with PROP_TITLE.

The tool tip text is used to populate the title bar of this part's visual container.

the workbench part title tool tip (not null)



removePropertyListener
public void removePropertyListener(IPropertyListener listener)(Code)
Removes the given property listener from this workbench part. Has no affect if an identical listener is not registered.
Parameters:
  listener - a property listener



setFocus
public void setFocus()(Code)
Asks this part to take focus within the workbench.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IWorkbenchPage.activate(IWorkbenchPart) instead.




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