redView

riena emf dynamic views

UI Basics (SWT Views and .redView)

If you’re already using SWT Views, then you know what’s needed before you’re ready to Open the View inside Eclipse.

extension point org.eclipse.ui.views

   <extension
         point="org.eclipse.ui.views">
      <category
            id="scratch"
            name="scratch">
      </category>
      <view
            category="scratch"
            class="scratch.CustomerView"
            icon="icons/customer.png"
            id="scratch.customer"
            name="Customer"
            restorable="true">
      </view>
   </extension>

In this example (from redView Tutorial: View from scratch) there’s at first a category named “scratch” – this means if you open a View using “Window -> Show View -> Other…” you get a folder “scratch” where all Views from this category can be selected. The View defined with Name “Customer” and Category “scratch” uses the Icon “customer.png” from folder icons. The class implementing org.eclipse.ui.IViewPart is “CustomerView” from package “scratch“.

Here you see the Customer View with Icon in Category Folder “scratch”:

All redView examples are found under Category “redView Examples“.

extension point org.redview.datasource.xmi.viewStore

   <extension
         point="org.redview.datasource.xmi.viewStore">
      <viewStore
            folder="viewstore">
      </viewStore>
   </extension>

redView is searching for redView View models (*.redview) in all View Stores. In this example the redView models are stored in folder “viewstore“.

create a dynamic SWT View

To use a dynamic View, you have to use the RedviewViewFactory:

public void createPartControl(Composite parent) {
   ...
   RedviewViewFactory.createDynamicByViewname(parent, "Customer.redview", null);
   ...
}

You see its easy to use dynamic Views from normal SWT Views.

create a dynamic Riena Submodule View

…will be explained in open-erp-ware project: UI Basics (Riena Submodule Views and .redView)

%d bloggers like this: