Working with views

Views are represented by NodeViews class in object model.

View nodes represent a view in MVC model. Your implementation of ViewManager is responsible of creating/deleting views of the specified type, and of the ability to edit this view.

For example, if you create a view for a template engine, you should provide the required plugin that enables to edit such views. More precisely, you must provide a way to simply edit the view by double-clicking on the graph view node.

Implementing new views

Adding a new views is performed by the following steps:

  • Implementing ViewManager
  • Modifying/Adding XSLT filters to handle the new specific view type - if needed
  • Adding new LinkManager(s) to handle incoming and outgoing links on your view.

ViewManager

See extension point for ViewManager to add your own classes.

ViewManager must implement a few methods:

  • a method to create a new specific view of the given type (do not forget to set mgrId on the created view),
  • a method to delete a node of the given view type,
  • a method to copy a view to another package, or to the same package (need to rename automatically target view),
  • a method to edit view properties (using plugin view, in ProjectContext.getNodePropertiesView),
  • methods so serialize/deserialize view on XML project file,
  • a method to adapt node in target classes (such as UrlManager),
  • a method to obtain the node icon.

Manager is responsible of firing change events on project.

Xslt filters

You will have to either modify or add new XSLT filters. These filters will for example generate a struts.xml file with your newly created view type.

LinkManagers

Declare link-managers on extension point .

LinkManagers are responsible of creating links from and to your newly created view.

Create at least one LinkManager to handle links to your view or implement UrlManager adapter.

Then optionally create LinkManager to handle links to existing other node types from your view.