Summary of the Development of RCP Patient Information System (4): view layer-Perspective View of MVC pattern

Source: Internet
Author: User
1. the source code of the perspective class uses createinitiallayout to set the layout of the perspective. PackageCom. yinger. patientims;

ImportOrg. Eclipse. UI. ifolderlayout;
ImportOrg. Eclipse. UI. ipagelayout;
ImportOrg. Eclipse. UI. iperspectivefactory;

ImportCom. yinger. patientims. util. pluginutil;

/**
* A Perspective factory generates the initial page layout and visible action set for a page.
* The Perspective class must implement the iperspectivefactory interface.
* The createinitiallayout method can layout the perspective chart.
*/
Public ClassPerspectiveImplementsIperspectivefactory {

// This method is used to initialize the layout of the perspective. You can register the view in the project here.
Public VoidCreateinitiallayout (ipagelayout layout ){
// Obtain the ID of the editing area.
String editorarea = layout. geteditorarea (); // returns the special identifier for the editor area in this page layout

// Add a navigation View
// String viewid, int relationship, float ratio, string refID
Layout. addview (pluginutil. navigatorview_id, ipagelayout. Left, 0.3f, editorarea );

// Add a search View to the bottom of the navigation View
// An ifolderlayout is used to define the initial views within a folder. The folder itself is contained within an ipagelayout.
// Ifolderlayout is used to add a folder (Folder function) to an existing view. This folder itself contains ipagelayout
Ifolderlayout leftbottom = layout. createfolder ("Left", ipagelayout. Bottom, 0.4f, pluginutil. navigatorview_id );
Leftbottom. addview (pluginutil. searchview_id );

// Adds a view of patient information and expense information, and overlays the two views.
Ifolderlayout rightbottom = layout. createfolder ("rightbottom", ipagelayout. Bottom, 0.7f, editorarea );
Rightbottom. addview (pluginutil. patientinfoview_id );
Rightbottom. addview (pluginutil. expenseinfoview_id );

}
} 2. conclusion (1) do not place the IDs of each component in pluginutil for unified management. You can add a static final string to each component implementation class. (2) the layout of the perspective is generally in the left-side navigation bar, with the editor mode on the right. The editor should be empty by default.

Publish via wiz

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.