Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338702

Summary: [Discovery] specify initial value for Parameters
Product: [Modeling] MoDisco Reporter: Nicolas Bros <nicolas.bros>
Component: InfrastructureAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: fabien.giquel, hugo.bruneliere, modisco.web-inbox
Version: 0.9.0Flags: nicolas.bros: indigo+
Target Milestone: 0.9.0 M6   
Hardware: All   
OS: All   
Whiteboard:

Description Nicolas Bros CLA 2011-03-02 11:50:32 EST
There should be a way to specify the initial value of a discoverer parameter.

This can be specified with an additional annotation on a method that returns the initial value, like this for example:

@ParameterInitialValue(name="MY_PARAM")
public boolean getMyParamInitialValue(IProject source) {
    return true;
}

The initialization method takes the source as a parameter because we want to be able to initialize a parameter based on the selected source.
Comment 1 Nicolas Bros CLA 2011-03-04 06:28:55 EST
Committed in revision 4020.
Comment 2 Fabien Giquel CLA 2011-03-07 12:33:01 EST
Hi Nicolas,

can you add some short presentation of the @ParameterInitialValue annotation in component documentation in "advanced API" section ? Thanks.
Moreover some minimal test of IDiscoveryManager.hasInitialValue/getInitialValue will be welcome.
Comment 3 Nicolas Bros CLA 2011-03-09 07:54:19 EST
I added the documentation:
http://wiki.eclipse.org/MoDisco/Components/DiscoverersManager/Documentation/0.9.beta#initial_values
and unit tests.
Comment 4 Hugo Bruneliere CLA 2011-08-18 07:53:10 EDT
Upgrade done.