use of org.eclipse.wst.xsd.ui.internal.common.commands.UpdateMinOccursCommand in project webtools.sourceediting by eclipse.
the class MultiplicitySection method updateMinAttribute.
protected void updateMinAttribute() {
setErrorMessage(null);
XSDParticle particle = null;
if (input instanceof XSDParticleContent) {
particle = getAssociatedParticle((XSDParticleContent) input);
}
if (particle != null) {
String newValue = minCombo.getText();
if (newValue.length() == 0) {
particle.unsetMinOccurs();
}
try {
int newMin = 1;
if (// $NON-NLS-1$ //$NON-NLS-2$
newValue.equals("unbounded") || newValue.equals("*")) {
newMin = XSDParticle.UNBOUNDED;
} else {
newMin = Integer.parseInt(newValue);
}
UpdateMinOccursCommand command = new UpdateMinOccursCommand(Messages._UI_ACTION_CHANGE_MINIMUM_OCCURRENCE, particle, newMin);
getCommandStack().execute(command);
} catch (NumberFormatException e) {
}
}
}
Aggregations