use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class JSONDisconnectAction method selectionChanged.
@Override
public void selectionChanged(IStructuredSelection selection) {
FOXTreeNode node = (FOXTreeNode) this.getStructuredSelection().getFirstElement();
this.setEnabled(node != null && node.hasLink());
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class RemoveJSONGroupAction method selectionChanged.
@Override
public void selectionChanged(IStructuredSelection selection) {
FOXTreeNode node = (FOXTreeNode) this.getStructuredSelection().getFirstElement();
if (node == null) {
this.setEnabled(false);
return;
}
if (node instanceof Attribute) {
this.setEnabled(false);
return;
}
if (node instanceof NameSpaceNode) {
this.setEnabled(false);
return;
}
this.setEnabled(node.isGroup());
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class SetJSONGroupAction method run.
@Override
public void run() {
FOXTreeNode node = (FOXTreeNode) this.getStructuredSelection().getFirstElement();
if (node.isGroup()) {
return;
}
FOXTreeNode rootTreeData = TreeUtil.getRootFOXTreeNode(node);
TreeUtil.clearSubGroupNode(rootTreeData);
node.setGroup(true);
form.updateStatus();
jsonViewer.refresh();
form.updateConnection();
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class CreateJSONAttributeAction method createChildNode.
private void createChildNode(FOXTreeNode node) {
String label = "";
while (!JSONUtil.validateLabelForJSON(label)) {
InputDialog dialog = new InputDialog(null, "Input attribute's label", "Input the new attribute's valid label", "", null);
int status = dialog.open();
if (status == InputDialog.OK) {
label = dialog.getValue().trim();
}
if (status == InputDialog.CANCEL) {
return;
}
}
FOXTreeNode child = new Attribute(label);
// child.setRow(node.getRow());
node.addChild(child);
this.jsonViewer.refresh();
jsonViewer.expandAll();
form.redrawLinkers();
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class CreateJSONAttributeAction method run.
@Override
public void run() {
FOXTreeNode node = (FOXTreeNode) this.getStructuredSelection().getFirstElement();
if (node != null) {
createChildNode(node);
}
form.updateConnection();
}
Aggregations