TWiki> Public Web>DpHipe>DpHipeComponents (revision 3)EditAttach

Adding Components to existing Views

Certain views as well can be extended by developers such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection by the user.

Outline View

Whenever the user selects a session variable e.g. the Variables View, a SelectionEvent is sent around. The Outline View is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.

  • Implement the herschel.ia.gui.views.OutlineComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.core.ExtensionRegistry in the

An example:

Suppose you would like to create an outline for herschel.share.fltdyn.time.FineTime and you would like to show the contents in the outline view whenever a session variable of that type is selected by the user.

Component Implementation

In this example, we simply use a javax.swing.JLabel and write the contents of the FineTime object into the text of that label.

public class FineTimeOutline extends JLabel implements OutlineComponent {

    public boolean init(Selection selection, OutlineView view) {
	VariableSelection var=(VariableSelection)selection;

	return true;


Component Registry

The following snippet, could then go into your

# convenience short-cuts
from herschel.ia.core import ExtensionRegistry, Extension

# Register to the variable outline factory
		"My FineTime Outline",

# clean-up

More information about the extension registry can be found in its Java API (herschel.ia.core.ExtensionRegistry).

Editor Area

The above showed an example of extending the outline view by adding a OutlineComponent. Similarly, you can contribute by developing a specific editor component.

Editor components are browsers or editors of data contents of a specific variable that is selected in the HIPE session.

  • Implement the herschel.ia.core.EditorComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.core.ExtensionRegistry in the

TODO: Example

public interface EditorComponent {

    boolean init(Selection selection, EditorPart editorPart);
    boolean aboutToClose();

    Icon getComponentIcon();
    String getName();   
    Selection getSelection();

Edit | Attach | Watch | Print version | History: r23 | r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2008-01-15 - JorgoBakker
This site is powered by the TWiki collaboration platform Powered by Perl