Search in sources :

Example 1 with XSDMaxFacet

use of org.eclipse.xsd.XSDMaxFacet in project webtools.sourceediting by eclipse.

the class XSDFacetSection method refreshValueLengths.

public void refreshValueLengths() {
    XSDSimpleTypeDefinition type = xsdSimpleTypeDefinition;
    XSDMinFacet minFacet = type.getMinFacet();
    XSDMaxFacet maxFacet = type.getMaxFacet();
    if (minFacet != null && minFacet.getRootContainer() == xsdSchema) {
        if (minFacet.getElement().getLocalName().equals(XSDConstants.MINEXCLUSIVE_ELEMENT_TAG) || minFacet.getElement().getLocalName().equals(XSDConstants.MININCLUSIVE_ELEMENT_TAG)) {
            minLengthText.setText(minFacet.getLexicalValue());
            minimumInclusiveCheckbox.setSelection(minFacet.isInclusive());
            minimumInclusiveCheckbox.setEnabled(true);
        } else {
            // $NON-NLS-1$
            minLengthText.setText("");
        }
    } else {
        minimumInclusiveCheckbox.setSelection(false);
        minimumInclusiveCheckbox.setEnabled(false);
    }
    if (maxFacet != null && maxFacet.getRootContainer() == xsdSchema) {
        if (maxFacet.getElement().getLocalName().equals(XSDConstants.MAXEXCLUSIVE_ELEMENT_TAG) || maxFacet.getElement().getLocalName().equals(XSDConstants.MAXINCLUSIVE_ELEMENT_TAG)) {
            maxLengthText.setText(maxFacet.getLexicalValue());
            maximumInclusiveCheckbox.setSelection(maxFacet.isInclusive());
            maximumInclusiveCheckbox.setEnabled(true);
        } else {
            // $NON-NLS-1$
            maxLengthText.setText("");
        }
    } else {
        maximumInclusiveCheckbox.setSelection(false);
        maximumInclusiveCheckbox.setEnabled(false);
    }
}
Also used : XSDMaxFacet(org.eclipse.xsd.XSDMaxFacet) XSDSimpleTypeDefinition(org.eclipse.xsd.XSDSimpleTypeDefinition) XSDMinFacet(org.eclipse.xsd.XSDMinFacet)

Aggregations

XSDMaxFacet (org.eclipse.xsd.XSDMaxFacet)1 XSDMinFacet (org.eclipse.xsd.XSDMinFacet)1 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)1