Search in sources :

Example 1 with FOXMultiSchemaUI

use of org.talend.designer.fileoutputxml.ui.FOXMultiSchemaUI 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();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) FOXMultiSchemaUI(org.talend.designer.fileoutputxml.ui.FOXMultiSchemaUI) IConnection(org.talend.core.model.process.IConnection) FOXUI(org.talend.designer.fileoutputxml.ui.FOXUI) MessageBox(org.eclipse.swt.widgets.MessageBox)

Aggregations

MessageBox (org.eclipse.swt.widgets.MessageBox)1 Shell (org.eclipse.swt.widgets.Shell)1 IConnection (org.talend.core.model.process.IConnection)1 FOXMultiSchemaUI (org.talend.designer.fileoutputxml.ui.FOXMultiSchemaUI)1 FOXUI (org.talend.designer.fileoutputxml.ui.FOXUI)1