use of org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.NameSpaceDialog in project tdi-studio-se by Talend.
the class CreateNameSpaceAction method createChildNode.
/**
* Create the child node of the input node
*
* @param node
*/
private void createChildNode(FOXTreeNode node) {
String label = null;
String defaultValue = null;
while (!StringUtil.validateLabelForNameSpace(label) || !StringUtil.validateLabelForFixedValue(defaultValue)) {
NameSpaceDialog nsDialog = new NameSpaceDialog(null);
int status = nsDialog.open();
if (status == nsDialog.OK) {
defaultValue = nsDialog.getNSValue();
if (defaultValue != null) {
defaultValue = defaultValue.trim();
}
label = nsDialog.getPrefix().trim();
}
if (status == nsDialog.CANCEL) {
return;
}
}
FOXTreeNode child = new NameSpaceNode(label);
child.setDefaultValue(defaultValue);
// add by wzhang. set the row name
child.setRow(node.getRow());
node.addChild(child);
this.xmlViewer.refresh();
xmlViewer.expandToLevel(node, 1);
foxui.redrawLinkers();
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.NameSpaceDialog in project tdi-studio-se by Talend.
the class CreateJSONNameSpaceAction method createChildNode.
private void createChildNode(FOXTreeNode node) {
String label = null;
String defaultValue = null;
while (!JSONUtil.validateLabelForNameSpace(label) || !JSONUtil.validateLabelForFixedValue(defaultValue)) {
NameSpaceDialog nsDialog = new NameSpaceDialog(null);
int status = nsDialog.open();
if (status == nsDialog.OK) {
defaultValue = nsDialog.getNSValue();
if (defaultValue != null) {
defaultValue = defaultValue.trim();
}
label = nsDialog.getPrefix().trim();
}
if (status == nsDialog.CANCEL) {
return;
}
}
FOXTreeNode child = new NameSpaceNode(label);
child.setDefaultValue(defaultValue);
// add by wzhang. set the row name
child.setRow(node.getRow());
node.addChild(child);
this.jsonViewer.refresh();
jsonViewer.expandAll();
form.redrawLinkers();
}
Aggregations