Develop > Presentation layer > Customize IBM Sales Center > Perspectives


Add a perspective

A perspective is a particular rendering of the IBM Sales Center that contains a predefined combination of views and editors. There are two perspectives in the IBM Sales Center, the Orders and Web Browser perspectives, that enable different sets of tasks. Both perspectives can be open and visible, but only one can be active at a time. This section explains how to add a perspective.

To add a new perspective:


Procedure

  1. Define an extension to the base Eclipse extension point org.eclipse.ui.perspectives. This declaration contains the following basic elements: id, name and class.

    <extension
             point="org.eclipse.ui.perspectives">  
    <perspective
                    name="New"
                    
                    id="com.xyz.perspective.newPerspective">  
    </perspective>
    </extension>
    

  2. Create a new perspective class to define the initial layout of the perspective. You can write this class from scratch or subclass com.ibm.commerce.telesales.ui.impl.OrdersPerspective, see class API information (Javadoc) for more details. This class must implement org.eclipse.ui.IPerspectiveFactory and its one method, createInitialLayout. Implementers can add views, folders, actions, action sets, and other objects to the page layout. In this example, com.xyz.perspective.NewPerspective is the class that will define the initial layout of the perspective:

    package com.xyz.perspective; 
    import org.eclipse.ui.IPageLayout; import org.eclipse.ui.IPerspectiveFactory; 
    public class PerspectiveFactory implements IPerspectiveFactory {
    
            public void createInitialLayout(IPageLayout layout) {
    
               defineActions(layout);         }
    }
    

    The method defineActions defines actions associated with this new perspective.

    An alternate method is to supply an IPerspectiveFactory that does nothing, and then use the perspective extension mechanism (see the Extending a perspective topic) to define its contents in XML instead of in code.

  3. Define an application to select the perspective. In the WebSphere Everyplace Deployment platform, perspectives are accessed by selecting an application. Applications are defined using the WebSphere Everyplace Deployment com.ibm.eswe.workbench.WctApplication extension point. For example:

    <extension
    id="com.xyz.newApplication"
    point="com.ibm.eswe.workbench.WctApplication">
    <DisplayName>New application</DisplayName>
    <Icon>icons/full/eview16/new_perspective.gif</Icon>
    <PerspectiveId> com.xyz.perspective.NewPerspective
    </PerspectiveId>
    <Version>6.0.0</Version>
    <Description>This is a new application</Description>
    </extension>
    


Related concepts

Perspectives

Overview of customizing IBM Sales Center


Related tasks

Extend a perspective

Remove a perspective


+

Search Tips   |   Advanced Search