KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > IPerspectiveRegistry


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui;
12
13 /**
14  * The workbench's global registry of perspectives.
15  * <p>
16  * This registry contains a descriptor for each perspectives in the workbench.
17  * It is initially populated with stock perspectives from the workbench's
18  * perspective extension point (<code>"org.eclipse.ui.perspectives"</code>) and
19  * with custom perspectives defined by the user.
20  * </p><p>
21  * This interface is not intended to be implemented by clients.
22  * </p>
23  * @see IWorkbench#getPerspectiveRegistry
24  */

25 public interface IPerspectiveRegistry {
26     /**
27      * Clones an existing perspective.
28      *
29      * @param id the id for the cloned perspective, which must not already be used by
30      * any registered perspective
31      * @param label the label assigned to the cloned perspective
32      * @param desc the perspective to clone
33      * @return the cloned perspective descriptor
34      * @throws IllegalArgumentException if there is already a perspective with the given id
35      *
36      * @since 3.0
37      */

38     public IPerspectiveDescriptor clonePerspective(String JavaDoc id, String JavaDoc label,
39             IPerspectiveDescriptor desc) throws IllegalArgumentException JavaDoc;
40
41     /**
42      * Deletes a perspective. Has no effect if the perspective is defined in an
43      * extension.
44      *
45      * @param persp the perspective to delete
46      * @since 3.2
47      */

48     public void deletePerspective(IPerspectiveDescriptor persp);
49     
50     /**
51      * Finds and returns the registered perspective with the given perspective id.
52      *
53      * @param perspectiveId the perspective id
54      * @return the perspective, or <code>null</code> if none
55      * @see IPerspectiveDescriptor#getId
56      */

57     public IPerspectiveDescriptor findPerspectiveWithId(String JavaDoc perspectiveId);
58
59     /**
60      * Finds and returns the registered perspective with the given label.
61      *
62      * @param label the label
63      * @return the perspective, or <code>null</code> if none
64      * @see IPerspectiveDescriptor#getLabel
65      */

66     public IPerspectiveDescriptor findPerspectiveWithLabel(String JavaDoc label);
67
68     /**
69      * Returns the id of the default perspective for the workbench. This identifies one
70      * perspective extension within the workbench's perspective registry.
71      * <p>
72      * Returns <code>null</code> if there is no default perspective.
73      * </p>
74      *
75      * @return the default perspective id, or <code>null</code>
76      */

77     public String JavaDoc getDefaultPerspective();
78
79     /**
80      * Returns a list of the perspectives known to the workbench.
81      *
82      * @return a list of perspectives
83      */

84     public IPerspectiveDescriptor[] getPerspectives();
85
86     /**
87      * Sets the default perspective for the workbench to the given perspective id.
88      * If non-<code>null</code>, the id must correspond to a perspective extension
89      * within the workbench's perspective registry.
90      * <p>
91      * A <code>null</code> id indicates no default perspective.
92      * </p>
93      *
94      * @param id a perspective id, or <code>null</code>
95      */

96     public void setDefaultPerspective(String JavaDoc id);
97
98     /**
99      * Reverts a perspective back to its original definition
100      * as specified in the plug-in manifest.
101      *
102      * @param perspToRevert the perspective to revert
103      *
104      * @since 3.0
105      */

106     public void revertPerspective(IPerspectiveDescriptor perspToRevert);
107 }
108
Popular Tags