Designer 1 - Extensibility



This document describes how to extend the Visual Mobility Designer 1. In the NetBeans 6.0 it is going to be replaced by a new version and the API will be backward-incompatible.

Adding a component using Palette Manager

  • Invoke "Palette Manager" popup menu action in Palette
  • In dialog, click on "Add from Project" button
  • In Wizard, select your project. Your custom item should be listed on

next page.

  • Select it and press Finish to add it into the palette.

The custom item descriptor is created in the $NB_USER_DIR/config/MVD/Components/myCustomItem.mvd_component_info file. You can freely modify that XML file but you have to assure its validity - see: $NB_CVS/mobility/designer/src/org/netbeans/modules/mvd/resources/DDynamicClassDCI.dtd

Adding a new component into the registry using mvd_component_info file

If you would like to have a MIDP component integrated into the palette and the component will provide/reuse the same features that are available for built-in MIDP components, then the integration could be done this way:

  • In NetBeans, create a J2ME library. Create your MIDP component. Compile the library. Create its distribution jar.
  • Add the component into the NetBeans Palette using "Tools|Palette Manager|Mobility Editor".
  • In your $userdir, the config/MVD/Components/MyComponent-<hashcode>.mvd_component_info file contains description of your component. The config/MVD/Palette/User/MyComponent-<hashcode>.shadow file is a shadow link to the descriptor.
  • Create a NetBeans Plug-in.
  • Set dependency on org.netbeans.modules.mvd module.
  • Add a library descriptor for the J2ME library (created in 1. step). You can specify classpath jar (use the one from the 1. step), sources, javadoc.
  • Register the mvd_component_info file into the layer at "MVD/Components" folder. You can rename this file for removing the hashcode part from it.
  • Create a shadow link at "MVD/Palette/<PaletteCategory>" folder.
  • Edit the mvd_component_info file and add "requiredlibraries" attribute to "componentinfo" element. The value is the name of the library descriptor (created in 6. step). This allows IDE to automatically add your library into user's project, when he/she uses the component for the first time.
  * When you compile your module, the new component should be available in the palette automatically.

The sources of the Mobility Pack is available at

The $NB_CVS/mobility/designer/src/org/netbeans/modules/mvd/resources/DDynamicClassDCI.dtd is a dtd for a mvd_component_info file.

Close integration

If you would like to integrate more (e.g. supplying your own look into Screen or adding a new transition types into Flow), you would have to understand the sources of the Designer because we do not have public API yet (it will be available in NB 6.0 release) and we do not have a documentation except javadoc.

Back to MobilityDesignerHome

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo