Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Nebula WindowBuilder

Revision as of 05:16, 23 March 2020 by Unnamed Poltroon (Talk) (Created page with "< Back to Nebula Main Page ==Introduction== This tutorial explains how to integrate a widget into WindowBuilder. ''This is work in progress version that will be...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Back to Nebula Main Page

Introduction

This tutorial explains how to integrate a widget into WindowBuilder.

This is work in progress version that will be continued and completed.

Setup

First of all, get the source code on github : [1].

Then create a projet in Eclipse and import all plugins into your workspace (if you use Egit, go to the EGit perspective, expand the node Working Tree, select all projects, right-click then choose Import projects).

Java part

Create the class

Open the plugin org.eclipse.wb.rcp.nebula and go to the directory src, package org.eclipse.wb.internal.rcp.nebula

Create a new package org.eclipse.wb.internal.rcp.nebula.XXX where XXX is you widget name :

Nebulawb1.png

In this package create a Java Class called XXXInfo where XXX is you widget name. This class is very simple, it extends CompositeInfo and contains a constructor.

public class TitledSeparatorInfo extends CompositeInfo {
 public TitledSeparatorInfo(AstEditor editor,
       ComponentDescription description,
       CreationSupport creationSupport) throws Exception {
   super(editor, description, creationSupport);
   // listener for setting property to default
   InstanceObjectPropertyEditor.installListenerForProperty(this);
 }
}

Add a new extension in your plugin.xml file

Open file plugin.xml of this plugin, , go to the Extensions tab and add a new entry under Nebula (category). The type of this entry is Component :

Nebulawb2.png

Just fill the class attribute with the qualified name of your Nebula widget (org.eclipse.nebula.widget.yyy).

Nebulawb3.png

Update Manifest.mf file

Open the manifest.mf file and in the Export-Package part add the package of you XXXXInfo class :

Nebulawb4.png

Icon

Create an icon that will be displayed in the palette. It is a PNG or GIF file, 16x16 pixels.

XML Configuration part

To be continued

Testing

To be continued

Back to the top