How to save a view using the Saveable protocol of Eclipse CNF

Source: Internet
Author: User
Tags resource

Editor and View are the two UI elements for displaying and managing resources in Eclipse. Editor provides a convenient mechanism to help users to modify and save resources. But for view, it is to a large extent to provide a tree-like display of resources, so how to change the resources to reflect the view, and through the operation of the view to save the resources in the view? The Common Navigator Framework (CNF) provides a resource-saving mechanism (saveable Protocol) that differs from Editor to help the user to save the resources in the View.

Introduction to CNF

The Common Navigator Framework (CNF) is a set of frameworks that help users develop a content navigation view based on Eclipse, a framework in which developers can quickly integrate specific resources and models seamlessly into eclipse and leverage the APIs they provide Shown in a tree-shaped structure. The CNF originally came from the Rational®application Developer (RAD) v6.0 project and was used for Eclipse 3.2.

Next, briefly describes how to use CNF to construct a resource Navigation view for an existing model. First, using the Org.eclipse.ui.navigator extension point to specify the view that the Resource Navigator uses, the CNF framework eliminates the need for users to implement a new view, specifying the view implementation class of the extension point as Org.eclipse.ui.navigator.CommonNavigator, as shown in the following figure.

Figure 1. Org.eclipse.ui.navigator.CommonNavigator extension Point

Then, by org.eclipse.ui.navigator.navigatorContent the content that will be displayed in View, including Actionprovider,commonfilter, Commonwizard, Navigatorcontent. Among them, in Navigatorcontent, the user can define ContentProvider and Labelprovider to show the different nodes in the Resource Navigator and control the timing of the content by specifying the trigger conditions. As the following illustration shows, the provider GetElements () and GetChildren () methods will be invoked when the defined triggerpoints expression is true.

Figure 2. Triggerpoints Property

Then, by org.eclipse.ui.navigator.viewer the extension point, the content to be displayed is bound to the view, and the user no longer needs to use hard programming (Hard-code) ways to ContentProvider and Labelprovider registered to a specific View. At the org.eclipse.ui.navigator.viewer extension point, we need to specify viewercontentbinding to set the visibility of the content in the Navigator, where the includes statement indicates that the content is visible on view, Pattern is the ID of the predefined presentation.

Related Article

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.