use of org.talend.designer.xmlmap.ui.tabs.table.TreeSchemaTableEntry in project tdi-studio-se by Talend.
the class SetLoopFunctionDialog method updateStatus.
private void updateStatus(boolean refreshTree) {
if (refreshTree) {
tableViwer.getTableViewerCreator().getTableViewer().refresh();
}
List<String> xpath = new ArrayList<String>();
boolean findDuplicated = false;
for (TreeSchemaTableEntry entry : tableModel.getBeansList()) {
if (xpath.contains(entry.getXPath())) {
findDuplicated = true;
} else {
xpath.add(entry.getXPath());
}
}
Button button = getButton(IDialogConstants.OK_ID);
if (findDuplicated) {
statusLabel.setText("Duplicated source loop node exist in the table ,please remove it.");
button.setEnabled(false);
} else {
statusLabel.setText("");
button.setEnabled(true);
}
}
use of org.talend.designer.xmlmap.ui.tabs.table.TreeSchemaTableEntry in project tdi-studio-se by Talend.
the class SetLoopFunctionDialog method okPressed.
@Override
protected void okPressed() {
List<TreeNode> usedLoops = new ArrayList<TreeNode>();
for (TreeSchemaTableEntry entry : tableModel.getBeansList()) {
usedLoops.add(entry.getTreeNode());
}
inputLoopNodesTable.getInputloopnodes().clear();
inputLoopNodesTable.getInputloopnodes().addAll(usedLoops);
super.okPressed();
}
use of org.talend.designer.xmlmap.ui.tabs.table.TreeSchemaTableEntry in project tdi-studio-se by Talend.
the class MapperManager method getSelectedInputTreeSchemaModel.
public ExtendedTableModel<TreeSchemaTableEntry> getSelectedInputTreeSchemaModel(InputXmlTree inputXmlTree) {
if (inputXmlTree == null && !getExternalData().getInputTrees().isEmpty()) {
inputXmlTree = getExternalData().getInputTrees().get(0);
}
List<TreeSchemaTableEntry> treeSchemaEntrys = new ArrayList<TreeSchemaTableEntry>();
ExtendedTableModel<TreeSchemaTableEntry> tableModel = new ExtendedTableModel<TreeSchemaTableEntry>("Tree Schema", treeSchemaEntrys);
if (inputXmlTree != null) {
tableModel.setName(inputXmlTree.getName());
EList<TreeNode> nodes = inputXmlTree.getNodes();
for (TreeNode node : nodes) {
if (XmlMapUtil.DOCUMENT.equals(node.getType())) {
addTreeSchemaEnties(tableModel, node.getChildren());
}
}
}
return tableModel;
}
use of org.talend.designer.xmlmap.ui.tabs.table.TreeSchemaTableEntry in project tdi-studio-se by Talend.
the class MapperManager method getSelectedOutputTreeSchemaModel.
public ExtendedTableModel<TreeSchemaTableEntry> getSelectedOutputTreeSchemaModel(OutputXmlTree outputXmlTree) {
if (outputXmlTree == null && !getExternalData().getOutputTrees().isEmpty()) {
outputXmlTree = getExternalData().getOutputTrees().get(0);
}
List<TreeSchemaTableEntry> treeSchemaEntrys = new ArrayList<TreeSchemaTableEntry>();
ExtendedTableModel<TreeSchemaTableEntry> tableModel = new ExtendedTableModel<TreeSchemaTableEntry>("Tree Schema", treeSchemaEntrys);
if (outputXmlTree != null) {
tableModel.setName(outputXmlTree.getName());
EList<OutputTreeNode> nodes = outputXmlTree.getNodes();
for (TreeNode node : nodes) {
if (XmlMapUtil.DOCUMENT.equals(node.getType())) {
addTreeSchemaEnties(tableModel, node.getChildren());
}
}
}
return tableModel;
}
use of org.talend.designer.xmlmap.ui.tabs.table.TreeSchemaTableEntry in project tdi-studio-se by Talend.
the class MapperManager method addTreeSchemaEnties.
private void addTreeSchemaEnties(ExtendedTableModel<TreeSchemaTableEntry> tableModel, EList<TreeNode> nodes) {
for (TreeNode node : nodes) {
// avoid to edit choice and subs in schema editor
if (!node.isChoice() && !node.isSubstitution()) {
TreeSchemaTableEntry entry = new TreeSchemaTableEntry(node);
tableModel.add(entry);
}
if (!node.getChildren().isEmpty()) {
addTreeSchemaEnties(tableModel, node.getChildren());
}
}
}
Aggregations