use of org.talend.core.model.process.AbstractNode in project tdi-studio-se by Talend.
the class AlfrescoOutputManager method createUI.
/**
* Checks the connections and creates the UI (a dialog actually)
*
* @param parent
* @return
*/
public AlfrescoModelDialog createUI(Composite parent) {
IConnection inConn = null;
AbstractNode connector = this.alfrescoOutputComponent;
for (IConnection conn : connector.getIncomingConnections()) {
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("AlfrescoOutputManager.schemaError.title"));
//$NON-NLS-1$
messageBox.setMessage(Messages.getString("AlfrescoOutputManager.schemaError.msg"));
if (messageBox.open() == SWT.OK) {
((Shell) parent).close();
return null;
}
}
}
// first load the model :
try {
// NB. or when modelManager is created
modelManager.load();
} catch (AlfrescoOutputException aoex) {
MessageDialog.openError(new Shell(Display.getCurrent(), SWT.APPLICATION_MODAL), Messages.getString("AlfrescoOutputManager.failedLoadModel"), //$NON-NLS-1$
aoex.getMessage());
modelManager.clear();
}
// then create and open the model dialog :
AlfrescoModelDialog alfrescoModelDialog = new AlfrescoModelDialog(parent.getShell(), this);
alfrescoModelDialog.open();
// NB. this dialog is non-blocking ; model save is done in its okPressed()
return alfrescoModelDialog;
}
Aggregations