/** * Convert the parameter's value according to it's type. * * @param command * @param parameterId * @param value * @return converted value * @see org.eclipse.e4.ui.model.application.commands.MCommandParameter#getTypeId() */ private Object convertParameterValue(Command command, String parameterId, String value) { try { ParameterType parameterType = command.getParameterType(parameterId); if (parameterType != null) { AbstractParameterValueConverter valueConverter = parameterType.getValueConverter(); if (valueConverter != null) { return valueConverter.convertToObject(value); } } } catch (NotDefinedException e) { } catch (ParameterValueConversionException e) { } return value; }
private boolean hasTypedParameterMatch(Command command, Object object) throws CommandException { IParameter[] params = command.getParameters(); if (params != null) { for (IParameter param : params) { ParameterType parameterType = command.getParameterType(param.getId()); if (parameterType != null) { if (parameterType.isCompatible(object)) return true; } } } return false; }
return null; ParameterType parameterType = command.getParameterType(key); if (parameterType == null) { parms.add(new Parameterization(parameter, (String) entry.getValue()));
return null; ParameterType parameterType = command.getParameterType(key); if (parameterType == null) { parms.add(new Parameterization(parameter, (String) entry.getValue()));
return null; ParameterType parameterType = command.getParameterType(key); if (parameterType == null) { parms.add(new Parameterization(parameter, (String) entry.getValue()));
ParameterType parameterType = command.getParameterType(parameter.getId()); if ((parameterType != null) && (parameterType.getValueConverter() != null)) { Text parameterText = fToolkit.createText(paramLine, "", SWT.SINGLE | SWT.BORDER); //$NON-NLS-1$
final 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$
final 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$
final 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$
parmModel.setName(cmdParm.getName()); parmModel.setOptional(cmdParm.isOptional()); ParameterType parmType = cmd.getParameterType(cmdParm.getId()); if (parmType != null) { parmModel.setTypeId(parmType.getId());