Package org.eclipse.ui
Interface IPerspectiveRegistry
-
public interface IPerspectiveRegistryThe workbench's global registry of perspectives.This registry contains a descriptor for each perspectives in the workbench. It is initially populated with stock perspectives from the workbench's perspective extension point (
"org.eclipse.ui.perspectives") and with custom perspectives defined by the user.This interface is not intended to be implemented by clients.
- See Also:
IWorkbench.getPerspectiveRegistry()- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IPerspectiveDescriptorclonePerspective(String id, String label, IPerspectiveDescriptor desc)Clones an existing perspective.voiddeletePerspective(IPerspectiveDescriptor persp)Deletes a perspective.IPerspectiveDescriptorfindPerspectiveWithId(String perspectiveId)Finds and returns the registered perspective with the given perspective id.IPerspectiveDescriptorfindPerspectiveWithLabel(String label)Finds and returns the registered perspective with the given label.StringgetDefaultPerspective()Returns the id of the default perspective for the workbench.IPerspectiveDescriptor[]getPerspectives()Returns a list of the perspectives known to the workbench.voidrevertPerspective(IPerspectiveDescriptor perspToRevert)Reverts a perspective back to its original definition as specified in the plug-in manifest.voidsetDefaultPerspective(String id)Sets the default perspective for the workbench to the given perspective id.
-
-
-
Method Detail
-
clonePerspective
IPerspectiveDescriptor clonePerspective(String id, String label, IPerspectiveDescriptor desc) throws IllegalArgumentException
Clones an existing perspective.- Parameters:
id- the id for the cloned perspective, which must not already be used by any registered perspectivelabel- the label assigned to the cloned perspectivedesc- the perspective to clone- Returns:
- the cloned perspective descriptor
- Throws:
IllegalArgumentException- if there is already a perspective with the given id- Since:
- 3.0
-
deletePerspective
void deletePerspective(IPerspectiveDescriptor persp)
Deletes a perspective. Has no effect if the perspective is defined in an extension.- Parameters:
persp- the perspective to delete- Since:
- 3.2
-
findPerspectiveWithId
IPerspectiveDescriptor findPerspectiveWithId(String perspectiveId)
Finds and returns the registered perspective with the given perspective id.- Parameters:
perspectiveId- the perspective id- Returns:
- the perspective, or
nullif none - See Also:
IPerspectiveDescriptor.getId()
-
findPerspectiveWithLabel
IPerspectiveDescriptor findPerspectiveWithLabel(String label)
Finds and returns the registered perspective with the given label.- Parameters:
label- the label- Returns:
- the perspective, or
nullif none - See Also:
IPerspectiveDescriptor.getLabel()
-
getDefaultPerspective
String getDefaultPerspective()
Returns the id of the default perspective for the workbench. This identifies one perspective extension within the workbench's perspective registry.Returns
nullif there is no default perspective.- Returns:
- the default perspective id, or
null
-
getPerspectives
IPerspectiveDescriptor[] getPerspectives()
Returns a list of the perspectives known to the workbench.- Returns:
- a list of perspectives
-
setDefaultPerspective
void setDefaultPerspective(String id)
Sets the default perspective for the workbench to the given perspective id. If non-null, the id must correspond to a perspective extension within the workbench's perspective registry.A
nullid indicates no default perspective.- Parameters:
id- a perspective id, ornull
-
revertPerspective
void revertPerspective(IPerspectiveDescriptor perspToRevert)
Reverts a perspective back to its original definition as specified in the plug-in manifest.- Parameters:
perspToRevert- the perspective to revert- Since:
- 3.0
-
-