use of org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand in project webtools.sourceediting by eclipse.
the class XSDComplexTypeAdvancedSection method doWidgetSelected.
public void doWidgetSelected(SelectionEvent e) {
XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
if (e.widget == blockCombo) {
String value = blockCombo.getText();
UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.BLOCK_ATTRIBUTE, value, Messages._UI_LABEL_BLOCK);
command.setDeleteIfEmpty(true);
getCommandStack().execute(command);
} else if (e.widget == finalCombo) {
String value = finalCombo.getText();
UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.FINAL_ATTRIBUTE, value, Messages._UI_LABEL_FINAL);
command.setDeleteIfEmpty(true);
getCommandStack().execute(command);
} else if (e.widget == abstractCombo) {
String value = abstractCombo.getText();
UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.ABSTRACT_ATTRIBUTE, value, Messages._UI_LABEL_ABSTRACT);
command.setDeleteIfEmpty(true);
getCommandStack().execute(command);
} else if (e.widget == mixedCombo) {
String value = mixedCombo.getText();
UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(complexType.getElement(), XSDConstants.MIXED_ATTRIBUTE, value, Messages._UI_LABEL_MIXED);
command.setDeleteIfEmpty(true);
getCommandStack().execute(command);
}
}
use of org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand in project webtools.sourceediting by eclipse.
the class XSDSimpleTypeAdvancedSection method doWidgetSelected.
public void doWidgetSelected(SelectionEvent e) {
if (e.widget == finalCombo && input != null && input instanceof XSDSimpleTypeDefinition) {
XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
String value = finalCombo.getText();
UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(simpleType.getElement(), XSDConstants.FINAL_ATTRIBUTE, value, Messages._UI_LABEL_FINAL);
command.setDeleteIfEmpty(true);
getCommandStack().execute(command);
}
}
Aggregations