01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui;
11:
12: import org.eclipse.jface.resource.ImageDescriptor;
13:
14: /**
15: * A perspective descriptor describes a perspective in an
16: * <code>IPerspectiveRegistry</code>.
17: * <p>
18: * A perspective is a template for view visibility, layout, and action visibility
19: * within a workbench page. There are two types of perspective: a predefined
20: * perspective and a custom perspective.
21: * <ul>
22: * <li>A predefined perspective is defined by an extension to the workbench's
23: * perspective extension point (<code>"org.eclipse.ui.perspectives"</code>).
24: * The extension defines a id, label, and <code>IPerspectiveFactory</code>.
25: * A perspective factory is used to define the initial layout for a page.
26: * </li>
27: * <li>A custom perspective is defined by the user. In this case a predefined
28: * perspective is modified to suit a particular task and saved as a new
29: * perspective. The attributes for the perspective are stored in a separate file
30: * in the workbench's metadata directory.
31: * </li>
32: * </ul>
33: * </p>
34: * <p>
35: * Within a page the user can open any of the perspectives known
36: * to the workbench's perspective registry, typically by selecting one from the
37: * workbench's <code>Open Perspective</code> menu. When selected, the views
38: * and actions within the active page rearrange to reflect the perspective.
39: * </p>
40: * <p>
41: * This interface is not intended to be implemented by clients.
42: * </p>
43: * @see IPerspectiveRegistry
44: */
45: public interface IPerspectiveDescriptor {
46: /**
47: * Returns the description of this perspective.
48: * This is the value of its <code>"description"</code> attribute.
49: *
50: * @return the description
51: * @since 3.0
52: */
53: public String getDescription();
54:
55: /**
56: * Returns this perspective's id. For perspectives declared via an extension,
57: * this is the value of its <code>"id"</code> attribute.
58: *
59: * @return the perspective id
60: */
61: public String getId();
62:
63: /**
64: * Returns the descriptor of the image to show for this perspective.
65: * If the extension for this perspective specifies an image, the descriptor
66: * for it is returned. Otherwise a default image is returned.
67: *
68: * @return the descriptor of the image to show for this perspective
69: */
70: public ImageDescriptor getImageDescriptor();
71:
72: /**
73: * Returns this perspective's label. For perspectives declared via an extension,
74: * this is the value of its <code>"label"</code> attribute.
75: *
76: * @return the label
77: */
78: public String getLabel();
79: }
|