[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: how to define Parameters for a Command???

amy wrote:
hallo,

i want to let users define a Parameter for a Command

Now i have some xmls:

    <command
            defaultHandler="MyHandler"
            id="MyCommand"
            name="bbb">
         <commandParameter
               id="MyParameter"
               name="aaa"
               optional="true"
               values="MyParameterValues">
         </commandParameter>
      </command>

and a class MyParameterValues:

public class MyParameterValues implements IParameterValues{
 final Map values = new HashMap();
     public final Map getParameterValues() {

        // values.put(Key,Value);
        // .........
      return values;
     }
    }
}

the problem is: how can i DYNAMIC define the values map if I want to let the user define a value through a InputDialog?
but how can i pass the input value to MyParameterValues?

Have your MyParameterValues go to your "model" to return your values. Have your InputDialog add entries to your "model". One of the simpler ways is to go to your plugin for a singleton manager:


MyPlugin.getDefault().getMyCommandManager();

Or are you asking something else, like how can the user enter arbitrary parameter values when defining a binding in the PDE Editor?

Later,
PW