Creating an RCP view in the visual editor

The visual editor for Java™ supports the creation and development of Rich Client Platform (RCP) views.

Before you begin

Before you can create a Java visual class, you must create a Java project or plug-in project where you can place the visual class. A plug-in project that is enabled for Rich Client Platform (RCP) application development is required if you want to create a RCP view or editor.

About this task

An RCP view is a class that extends org.eclipse.ui.part.ViewPart. You can use the New Java Visual Class wizard to quickly create a new visual class that extends ViewPart. The wizard creates the ViewPart and adds an SWT composite as the default container. You can then use the SWT controls and containers to design the contents of the view.
Tip: The visual editor uses your workbench preferences for View tab position (top or bottom) and tab style (traditional or non-traditional) during design and when you run the view as a Java bean.

To create an RCP view:

Procedure

  1. Complete the steps for Creating a new Java visual class, specifying RCP View in the Style list. The new Java class opens in the visual editor showing the ViewPart with a composite.
    New visual class in the design view showing a ViewPart
  2. Use the SWT controls and containers to design the contents of the view.

What to do next

You can test the view independently by running it as a Java bean (Run > Run As > Java Bean).

To incorporate the view into your plug-in, you need to register the view as an extension point in your project and include it in the proper perspective to display correctly as part of the RCP application.


Feedback