Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 org.eclips.ui package org.eclipse.ui. 2 Package org.eclipse.ui Description l Application programming interfaces for interaction with any extension of.

Similar presentations


Presentation on theme: "1 org.eclips.ui package org.eclipse.ui. 2 Package org.eclipse.ui Description l Application programming interfaces for interaction with any extension of."— Presentation transcript:

1 1 org.eclips.ui package org.eclipse.ui

2 2 Package org.eclipse.ui Description l Application programming interfaces for interaction with any extension of the Eclipse Platform User Interface.

3 3 l PlatformUI class (Starting class) provides access to a single workbench. l A workbench is the root object for the UI and has one or more workbench windows. l Each workbench window has a collection of workbench pages, only one of which is active and visible to the end user. l Each workbench page has a collection of workbench parts. »A page's parts are arranged (tiled or stacked) for presentation on the screen. »Within a page and its parts the user can interact with and modify a model (typically resources in a workspace).

4 4 IWorkbench IWorkbenchWindow IEditorPart IWorkbenchPage IViewPart IWorkbenchPart PlatfromUI getWrokbench() 1 m 1 m activePage 1 1 1 m Containment Hierarchy of UI components

5 5 l There are two kinds of workbench parts: views and editors. l An editor is typically used to edit or browse a document or input object. l A view is typically used to navigate a hierarchy of information (like the workspace), open an editor, or display properties for the active editor.

6 6 l The platform creates a workbench when the workbench plug-in is activated. l Since this happens at most once during the life of the running platform, there is only one workbench instance. Due to its singular nature, it is commonly referred to as the workbench. l Within a workbench the user will interact with many different resource types. Because different tools are required for each, the workbench defines a number of extension points which allow for the integration of new tools. There are extension points for views, editors, action sets, import wizards, export wizards, etc.

7 7

8 8 org.eclipse.ui.PlatformUI l public final class PlatformUI extends Object »The central class for access to the Eclipse Platform User Interface. »cannot be instantiated; all functionality is provided by static methods. »Features provided: access to the workbench. l static String PLUGIN_ID = "org.eclipse.ui" »Identifies the workbench plugin. static IWorkbench getWorkbench() »Returns the workbench interface.

9 9 IWorkbench l A workbench is the root object for the Eclipse Platform user interface. »has one or more main windows which present to the end user information based on some underlying model, typically on resources in an underlying workspace. »usually starts with a single open window, and automatically closes when its last window closes.

10 10 Method Summary void addWindowListener( IWindowListener listener) » Adds a window listener. l boolean close() »Closes this workbench and all its open windows. l IWorkbenchWindow getActiveWorkbenchWindow() »Returns the currently active window for this workbench (if any). l IDecoratorManager getDecoratorManager() »Returns the decorator manager. l IEditorRegistry getEditorRegistry() »Returns the editor registry for the workbench. l IMarkerHelpRegistry getMarkerHelpRegistry() »Returns the marker help registry for the workbench.

11 11 l IPerspectiveRegistry getPerspectiveRegistry() »Returns the perspective registry for the workbench. l PreferenceManager getPreferenceManager() »Returns the preference manager for the workbench. l IPreferenceStore getPreferenceStore() »Returns the preference store for the workbench. l ISharedImages getSharedImages() »Returns the shared images for the workbench. l IWorkbenchWindow[] getWorkbenchWindows() »Returns a list of the open main windows associated with this workbench. l IWorkingSetManager getWorkingSetManager() »Returns the working set manager for the workbench.

12 12 IWorkbenchWindow openWorkbenchWindow (IAdaptable input) »Creates and opens a new workbench window with one page. IWorkbenchWindow openWorkbenchWindow (String perspID, IAdaptable input) »Creates and opens a new workbench window with one page. l void removeWindowListener(IWindowListener l) »Removes a window listener. l boolean restart() »Closes then restarts this workbench.

13 13 l IWorkbenchPage showPerspective (String perspectiveId, IWorkbenchWindow window) l IWorkbenchPage showPerspective( String perspectiveId, IWorkbenchWindow window, IAdaptable input) »Shows the specified perspective to the user.

14 14 IWorkbenchSite l All Known Subinterfaces: »IEditorSite, IPageSite, »IViewSite, IWorkbenchPartSite l All Known Implementing Classes: »MultiPageEditorSite, PageSite l The common interface between the workbench and its parts, including pages within parts. l Not intended to be implemented or extended by clients.

15 15 Method Summary IWorkbenchPage getPage() »Returns the page containing this workbench site. l Shell getShell() »Returns the shell for this workbench site. l IWorkbenchWindow getWorkbenchWindow() »Returns the workbench window containing this workbench site. l ISelectionProvider getSelectionProvider() »Returns the selection provider for this workbench site. l void setSelectionProvider(ISelectionProvider provider) »Sets the selection provider for this workbench site.

16 16 IWorkbenchPage l public interface IWorkbenchPage extends IPartService, ISelectionService l A workbench page consists of an arrangement of views and editors intended to be presented together to the user in a single workbench window. l A page can contain 0 or more views and 0 or more editors. »These views and editors are contained wholly within the page and are not shared with other pages. »The layout and visible action set for the page is defined by a perspective.

17 17 l The number of views and editors within a page is restricted to simplify part management for the user. In particular: »Only one instance of a particular view type may exist within a workbench page. »Only one editor can exist for each editor input (i.e., resource) within a page. l This interface is not intended to be implemented by clients.

18 18 Method Summary l void activate(IWorkbenchPart part) »Activates the given part.part must belongs to this page. l void addPropertyChangeListener (IPropertyChangeListener listener) »D eprecated. l void bringToTop(IWorkbenchPart part) »Moves the given part forward in the Z order of this page so as to make it visible, without changing which part has focus. l boolean close() »Closes this workbench page. l boolean closeAllEditors(boolean save) »Closes all of the editors belonging to this workbench page.

19 19 l boolean closeEditor ( IEditorPart editor, boolean save) »Closes the given editor. l IEditorPart findEditor(IEditorInput input) »Returns the editor with the specified input. l IViewPart findView(String viewId) »Returns the view in this page with the specified id. l IEditorPart getActiveEditor() »Returns the active editor open in this page. l IEditorPart[] getDirtyEditors() »Returns a list of dirty editors in this page. l IEditorReference[] getEditorReferences() »Returns a array of references to open editors in this page.

20 20 l int getEditorReuseThreshold() »Deprecated. l IEditorPart[] getEditors() »Deprecated. use getEditorReferences() instead l IAdaptable getInput() »Returns the input for this page. l String getLabel() »Returns the page label. l IPerspectiveDescriptor getPerspective() »Returns the current perspective descriptor for this page. IViewReference[] getViewReferences() »Returns a list of the reference to views visible on this page.

21 21 l IViewPart[] getViews() »Deprecated. use getViewReferences() instead. l IWorkbenchWindow getWorkbenchWindow() »Returns the workbench window of this page. l IWorkingSet getWorkingSet() »Deprecated. individual views should store a working set if needed l void hideActionSet(String actionSetID) »Hides an action set in this page. l void hideView(IViewPart view) »Hides the given view.

22 22 l boolean isEditorAreaVisible() »Returns whether the page's current perspective is showing the editor area. l IEditorPart openEditor( (IEditorInput | IFile ) input [, String editorId [, boolean activate]]) »Opens an editor on the given input object. »editorId is the extension id in plugin.xml IEditorPart openEditor(IMarker marker [, boolean activate]) »Opens an editor on the file resource of the given marker. l void openSystemEditor(IFile input) »Opens an operating system editor on a given file. l void removePropertyChangeListener (IPropertyChangeListener listener) »Deprecated.

23 23 l void resetPerspective() »Changes the visible views, their layout, and the visible action sets within the page to match the current perspective descriptor. l boolean saveAllEditors(boolean confirm) »Saves the contents of all dirty editors belonging to this workbench page. l boolean saveEditor(IEditorPart editor, boolean confirm) »Saves the contents of the given editor if dirty. l void savePerspective() »Saves the visible views, their layout, and the visible action sets for this page to the current perspective descriptor.

24 24 l void savePerspectiveAs( IPerspectiveDescriptor perspective) »Saves the visible views, their layout, and the visible action sets for this page to the given perspective descriptor. l void setEditorAreaVisible(boolean showEditorArea) »Show or hide the editor area for the page's active perspective. l void setEditorReuseThreshold(int openEditors) »Deprecated. l void setPerspective(IPerspectiveDescriptor perspective) »Changes the visible views, their layout, and the visible action sets within the page to match the given perspective descriptor.

25 25 l void showActionSet(String actionSetID) »Shows an action set in this page. l IViewPart showView(String viewId) »Shows a view in this page and give it focus.


Download ppt "1 org.eclips.ui package org.eclipse.ui. 2 Package org.eclipse.ui Description l Application programming interfaces for interaction with any extension of."

Similar presentations


Ads by Google