The PDE wizards and editors that manipulate plug-ins and fragments are nearly the same. However, you must be aware of some important differences.
We start by creating a new fragment project.
On the first page of the New Fragment Wizard, type the project name "com.example.german." Press Next and accept the default values of the second page. (Press Next again.) On the "Fragment Code Generators" page, choose the radio button for creating a fragment from a template and select the "Default Fragment Generator" wizard. After pressing Next, you should see the "Simple Fragment Content" page.
This page looks a little different from the plug-in wizard since it has two additional fields: target plug-in id and version. Since we are writing a fragment for a specific plug-in, we can use the Browse button to select "XYZ Plugin" from the "Workspace Plug-ins" group (we could also pick any of the external plug-ins).
Once the project is created, it opens the fragment manifest editor.
It is almost identical to plug-in manifest editor with the following exceptions:
We will add a similar action set as in the plug-in example, but this time in German.
System.out.println("Hallo, PDE welt!");
Save and close the Java editor and fragment manifest editor.
When you run the fragment using the "Run" tool bar button, the run-time platform instance should have the "Deutsche Aktionsmenge" action set available. (Use Window->Customize Perspective...->Other to get to the list of action sets). When you activate the action set, the "Beispiel Menu" menu should appear on the tool bar. When you select its menu item, you should see "Hallo, PDE welt!" in the Console. The runtime platform didn't see the German fragment directly. Instead, its plug-in registry resolved fragment references in such a way that the fragment's action set appeared to the platform as though it came directly from the XYZ Plug-in.