Search in sources :

Example 1 with AddElementDialog

use of org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.AddElementDialog in project tdi-studio-se by Talend.

the class AddTreeNodeButton method handleSelectionEvent.

protected void handleSelectionEvent(TreeSelection selection) {
    final FOXUI foxUI = manager.getUiManager().getFoxUI();
    if (foxUI != null) {
        AddElementDialog dialog = new AddElementDialog(parent.getShell());
        if (dialog.open() == Window.CANCEL) {
            return;
        }
        if (AddElementDialog.CREATE_AS_SUBELEMENT.equals(dialog.getSelectValue())) {
            CreateElementAction createElement = new CreateElementAction(foxUI.getTreeViewer(), foxUI, "");
            createElement.run();
        } else if (AddElementDialog.CREATE_AS_ATTRIBUTE.equals(dialog.getSelectValue())) {
            CreateAttributeAction createAttr = new CreateAttributeAction(foxUI.getTreeViewer(), foxUI, "");
            createAttr.run();
        } else if (AddElementDialog.CREATE_AS_NAME_SPACE.equals(dialog.getSelectValue())) {
            CreateNameSpaceAction createNameSpace = new CreateNameSpaceAction(foxUI.getTreeViewer(), foxUI, "");
            createNameSpace.run();
        }
        treeViewer.setSelection(selection);
    }
}
Also used : CreateNameSpaceAction(org.talend.designer.fileoutputxml.action.CreateNameSpaceAction) AddElementDialog(org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.AddElementDialog) CreateAttributeAction(org.talend.designer.fileoutputxml.action.CreateAttributeAction) CreateElementAction(org.talend.designer.fileoutputxml.action.CreateElementAction) FOXUI(org.talend.designer.fileoutputxml.ui.FOXUI)

Example 2 with AddElementDialog

use of org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.AddElementDialog in project tdi-studio-se by Talend.

the class AddTreeNodeButton method handleSelectionEvent.

protected void handleSelectionEvent(TreeSelection selection) {
    if (form != null) {
        AddElementDialog dialog = new AddElementDialog(parent.getShell());
        if (dialog.open() == Window.CANCEL) {
            return;
        }
        if (AddElementDialog.CREATE_AS_SUBELEMENT.equals(dialog.getSelectValue())) {
            CreateJSONElementAction createElement = new CreateJSONElementAction(treeViewer, form, "");
            createElement.run();
        } else if (AddElementDialog.CREATE_AS_ATTRIBUTE.equals(dialog.getSelectValue())) {
            CreateJSONAttributeAction createAttr = new CreateJSONAttributeAction(treeViewer, form, "");
            createAttr.run();
        } else if (AddElementDialog.CREATE_AS_NAME_SPACE.equals(dialog.getSelectValue())) {
            CreateJSONNameSpaceAction createNameSpace = new CreateJSONNameSpaceAction(treeViewer, form, "");
            createNameSpace.run();
        }
        treeViewer.setSelection(selection);
    }
}
Also used : CreateJSONElementAction(org.talend.repository.json.ui.wizards.action.CreateJSONElementAction) CreateJSONNameSpaceAction(org.talend.repository.json.ui.wizards.action.CreateJSONNameSpaceAction) AddElementDialog(org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.AddElementDialog) CreateJSONAttributeAction(org.talend.repository.json.ui.wizards.action.CreateJSONAttributeAction)

Aggregations

AddElementDialog (org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.AddElementDialog)2 CreateAttributeAction (org.talend.designer.fileoutputxml.action.CreateAttributeAction)1 CreateElementAction (org.talend.designer.fileoutputxml.action.CreateElementAction)1 CreateNameSpaceAction (org.talend.designer.fileoutputxml.action.CreateNameSpaceAction)1 FOXUI (org.talend.designer.fileoutputxml.ui.FOXUI)1 CreateJSONAttributeAction (org.talend.repository.json.ui.wizards.action.CreateJSONAttributeAction)1 CreateJSONElementAction (org.talend.repository.json.ui.wizards.action.CreateJSONElementAction)1 CreateJSONNameSpaceAction (org.talend.repository.json.ui.wizards.action.CreateJSONNameSpaceAction)1