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);
}
}
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);
}
}
Aggregations