Java Code Examples for org.eclipse.core.commands.Command#getParameterType()
The following examples show how to use
org.eclipse.core.commands.Command#getParameterType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommandUtils.java From birt with Eclipse Public License 1.0 | 6 votes |
public static Parameterization createParameter( Command command, String parameterId, Object value ) throws NotDefinedException, ExecutionException, ParameterValueConversionException { ParameterType parameterType = command.getParameterType( parameterId ); if ( parameterType == null ) { throw new ExecutionException( "Command does not have a parameter type for the given parameter" ); //$NON-NLS-1$ } IParameter param = command.getParameter( parameterId ); AbstractParameterValueConverter valueConverter = parameterType.getValueConverter( ); if ( valueConverter == null ) { throw new ExecutionException( "Command does not have a value converter" ); //$NON-NLS-1$ } String valueString = valueConverter.convertToString( value ); Parameterization parm = new Parameterization( param, valueString ); return parm; }
Example 2
Source File: CommandUtils.java From birt with Eclipse Public License 1.0 | 5 votes |
public static void disposeParameter( String parameterId, Command command ) throws NotDefinedException { ParameterType parameterType = command.getParameterType( parameterId ); Object valueConverter = parameterType.getValueConverter( ); if ( valueConverter instanceof IDisposable ) ( (IDisposable) valueConverter ).dispose( ); }