Difference: DpHipeViews (2 vs. 3)

Revision 32008-01-15 - JorgoBakker

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Creating a View

Line: 13 to 13
 

Basic Steps

Added:
>
>
 HIPE View menu

The aim is that your contribution is automatically picked up by the infrastructure, such that your view is added to the view menu, as shown in the picture on the right.

Line: 27 to 28
 
  • In principle only one instance of a view should exist.
  • The ID returned by your implementation must be unique

Added:
>
>
 

Example

Added:
>
>
 

Implementation

Added:
>
>
 
public class MyView extends SomeSwingComponent implements Viewable {
    private ViewPart _part;

Line: 58 to 62
 
Added:
>
>
 

Registry

Added:
>
>
 The following snippet registers the above view within your package __init__.py:


Deleted:
<
<
# import and short-cuts from herschel.ia.core import ExtensionRegistry, Extension VIEWABLE=ExtensionRegistry.VIEWABLE REGISTRY=ExtensionRegistry.getInstance()

# registry

 REGISTRY.register(VIEWABLE, Extension( "site.view.myview", # a unique ID, could be the same as ... "resides.in.java.package.MyView", # the class holding the implementation "My View", # how it should be called in the menu "resides/in/java/package/myview.gif" # resource of possible icon (can be None)
Changed:
<
<
));

# cleanup del(ExtensionRegistry,Extension,REGISTRY,VIEWABLE)

>
>
));
 

Added:
>
>
See also the Extension Registry documentation for more details.
 

Adding features

Added:
>
>
 

Trigger events

Added:
>
>
 Your viewable may want to trigger site events which might be interesting to other views. The herschel.ia.core.parts.ViewPart interface that is passed on through the init method gives you the means of triggering site events:
    private void somemethod() {

Line: 92 to 94
  : }
Added:
>
>
 

Receiving events

Added:
>
>
 Your viewable may want to listen to site events produced by other views. For that you have to implement the herschel.ia.core.SiteEventListener interface and inform the event handler that you are interested in one or more event types, e.g.:
public class MyView extends SomeSwingComponent implements Viewable, SiteEventListener {

Line: 113 to 117
  }
Changed:
<
<
>
>
 

Menus and toolbars

Added:
>
>
 TODO
Added:
>
>

 
<-- Author: JorgoBakker -->
 
This site is powered by the TWiki collaboration platform Powered by Perl