Search in sources :

Example 41 with FOXTreeNode

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());
}
Also used : FOXTreeNode(org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode)

Example 42 with FOXTreeNode

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());
}
Also used : FOXTreeNode(org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode) NameSpaceNode(org.talend.metadata.managment.ui.wizard.metadata.xml.node.NameSpaceNode) Attribute(org.talend.metadata.managment.ui.wizard.metadata.xml.node.Attribute)

Example 43 with FOXTreeNode

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();
}
Also used : FOXTreeNode(org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode)

Example 44 with FOXTreeNode

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();
}
Also used : FOXTreeNode(org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode) InputDialog(org.eclipse.jface.dialogs.InputDialog) Attribute(org.talend.metadata.managment.ui.wizard.metadata.xml.node.Attribute)

Example 45 with FOXTreeNode

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();
}
Also used : FOXTreeNode(org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode)

Aggregations

FOXTreeNode (org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode)93 Attribute (org.talend.metadata.managment.ui.wizard.metadata.xml.node.Attribute)29 Element (org.talend.metadata.managment.ui.wizard.metadata.xml.node.Element)29 NameSpaceNode (org.talend.metadata.managment.ui.wizard.metadata.xml.node.NameSpaceNode)28 ArrayList (java.util.ArrayList)23 Iterator (java.util.Iterator)10 HashMap (java.util.HashMap)8 TreeItem (org.eclipse.swt.widgets.TreeItem)7 Map (java.util.Map)6 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)5 TreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode)5 List (java.util.List)4 InputDialog (org.eclipse.jface.dialogs.InputDialog)4 TreePath (org.eclipse.jface.viewers.TreePath)4 EList (org.eclipse.emf.common.util.EList)3 TableItem (org.eclipse.swt.widgets.TableItem)3 Tree (org.eclipse.swt.widgets.Tree)3 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)3 IConnection (org.talend.core.model.process.IConnection)3 ATreeNode (org.talend.datatools.xml.utils.ATreeNode)3