use of org.talend.designer.fileoutputxml.ui.FOXUI in project tdi-studio-se by Talend.
the class AddTreeNodeButton method handleSelectionEvent.
protected void handleSelectionEvent(TreeSelection selection) {
final FOXUI foxUI = manager.getUiManager().getFoxUI();
if (foxUI != null) {
AddElementDialog dialog = new AddElementDialog(parent.getShell());
if (dialog.open() == Window.CANCEL) {
return;
}
if (AddElementDialog.CREATE_AS_SUBELEMENT.equals(dialog.getSelectValue())) {
CreateElementAction createElement = new CreateElementAction(foxUI.getTreeViewer(), foxUI, "");
createElement.run();
} else if (AddElementDialog.CREATE_AS_ATTRIBUTE.equals(dialog.getSelectValue())) {
CreateAttributeAction createAttr = new CreateAttributeAction(foxUI.getTreeViewer(), foxUI, "");
createAttr.run();
} else if (AddElementDialog.CREATE_AS_NAME_SPACE.equals(dialog.getSelectValue())) {
CreateNameSpaceAction createNameSpace = new CreateNameSpaceAction(foxUI.getTreeViewer(), foxUI, "");
createNameSpace.run();
}
treeViewer.setSelection(selection);
}
}
use of org.talend.designer.fileoutputxml.ui.FOXUI in project tdi-studio-se by Talend.
the class FOXMain method createUI.
/**
* create UI".
*
* @param parent
* @return
*/
public void createUI(Composite parent) {
if (!connector.istWriteXMLField() && !connector.istMDMOutput()) {
IConnection inConn = null;
List<? extends IConnection> incomeConnections = connector.getIncomingConnections();
if (connector.istFileOutputMSXML() && incomeConnections.size() < 1) {
MessageBox message = new MessageBox(parent.getShell(), SWT.APPLICATION_MODAL | SWT.OK);
//$NON-NLS-1$
message.setText(Messages.getString("FOXMain.inputlinkError"));
//$NON-NLS-1$
message.setMessage(Messages.getString("FOXMain.noInputLink"));
if (message.open() == SWT.OK) {
((Shell) parent).close();
return;
}
for (IConnection conn : incomeConnections) {
if ((conn.getLineStyle().equals(EConnectionType.FLOW_MAIN)) || (conn.getLineStyle().equals(EConnectionType.FLOW_REF))) {
inConn = conn;
break;
}
}
if (inConn != null) {
if (!inConn.getMetadataTable().sameMetadataAs(connector.getMetadataList().get(0))) {
MessageBox messageBox = new MessageBox(parent.getShell(), SWT.APPLICATION_MODAL | SWT.OK);
//$NON-NLS-1$
messageBox.setText(Messages.getString("FOXMain.0"));
//$NON-NLS-1$
messageBox.setMessage(Messages.getString("FOXMain.1"));
if (messageBox.open() == SWT.OK) {
((Shell) parent).close();
return;
}
}
}
}
}
// add by wzhang. for component tFileOutputMSXML
if (connector.istFileOutputMSXML()) {
generatorUI = new FOXMultiSchemaUI(parent, foxManager);
} else {
generatorUI = new FOXUI(parent, foxManager);
}
generatorUI.init();
}
use of org.talend.designer.fileoutputxml.ui.FOXUI in project tdi-studio-se by Talend.
the class RemoveTreeNodeButton method handleSelectionEvent.
protected void handleSelectionEvent(TreeSelection selection) {
final FOXUI foxUI = manager.getUiManager().getFoxUI();
if (foxUI != null) {
DeleteNodeAction deleteAction = new DeleteNodeAction(foxUI.getTreeViewer(), foxUI, "");
deleteAction.run();
}
}
Aggregations