Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.ui
Interface IPerspectiveRegistry


public interface IPerspectiveRegistry

The 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()


Method Summary
 IPerspectiveDescriptor clonePerspective(String id, String label, IPerspectiveDescriptor desc)
          Clones an existing perspective.
 IPerspectiveDescriptor findPerspectiveWithId(String perspectiveId)
          Finds and returns the registered perspective with the given perspective id.
 IPerspectiveDescriptor findPerspectiveWithLabel(String label)
          Finds and returns the registered perspective with the given label.
 String getDefaultPerspective()
          Returns the id of the default perspective for the workbench.
 IPerspectiveDescriptor[] getPerspectives()
          Returns a list of the perspectives known to the workbench.
 void revertPerspective(IPerspectiveDescriptor perspToRevert)
          Reverts a perspective back to its original definition as specified in the plug-in manifest.
 void setDefaultPerspective(String id)
          Sets the default perspective for the workbench to the given perspective id.
 

Method Detail

 

 

clonePerspective

public 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 perspective
label - the label assigned to the cloned perspective
desc - the perspective to clone
Returns:
the cloned perspective descriptor
Throws:
IllegalArgumentException
Since:
3.0


 

 

findPerspectiveWithId

public IPerspectiveDescriptor findPerspectiveWithId(String perspectiveId)

Finds and returns the registered perspective with the given perspective id.

Parameters:
perspectiveId - the perspective id
Returns:
the perspective, or null if none
See Also:
IPerspectiveDescriptor.getId()


 

 

findPerspectiveWithLabel

public IPerspectiveDescriptor findPerspectiveWithLabel(String label)

Finds and returns the registered perspective with the given label.

Parameters:
label - the label
Returns:
the perspective, or null if none
See Also:
IPerspectiveDescriptor.getLabel()


 

 

getDefaultPerspective

public String getDefaultPerspective()

Returns the id of the default perspective for the workbench. This identifies one perspective extension within the workbench's perspective registry.

On startup of the platform UI the default perspective is determined using a multistep process.

  1. Initially the Resource Perspective is default.
  2. If a single perspective extension within the registry has a default attribute it will become the default perspective. If two or more extensions have the default attribute the registry will ignore all of them and select the Resource Perspective.
  3. If the user has set the default perspective within the Perspective dialog their preference will be selected over all others.

Returns:
the default perspective id; will never be null Note: revise - this is out of date (even before RCP)


 

 

getPerspectives

public IPerspectiveDescriptor[] getPerspectives()

Returns a list of the perspectives known to the workbench.

Returns:
a list of perspectives


 

 

setDefaultPerspective

public void setDefaultPerspective(String id)

Sets the default perspective for the workbench to the given perspective id. The id must correspond to one perspective extension within the workbench's perspective registry.

Parameters:
id - a perspective id; must not be null


 

 

revertPerspective

public 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


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.