use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class RemoveGroupAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
FOXTreeNode node = (FOXTreeNode) this.getStructuredSelection().getFirstElement();
node.setGroup(false);
// TreeUtil.clearLoopNode((FOXTreeNode) xmlViewer.getTree().getItem(0).getData());
// TreeUtil.guessAndSetLoopNode((FOXTreeNode) xmlViewer.getTree().getItem(0).getData());
xmlViewer.refresh();
foxui.updateStatus();
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class SetForLoopAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
FOXTreeNode node = (FOXTreeNode) this.getStructuredSelection().getFirstElement();
if (node.isLoop()) {
return;
}
FOXManager foxManager = foxui.getFoxManager();
FOXTreeNode rootTreeData = foxManager.getRootFOXTreeNode(node);
TreeUtil.clearSubGroupNode(node);
// make sure group element is a ancestor of loop, or no group element.
if (TreeUtil.findUpGroupNode(node) == null) {
TreeUtil.clearSubGroupNode(rootTreeData);
}
TreeUtil.clearLoopNode(rootTreeData);
TreeUtil.clearMainNode(rootTreeData);
if (node.isGroup()) {
node.setGroup(false);
}
node.setLoop(true);
if (this.value) {
if (foxui != null && node.isGroup()) {
foxui.updateStatus();
}
TreeUtil.upsetMainNode(node);
xmlViewer.refresh();
} else {
if (foxui != null) {
foxui.updateStatus();
}
TreeUtil.upsetMainNode(node);
xmlViewer.refresh();
}
this.foxui.updateStatus();
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class DisconnectAction method selectionChanged.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.actions.SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
*/
@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 Schema2XMLLinker method createLinks.
/**
* amaumont Comment method "createLinks".
*/
public void createLinks() {
removeAllLinks();
getBackgroundRefresher().refreshBackground();
ProgressDialog progressDialog = new ProgressDialog(getSource().getShell(), 1000) {
private IProgressMonitor monitorWrap;
@Override
public void run(IProgressMonitor monitor) {
List<FOXTreeNode> treeData = getManager().getTreeData(getManager().getCurrentSchema());
createLoopLinks(treeData);
getBackgroundRefresher().refreshBackground();
}
};
try {
progressDialog.executeProcess();
} catch (InvocationTargetException e) {
ExceptionHandler.process(e);
} catch (InterruptedException e) {
// Nothing to do
ExceptionHandler.process(e);
}
}
use of org.talend.metadata.managment.ui.wizard.metadata.xml.node.FOXTreeNode in project tdi-studio-se by Talend.
the class AddTreeNodeButton method updateStatus.
@Override
protected void updateStatus(TreeSelection selection) {
if (selection.getFirstElement() instanceof FOXTreeNode) {
FOXTreeNode node = (FOXTreeNode) selection.getFirstElement();
if (node == null) {
getButton().setEnabled(false);
return;
}
if (node instanceof Attribute) {
getButton().setEnabled(false);
return;
}
if (node instanceof NameSpaceNode) {
getButton().setEnabled(false);
return;
}
getButton().setEnabled(true);
} else {
getButton().setEnabled(false);
}
}
Aggregations