Getting Started with RCP (Rich Client Platform) (3)

xiaoxiao2021-03-06  104

3, define perspective

(1) Perspective Overview

The perspective in the Eclipse table is a visual container for all open views and editors.

l When you create a perspective in your RCP application, consider the following:

l Define the purpose of perspective

Ø Since only one perspective is displayed each time, you need to group the logical and functional area of ​​the application to a unified perspective, the method minimizes the user to switch between different perspectives to complete a specific task. Need

Ø Remember, a view or editor cannot be shared by different perspective

Ø The number of perspective of the application depends to a large extent on the size and complexity of the application; for our Google example application, only need to define a perspective

l Define the behavior of perspective

Ø This depends on your application, a perspective with its own view, editor, and action collection, can be designed to perform different functions

Ø Perspective behavior is a task, providing a series of tools to end users to complete specific goals

(2) Creating a basic perspective

l Firstly to modify Plugin.xml, increase perspective extension (as shown in the foregoing), the extension uses org.eclipse.ui.Perspectives extension point

Point = "Org.eclipse.ui.Perspectives">

Class = "com.xqtu.google.googlePerspective"

Name = "Google"

ID = "com.xqtu.google.googlePerspective" />

l Here, let's talk about the attribute of the tag

Ø ID: Perspective map only identifier

Ø Name: Perspective name, the Workbench window menu bar will use it to indicate this perspective

Ø Class: Realize the full path to the perspective map class of the org.eclipse.ui.iperspectiveFactory interface

l Secretary is to create a perspective graph

Package com.xqtu.google;

Import org.eclipse.ui.ipagelight;

Import Org.eclipse.ui.iPerspectiveFactory;

Public Class GooglePective Implements IPerspectiveFactory {

Public void createinitialLayout (iPageLayout Layout) {

}

}

l createInitialLayout () method Defines the initial layout of all views and editors in the perspective; currently, there is no need to modify the method

转载请注明原文地址:https://www.9cbs.com/read-125362.html

New Post(0)