use of org.talend.designer.hl7.ui.data.HL7TreeNode in project tdi-studio-se by Talend.
the class DeleteHL7NodeAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
HL7TreeNode node = (HL7TreeNode) this.getStructuredSelection().getFirstElement();
if (node == null) {
return;
}
HL7TreeNode parent = node.getParent();
if (parent == null) {
return;
}
if (node instanceof Element) {
disconnectSubTree(node);
}
parent.removeChild(node);
xmlViewer.refresh(parent);
}
use of org.talend.designer.hl7.ui.data.HL7TreeNode in project tdi-studio-se by Talend.
the class HL7DisconnectAction method init.
public void init() {
HL7TreeNode node = (HL7TreeNode) this.getStructuredSelection().getFirstElement();
this.setEnabled(node != null && node.hasLink());
}
use of org.talend.designer.hl7.ui.data.HL7TreeNode in project tdi-studio-se by Talend.
the class HL7DisconnectAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
HL7TreeNode node = (HL7TreeNode) this.getStructuredSelection().getFirstElement();
if (node == null) {
return;
}
node.setColumn(null);
node.setColumnName(null);
xmlViewer.refresh(node);
xmlViewer.expandAll();
if (hl7ui != null) {
hl7ui.redrawLinkers();
} else if (form != null) {
form.refreshLinks();
}
}
use of org.talend.designer.hl7.ui.data.HL7TreeNode in project tdi-studio-se by Talend.
the class HL7FixValueAction method init.
public void init() {
this.setEnabled(false);
HL7TreeNode node = (HL7TreeNode) this.getStructuredSelection().getFirstElement();
if (node == null) {
this.setEnabled(false);
return;
}
if (node.getParent() == null) {
this.setEnabled(false);
return;
}
if (node.getChildren() != null && node.getChildren().size() > 0) {
this.setEnabled(false);
return;
}
if (node.getColumn() == null) {
this.setEnabled(false);
}
this.setEnabled(true);
}
use of org.talend.designer.hl7.ui.data.HL7TreeNode in project tdi-studio-se by Talend.
the class HL7PublicUtil method tableLoader.
public void tableLoader(Element element, String parentPath, List<HL7FileNode> table, String defaultValue, Map<String, Integer> orderMap) {
HL7FileNode hl7FileNode = ConnectionFactory.eINSTANCE.createHL7FileNode();
String currentPath = parentPath + "/" + element.getLabel();
hl7FileNode.setFilePath(currentPath);
hl7FileNode.setRelatedColumn(element.getColumnLabel());
hl7FileNode.setAttribute(element.isMain() ? "main" : "branch");
hl7FileNode.setDefaultValue(defaultValue);
// xmlFileNode.setType(element.getDataType());
hl7FileNode.setOrder(getNodeOrder(element, orderMap));
hl7FileNode.setRepeatable(element.isRepetable());
table.add(hl7FileNode);
for (HL7TreeNode att : element.getAttributeChildren()) {
hl7FileNode = ConnectionFactory.eINSTANCE.createHL7FileNode();
hl7FileNode.setFilePath(att.getLabel());
hl7FileNode.setRelatedColumn(att.getColumnLabel());
hl7FileNode.setAttribute("attri");
hl7FileNode.setDefaultValue(att.getDefaultValue());
// xmlFileNode.setType(att.getDataType());
hl7FileNode.setOrder(getNodeOrder(att, orderMap));
hl7FileNode.setRepeatable(att.isRepetable());
table.add(hl7FileNode);
}
for (HL7TreeNode att : element.getNameSpaceChildren()) {
hl7FileNode = ConnectionFactory.eINSTANCE.createHL7FileNode();
hl7FileNode.setFilePath(att.getLabel());
hl7FileNode.setRelatedColumn(att.getColumnLabel());
hl7FileNode.setAttribute("ns");
hl7FileNode.setDefaultValue(att.getDefaultValue());
// xmlFileNode.setType(att.getDataType());
hl7FileNode.setOrder(getNodeOrder(att, orderMap));
hl7FileNode.setRepeatable(att.isRepetable());
table.add(hl7FileNode);
}
List<HL7TreeNode> children = element.getElementChildren();
for (HL7TreeNode child : children) {
// if (!child.isGroup() && !child.isLoop()) {
tableLoader((Element) child, currentPath, table, child.getDefaultValue(), orderMap);
// }
}
}
Aggregations