Difference: DpHipeTools (26 vs. 27)

Revision 272008-10-08 - JaimeSaiz

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

Adding Tools to HIPE

Line: 194 to 194
 
The TaskSignatureComponent interface consists of four explicit contracts
Changed:
<
<
  • Support the setVariableSelection for initial assignment from the Tool Window
  • Assign the Signature to display ( the setSignature)
  • Return a map of parameters and assigned values ( the getParameters note return value ca be simplified to Map<TaskParameter, VariableSelection> )
>
>
  • Support the setVariableSelection for initial assignment from the Tool Window
  • Assign the Signature to display (setSignature)
  • Return a map of parameters and assigned values (in Map<TaskParameter, VariableSelection> getParameters)
 
  • Clear and check user inputs (used by the default buttons)
and the two implicit contracts inherited by the Extension Registry
  • Be JComponent
  • Have an empty constructor
Added:
>
>
An easy way of implementing TaskSignatureComponent is by extending JTaskSignatureComponent and providing your own implementation for the makeModifierMap() method.

For example, if you want to use a custom Signature Component that just wants to use JFilePathModifier for a parameter aimed for a file name, you could do it like this:

public class MySignatureComponent extends JTaskSignatureComponent {

    private static final long serialVersionUID = 1L;

    protected Map<TaskParameter, Modifier> makeModifierMap() {

	SignatureApi signature = getSignature();
	Map<TaskParameter, Modifier> map =
	    new LinkedHashMap<TaskParameter, Modifier>();

	map.put(signature.getTaskParameter("file"), new JFilePathModifier());
	map.put(signature.getTaskParameter("number"), new JIntegerModifier());

	return map;
    }
}

In package herschel.ia.gui.apps.modifier you can find more general available modifiers.

 

Register a Task Signature Component
 
This site is powered by the TWiki collaboration platform Powered by Perl