Search in sources :

Example 1 with XSDChangeBaseTypeAction

use of com.amalto.workbench.actions.XSDChangeBaseTypeAction 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();
    }
}
Also used : XSDChangeBaseTypeAction(com.amalto.workbench.actions.XSDChangeBaseTypeAction) XSDSetAnnotationPrimaryKeyInfoAction(com.amalto.workbench.actions.XSDSetAnnotationPrimaryKeyInfoAction) XSDSetAnnotaionDisplayFormatAction(com.amalto.workbench.actions.XSDSetAnnotaionDisplayFormatAction) XSDNewComplexTypeDefinition(com.amalto.workbench.actions.XSDNewComplexTypeDefinition) XSDDeleteXPathAction(com.amalto.workbench.actions.XSDDeleteXPathAction) XSDSetAnnotationLabelAction(com.amalto.workbench.actions.XSDSetAnnotationLabelAction) XSDSetAnnotationDescriptionsAction(com.amalto.workbench.actions.XSDSetAnnotationDescriptionsAction) XSDSetFacetMessageAction(com.amalto.workbench.actions.XSDSetFacetMessageAction) XSDSkipToFKAction(com.amalto.workbench.actions.XSDSkipToFKAction) XSDDeleteElementAction(com.amalto.workbench.actions.XSDDeleteElementAction) XSDDeleteParticleAction(com.amalto.workbench.actions.XSDDeleteParticleAction) XSDNewElementAction(com.amalto.workbench.actions.XSDNewElementAction) XSDDeleteIdentityConstraintAction(com.amalto.workbench.actions.XSDDeleteIdentityConstraintAction) XSDNewIdentityConstraintAction(com.amalto.workbench.actions.XSDNewIdentityConstraintAction) XSDChangeToSimpleTypeAction(com.amalto.workbench.actions.XSDChangeToSimpleTypeAction) XSDEditXPathAction(com.amalto.workbench.actions.XSDEditXPathAction) XSDDeleteConceptWrapAction(com.amalto.workbench.actions.XSDDeleteConceptWrapAction) XSDEditConceptAction(com.amalto.workbench.actions.XSDEditConceptAction) XSDNewGroupFromTypeAction(com.amalto.workbench.actions.XSDNewGroupFromTypeAction) XSDEditParticleAction(com.amalto.workbench.actions.XSDEditParticleAction) XSDChangeToComplexTypeAction(com.amalto.workbench.actions.XSDChangeToComplexTypeAction) XSDEditComplexTypeAction(com.amalto.workbench.actions.XSDEditComplexTypeAction) XSDNewXPathAction(com.amalto.workbench.actions.XSDNewXPathAction) XSDGetXPathAction(com.amalto.workbench.actions.XSDGetXPathAction) XSDCopyConceptAction(com.amalto.workbench.actions.XSDCopyConceptAction) XSDNewSimpleTypeDefinition(com.amalto.workbench.actions.XSDNewSimpleTypeDefinition) XSDEditElementAction(com.amalto.workbench.actions.XSDEditElementAction) XSDAnnotationLookupFieldsAction(com.amalto.workbench.actions.XSDAnnotationLookupFieldsAction) XSDNewConceptAction(com.amalto.workbench.actions.XSDNewConceptAction) XSDDeleteAttributeAction(com.amalto.workbench.actions.XSDDeleteAttributeAction) XSDDeleteTypeDefinition(com.amalto.workbench.actions.XSDDeleteTypeDefinition)

Example 2 with XSDChangeBaseTypeAction

use of com.amalto.workbench.actions.XSDChangeBaseTypeAction 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;
        }
    }
}
Also used : XSDNewSimpleTypeDefinition(com.amalto.workbench.actions.XSDNewSimpleTypeDefinition) XSDChangeBaseTypeAction(com.amalto.workbench.actions.XSDChangeBaseTypeAction) XSDChangeToSimpleTypeAction(com.amalto.workbench.actions.XSDChangeToSimpleTypeAction) XSDComplexTypeDefinition(org.eclipse.xsd.XSDComplexTypeDefinition) XSDTypeDefinition(org.eclipse.xsd.XSDTypeDefinition)

Aggregations

XSDChangeBaseTypeAction (com.amalto.workbench.actions.XSDChangeBaseTypeAction)2 XSDChangeToSimpleTypeAction (com.amalto.workbench.actions.XSDChangeToSimpleTypeAction)2 XSDNewSimpleTypeDefinition (com.amalto.workbench.actions.XSDNewSimpleTypeDefinition)2 XSDAnnotationLookupFieldsAction (com.amalto.workbench.actions.XSDAnnotationLookupFieldsAction)1 XSDChangeToComplexTypeAction (com.amalto.workbench.actions.XSDChangeToComplexTypeAction)1 XSDCopyConceptAction (com.amalto.workbench.actions.XSDCopyConceptAction)1 XSDDeleteAttributeAction (com.amalto.workbench.actions.XSDDeleteAttributeAction)1 XSDDeleteConceptWrapAction (com.amalto.workbench.actions.XSDDeleteConceptWrapAction)1 XSDDeleteElementAction (com.amalto.workbench.actions.XSDDeleteElementAction)1 XSDDeleteIdentityConstraintAction (com.amalto.workbench.actions.XSDDeleteIdentityConstraintAction)1 XSDDeleteParticleAction (com.amalto.workbench.actions.XSDDeleteParticleAction)1 XSDDeleteTypeDefinition (com.amalto.workbench.actions.XSDDeleteTypeDefinition)1 XSDDeleteXPathAction (com.amalto.workbench.actions.XSDDeleteXPathAction)1 XSDEditComplexTypeAction (com.amalto.workbench.actions.XSDEditComplexTypeAction)1 XSDEditConceptAction (com.amalto.workbench.actions.XSDEditConceptAction)1 XSDEditElementAction (com.amalto.workbench.actions.XSDEditElementAction)1 XSDEditParticleAction (com.amalto.workbench.actions.XSDEditParticleAction)1 XSDEditXPathAction (com.amalto.workbench.actions.XSDEditXPathAction)1 XSDGetXPathAction (com.amalto.workbench.actions.XSDGetXPathAction)1 XSDNewComplexTypeDefinition (com.amalto.workbench.actions.XSDNewComplexTypeDefinition)1