Search in sources :

Example 1 with InputComboDialog

use of com.amalto.workbench.dialogs.InputComboDialog in project tmdm-studio-se by Talend.

the class XSDEditFacetAction method editWhiteSpace.

private void editWhiteSpace() {
    // $NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
    String[] values = { "preserve", "replace", "collapse" };
    XSDWhiteSpaceFacet currentValue = std.getWhiteSpaceFacet();
    // $NON-NLS-1$
    String stringValue = "preserve";
    if (currentValue != null) {
        stringValue = currentValue.getLexicalValue();
    }
    dialog = new InputComboDialog(page.getSite().getShell(), Messages.XSDEditFacetAction_DialogTitle12, Messages.XSDEditFacetAction_DialogTitle12Tip, values, stringValue, null);
    dialog.setBlockOnOpen(true);
    int ret = dialog.open();
    if (ret == Dialog.CANCEL) {
        return;
    }
    if (currentValue != null) {
        std.getFacetContents().remove(currentValue);
    }
    String stirngValue = ((InputComboDialog) dialog).getValue();
    if (stirngValue != null && stirngValue.length() > 0) {
        XSDWhiteSpaceFacet f = (XSDSchemaBuildingTools.getXSDFactory()).createXSDWhiteSpaceFacet();
        // $NON-NLS-1$
        f.setLexicalValue("" + stirngValue);
        std.getFacetContents().add(f);
    }
}
Also used : XSDWhiteSpaceFacet(org.eclipse.xsd.XSDWhiteSpaceFacet) InputComboDialog(com.amalto.workbench.dialogs.InputComboDialog)

Aggregations

InputComboDialog (com.amalto.workbench.dialogs.InputComboDialog)1 XSDWhiteSpaceFacet (org.eclipse.xsd.XSDWhiteSpaceFacet)1