Difference between revisions of "Tutorial: Model Development"

From Developer Documents
Jump to navigation Jump to search
Line 23: Line 23:
 
** id = com.acme.movie.ui.productions
 
** id = com.acme.movie.ui.productions
 
** name = Productions
 
** name = Productions
** class = org.simantics.browsing.ui.swt.GraphExplorerView:browseContext=http://com.acme/Movie-1.0/Productions&uiContext=com.acme.movie.ui.productions&contextMenuId=#ProductionsPopup
+
** class = <nowiki>org.simantics.browsing.ui.swt.GraphExplorerView:browseContext=http://com.acme/Movie-1.0/Productions</nowiki>
 
** category = com.acme.movie.ui.category
 
** category = com.acme.movie.ui.category
**
+
 
 +
TODO: explain the class parameter contents
  
 
In the same extension editor, modify the existing view perspective extension to use the new view.
 
In the same extension editor, modify the existing view perspective extension to use the new view.
* Find the extension in the tree: '''org.eclipse.ui.perspectiveExtensions''' >> '''com.acme.movie.ui.perspective (perspectiveExtension)''' >> '''org.simantics.structural.ui.modelBrowser'''
+
* Find the extension in the tree:<br/>
 +
*: '''org.eclipse.ui.perspectiveExtensions''' >><br/>
 +
*:: '''com.acme.movie.ui.perspective (perspectiveExtension)''' >><br/>
 +
*::: '''org.simantics.structural.ui.modelBrowser'''
 
* Modify '''org.simantics.structural.ui.modelBrowser''' to '''com.acme.movie.ui.productions'''
 
* Modify '''org.simantics.structural.ui.modelBrowser''' to '''com.acme.movie.ui.productions'''
  

Revision as of 13:59, 20 October 2010

In this part of the tutorial we will focus on implementing the basic functionality for the following parts of the UI:

  • Model Browser for modelling movie production cases
    • Basic context menu actions for the browser
      • Add > Movie Project
      • Add > Casting Plan
      • Add > Role
  • Property View for editing properties of model entities
  • Movie Database Library for searching available movies, actors, directors, etc.

Step 1: Customize Model Browser

To customize the model browser for the movie production case, we cannot directly use the existing view added to the perspective in the previous part of the tutorial. We need to create a new view extension to parametrize the view properly.

Lets add the new view extension.

  • Open com.acme.movie.ui / META-INF/MANIFEST.MF >> Extensions
  • Add a new extension, org.eclipse.ui.views
  • Add view category
    • org.eclipse.ui.views >> right click >> new >> category
    • id = com.acme.movie.ui.category
    • name = Movie Production
  • Add view
    • org.eclipse.ui.views >> right click >> new >> view
    • id = com.acme.movie.ui.productions
    • name = Productions
    • class = org.simantics.browsing.ui.swt.GraphExplorerView:browseContext=http://com.acme/Movie-1.0/Productions
    • category = com.acme.movie.ui.category
TODO: explain the class parameter contents

In the same extension editor, modify the existing view perspective extension to use the new view.

  • Find the extension in the tree:
    org.eclipse.ui.perspectiveExtensions >>
    com.acme.movie.ui.perspective (perspectiveExtension) >>
    org.simantics.structural.ui.modelBrowser
  • Modify org.simantics.structural.ui.modelBrowser to com.acme.movie.ui.productions

Step 2: Add Context Menu Actions for Model Browser

Step 3: Add Property View for Model Browser

Step 4: Add Content for Movie Database Library