use of com.amalto.workbench.actions.XSDNewSimpleTypeDefinition in project tmdm-studio-se by Talend.
the class DataModelMainPage method createActions.
protected void createActions() {
this.newConceptAction = new XSDNewConceptAction(this);
this.deleteConceptAction = (XSDDeleteConceptAction) getAdapter(XSDDeleteConceptAction.class);
createNewBrowseItemViewAction();
this.deleteConceptWrapAction = new XSDDeleteConceptWrapAction(this);
this.newElementAction = new XSDNewElementAction(this);
this.deleteElementAction = new XSDDeleteElementAction(this);
this.deleteAttributeAction = new XSDDeleteAttributeAction(this);
this.changeToComplexTypeAction = new XSDChangeToComplexTypeAction(this, false);
this.changeSubElementGroupAction = new XSDChangeToComplexTypeAction(this, true);
this.deleteParticleAction = new XSDDeleteParticleAction(this);
this.newGroupFromTypeAction = new XSDNewGroupFromTypeAction(this);
this.copyConceptAction = new XSDCopyConceptAction(this, Messages.CopyEntityText);
this.editParticleAction = new XSDEditParticleAction(this);
this.editConceptAction = new XSDEditConceptAction(this);
this.editElementAction = new XSDEditElementAction(this);
this.deleteIdentityConstraintAction = new XSDDeleteIdentityConstraintAction(this);
this.newIdentityConstraintAction = new XSDNewIdentityConstraintAction(this);
this.deleteXPathAction = new XSDDeleteXPathAction(this);
this.newXPathAction = new XSDNewXPathAction(this);
this.editXPathAction = new XSDEditXPathAction(this);
this.changeToSimpleTypeAction = new XSDChangeToSimpleTypeAction(this);
this.changeBaseTypeAction = new XSDChangeBaseTypeAction(this);
this.getXPathAction = new XSDGetXPathAction(this);
this.setAnnotationLabelAction = new XSDSetAnnotationLabelAction(this);
this.setAnnotationDescriptionsAction = new XSDSetAnnotationDescriptionsAction(this);
this.setAnnotationForeignKeyAction = (XSDSetAnnotationForeignKeyAction) getAdapter(XSDSetAnnotationForeignKeyAction.class);
this.skipToFKAction = new XSDSkipToFKAction(this);
this.setAnnotationFKFilterAction = (XSDSetAnnotationFKFilterAction) getAdapter(XSDSetAnnotationFKFilterAction.class);
this.setAnnotationForeignKeyInfoAction = (XSDSetAnnotationForeignKeyInfoAction) getAdapter(XSDSetAnnotationForeignKeyInfoAction.class);
this.setAnnotationDisplayFomatAction = new XSDSetAnnotaionDisplayFormatAction(this);
this.setAnnotationLookupFieldsAction = new XSDAnnotationLookupFieldsAction(this);
this.setAnnotationPrimaryKeyInfoAction = new XSDSetAnnotationPrimaryKeyInfoAction(this);
this.deleteTypeDefinition = new XSDDeleteTypeDefinition(this);
this.newComplexTypeAction = new XSDNewComplexTypeDefinition(this);
this.newSimpleTypeAction = new XSDNewSimpleTypeDefinition(this);
this.editComplexTypeAction = new XSDEditComplexTypeAction(this);
this.setFacetMsgAction = new XSDSetFacetMessageAction(this);
deleteConceptWrapAction.regisDelAction(XSDElementDeclarationImpl.class, deleteConceptAction);
deleteConceptWrapAction.regisDelAction(XSDParticleImpl.class, deleteParticleAction);
deleteConceptWrapAction.regisDelAction(XSDAttributeUseImpl.class, deleteAttributeAction);
deleteConceptWrapAction.regisDelAction(XSDAttributeDeclarationImpl.class, deleteAttributeAction);
deleteConceptWrapAction.regisDelAction(XSDIdentityConstraintDefinitionImpl.class, deleteIdentityConstraintAction);
deleteConceptWrapAction.regisDelAction(XSDXPathDefinitionImpl.class, deleteXPathAction);
deleteConceptWrapAction.regisDelAction(null, deleteElementAction);
deleteConceptWrapAction.regisDelAction(XSDComplexTypeDefinitionImpl.class, deleteTypeDefinition);
deleteConceptWrapAction.regisDelAction(XSDSimpleTypeDefinitionImpl.class, deleteTypeDefinition);
if (exAdapter != null) {
exAdapter.createActions();
}
}
use of com.amalto.workbench.actions.XSDNewSimpleTypeDefinition in project tmdm-studio-se by Talend.
the class SimpleTypeInputDialog method modifyText.
public void modifyText(ModifyEvent e) {
getButton(IDialogConstants.OK_ID).setEnabled(true);
// $NON-NLS-1$
infoLabel.setText("");
String type = elemPanel.getText();
if (// $NON-NLS-1$
Pattern.compile("^\\s+\\w+\\s*").matcher(type).matches() || type.trim().replaceAll("\\s", "").length() != type.trim().length()) {
// $NON-NLS-1$//$NON-NLS-2$
infoLabel.setText(Messages.SimpleTypeInputDialog_infoLabelText);
getButton(IDialogConstants.OK_ID).setEnabled(false);
return;
}
type = type.trim();
if (!XSDUtil.isValidatedXSDName(type)) {
infoLabel.setText(Messages.InvalidName_Message);
getButton(IDialogConstants.OK_ID).setEnabled(false);
return;
}
for (XSDTypeDefinition simpType : xsdSchema.getTypeDefinitions()) {
String typeToCompare = simpType.getName();
// $NON-NLS-1$
int delimiter = type.indexOf(" : ");
if (delimiter != -1) {
type = type.substring(0, delimiter);
}
if (typeToCompare.equals(type)) {
if (caller instanceof XSDNewSimpleTypeDefinition) {
infoLabel.setText(Messages.SimpleTypeInputDialog_SameName);
getButton(IDialogConstants.OK_ID).setEnabled(false);
} else if ((caller instanceof XSDChangeToSimpleTypeAction || caller instanceof XSDChangeBaseTypeAction) && simpType instanceof XSDComplexTypeDefinition) {
infoLabel.setText(Messages.SimpleTypeInputDialog_SameName);
getButton(IDialogConstants.OK_ID).setEnabled(false);
}
return;
}
}
}
Aggregations