Eclipse Platform
2.0

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:
IWorkbenchPlugin#getPerspectiveRegistry

Method Summary
 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 setDefaultPerspective(String id)
          Sets the default perspective for the workbench to the given perspective id.
 

Method Detail

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

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

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.