Best-Practice: Developing a Model-Based Editor - Intro

March 2nd, 2006

Developing a Model-Based Editor - TOC

  1. Intro
  2. Preparation
  3. Editor-Inputs
  4. Editor-Implementation

A very important element of the Eclipse-Framework are editors. Editors are among views the fundamental element for user-interaction.
Eclipse provides a wonderful framework for creating editors with a reserved area (the “editor area”), where you don’t have to care for common behaviour. Just implement the contribution of the input and provide an implementation for saving the edited input.

What’s the goal of this article?

In the most articles and books is described how to implement an editor for editing a file with a special extension that exists physically in the workspace. But what if you want to use all the functionality the editor comes with, without writing or reading any files, but just pure Java-objects? I want to show you a way how to use in a very easy and clear way how to use simple EditorParts and MultiPageEditorParts with Forms. In addition I want to provide a strategy for managing your editors. At the end will be a eclipse-product, that has a simple view-part with a list (known from the Image-Contribution Product) . If you double-click on a list the object-specified editor will be opened and display the properties of the object, without all the workspace, file and project handling.

Requirements

  • Every Object can be handled with an editor
  • The Icon will be contributed by the ImageContributor
  • The framework knows the objects that were already “opened” by an editor.
  • A very easy way to provide new editors for new Java-Objects
  • Saving with the given “Dirty-Flag”

Screenshot of the Application

The editor application with different open editors, based on the double-clicked java-object in the ViewPart on the left.
Screenshot of the ready-to-use application

Let’s roll!!!

Download the required plugins as Eclipse-Projects (Source included)
Download the Editors-Best-Practice as RCP (Source included)

Entry Filed under: Editors

6 Comments Add your own

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

March 2006
M T W T F S S
« Jan   Apr »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Most Recent Posts