KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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 import org.eclipse.jface.resource.ImageDescriptor;
14
15 /**
16  * A perspective descriptor describes a perspective in an
17  * <code>IPerspectiveRegistry</code>.
18  * <p>
19  * A perspective is a template for view visibility, layout, and action visibility
20  * within a workbench page. There are two types of perspective: a predefined
21  * perspective and a custom perspective.
22  * <ul>
23  * <li>A predefined perspective is defined by an extension to the workbench's
24  * perspective extension point (<code>"org.eclipse.ui.perspectives"</code>).
25  * The extension defines a id, label, and <code>IPerspectiveFactory</code>.
26  * A perspective factory is used to define the initial layout for a page.
27  * </li>
28  * <li>A custom perspective is defined by the user. In this case a predefined
29  * perspective is modified to suit a particular task and saved as a new
30  * perspective. The attributes for the perspective are stored in a separate file
31  * in the workbench's metadata directory.
32  * </li>
33  * </ul>
34  * </p>
35  * <p>
36  * Within a page the user can open any of the perspectives known
37  * to the workbench's perspective registry, typically by selecting one from the
38  * workbench's <code>Open Perspective</code> menu. When selected, the views
39  * and actions within the active page rearrange to reflect the perspective.
40  * </p>
41  * <p>
42  * This interface is not intended to be implemented by clients.
43  * </p>
44  * @see IPerspectiveRegistry
45  */

46 public interface IPerspectiveDescriptor {
47     /**
48      * Returns the description of this perspective.
49      * This is the value of its <code>"description"</code> attribute.
50      *
51      * @return the description
52      * @since 3.0
53      */

54     public String JavaDoc getDescription();
55
56     /**
57      * Returns this perspective's id. For perspectives declared via an extension,
58      * this is the value of its <code>"id"</code> attribute.
59      *
60      * @return the perspective id
61      */

62     public String JavaDoc getId();
63
64     /**
65      * Returns the descriptor of the image to show for this perspective.
66      * If the extension for this perspective specifies an image, the descriptor
67      * for it is returned. Otherwise a default image is returned.
68      *
69      * @return the descriptor of the image to show for this perspective
70      */

71     public ImageDescriptor getImageDescriptor();
72
73     /**
74      * Returns this perspective's label. For perspectives declared via an extension,
75      * this is the value of its <code>"label"</code> attribute.
76      *
77      * @return the label
78      */

79     public String JavaDoc getLabel();
80 }
81
Popular Tags