Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] how to manage an MBS enumerated list option by another enumerated list option

Hello ALL,

Please I need help about managing enumerated list options.
I am a bit new to eclipse & I work with MBS.

In fact, I have to enable & disable 2 enumerated lists(combo Boxes) 
according to a third one which has 2 enumerated values
each value should activate one (combo box) & dis-activate the other.

I created for the 3 enumerated lists their respective classes which implements IOptionApplicability to use the "isOptionEnabled()"

Here is the code of the 1st combo box (manager) which manage the 2 others:
++++++++++ 1st combo box (manager)
public boolean isOptionEnabled(IBuildObject buildinf,
			IHoldsOptions holder, IOption	option) {
  try{
	String myStr= option.getSelectedEnum(); //returns ID if enum option
	if(myStr.equalsIgnoreCase("Toolchain.compiler.option.MorC.option1")){
				this.opt1=true;
				this.opt2=false;
   	} else{
				this.opt2=false;
				this.opt1=true;
	}		
   } catch (BuildException e) {}
			
		return true;
   }

public boolean validateOption1(){	
	return this.opt1;
}
public boolean validateOption2(){	
	return this.opt2;
}
++++++++++ 2 & 3 nd combo boxes (manageD)

	manager CMLE= new manager();
public boolean isOptionEnabled(IBuildObject configuration,
			IHoldsOptions holder, IOption option) {
	boolean flag=false;	    
	flag= CMLE.validateOptioni(); //i is option1 or option
	return flag;
}
----
without invoking the manager list the 2 combo boxes
are enabled or disabled when I change statically true or false
but when I invoke it or even change the value of the manager list
it doesn't work.

IT’S A BIT LONG BUT I REALLY Waste a lot of time on it
And I need it.
THANKS A LOT FOR YOUR HELP.




Back to the top