use of org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand in project webtools.sourceediting by eclipse.
the class SpecificConstraintsWidget method doModify.
public void doModify(Object element, String property, Object value) {
setButtonStates(this.kind);
if (element instanceof TableItem && (value != null)) {
TableItem item = (TableItem) element;
if (item.getData() instanceof XSDPatternFacet) {
XSDPatternFacet patternFacet = (XSDPatternFacet) item.getData();
patternFacet.setLexicalValue((String) value);
item.setData(patternFacet);
item.setText((String) value);
} else if (item.getData() instanceof XSDEnumerationFacet) {
XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) item.getData();
SetXSDFacetValueCommand command = new SetXSDFacetValueCommand(Messages._UI_ACTION_SET_ENUMERATION_VALUE, enumFacet);
command.setValue((String) value);
commandStack.execute(command);
item.setData(enumFacet);
item.setText((String) value);
}
}
}
use of org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand in project webtools.sourceediting by eclipse.
the class XSDEnumerationFacetSection method doHandleEvent.
public void doHandleEvent(Event event) {
if (event.widget == valueText) {
if (!valueText.getEditable())
return;
String value = valueText.getText();
if (input instanceof XSDEnumerationFacet) {
XSDEnumerationFacet xsdEnumeration = (XSDEnumerationFacet) input;
Command command = null;
command = new SetXSDFacetValueCommand(Messages._UI_ACTION_CHANGE_ENUMERATION_VALUE, xsdEnumeration, value);
if (command != null && getCommandStack() != null) {
getCommandStack().execute(command);
valueText.setText(value);
}
}
}
}
Aggregations