use of org.eclipse.xsd.XSDCompositor in project tmdm-studio-se by Talend.
the class ConceptComposite method updateElementGroup.
private void updateElementGroup(XSDComplexTypeDefinition type) {
if (type != null) {
XSDParticleImpl partCnt = (XSDParticleImpl) type.getContent();
if (partCnt != null) {
XSDModelGroupImpl mdlGrp = (XSDModelGroupImpl) partCnt.getTerm();
XSDCompositor typeComposite = mdlGrp.getCompositor();
if (typeComposite.equals(XSDCompositor.SEQUENCE_LITERAL)) {
setSequence();
} else if (typeComposite.equals(XSDCompositor.ALL_LITERAL)) {
setAll();
} else if (typeComposite.equals(XSDCompositor.CHOICE_LITERAL)) {
setChoice();
}
enableRadioButtons(false);
}
}
}
use of org.eclipse.xsd.XSDCompositor in project webtools.sourceediting by eclipse.
the class XSDModelGroupSection method doWidgetSelected.
public void doWidgetSelected(SelectionEvent e) {
XSDModelGroup particle = (XSDModelGroup) input;
if (e.widget == modelGroupCombo) {
XSDCompositor newValue = XSDCompositor.get(modelGroupCombo.getText());
UpdateContentModelCommand command = new UpdateContentModelCommand(org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_ACTION_CHANGE_CONTENT_MODEL, particle, newValue);
getCommandStack().execute(command);
}
super.doWidgetSelected(e);
}
use of org.eclipse.xsd.XSDCompositor in project tmdm-studio-se by Talend.
the class ComplexTypeGroupTypeCommitHandler method validateCommit.
@Override
protected void validateCommit() throws CommitValidationException {
if (getCommitedObj().getNewExtends() != null && getCommitedObj().getNewExtends().equals(getCommitedObj().getCurComplexType()))
throw new CommitValidationException(Messages.ComplexTypeXXHandler_CBaseTypeCannotbeItself);
if (Util.getParentTypes(getCommitedObj().getNewExtends()).contains(getCommitedObj().getCurComplexType()))
throw new CommitValidationException(Messages.bind(Messages.ComplexTypeXXHandler_ValidExceptionInfo, getCommitedObj().getNewExtends().getName(), getCommitedObj().getCurComplexType().getName()));
if (!getCommitedObj().isDefaultExtends()) {
XSDCompositor newBaseGroupType = Util.getComplexTypeGroupType(getCommitedObj().getNewExtends());
XSDCompositor newGroupType = getCommitedObj().getNewGroupType();
if (newBaseGroupType != null && newBaseGroupType.equals(XSDCompositor.ALL_LITERAL))
throw new CommitValidationException(Messages.bind(Messages.ComplexTypeXXHandler_ValidExceptionInfo1, getCommitedObj().getNewExtends().getName()));
if (newGroupType != null && newGroupType.equals(XSDCompositor.ALL_LITERAL))
throw new CommitValidationException(Messages.ComplexTypeXXHandler_ValidExceptionInfo2);
if (newBaseGroupType != null && !newBaseGroupType.equals(newGroupType))
throw new CommitValidationException(Messages.bind(Messages.ComplexTypeXXHandler_ValidExceptionInfo3, getCommitedObj().getNewExtends().getName()));
}
}
use of org.eclipse.xsd.XSDCompositor in project tmdm-studio-se by Talend.
the class UtilTest method testGetComplexTypeGroupType.
@Test
public void testGetComplexTypeGroupType() {
XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) schema.getElementDeclarations().get(0).getTypeDefinition();
XSDCompositor compositor = Util.getComplexTypeGroupType(complexType);
// $NON-NLS-1$
assertEquals(compositor.getName(), "all");
}
Aggregations