Search in sources :

Example 1 with FOXUI

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);
    }
}
Also used : CreateNameSpaceAction(org.talend.designer.fileoutputxml.action.CreateNameSpaceAction) AddElementDialog(org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.AddElementDialog) CreateAttributeAction(org.talend.designer.fileoutputxml.action.CreateAttributeAction) CreateElementAction(org.talend.designer.fileoutputxml.action.CreateElementAction) FOXUI(org.talend.designer.fileoutputxml.ui.FOXUI)

Example 2 with FOXUI

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();
}
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)

Example 3 with FOXUI

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();
    }
}
Also used : DeleteNodeAction(org.talend.designer.fileoutputxml.action.DeleteNodeAction) FOXUI(org.talend.designer.fileoutputxml.ui.FOXUI)

Aggregations

FOXUI (org.talend.designer.fileoutputxml.ui.FOXUI)3 MessageBox (org.eclipse.swt.widgets.MessageBox)1 Shell (org.eclipse.swt.widgets.Shell)1 IConnection (org.talend.core.model.process.IConnection)1 CreateAttributeAction (org.talend.designer.fileoutputxml.action.CreateAttributeAction)1 CreateElementAction (org.talend.designer.fileoutputxml.action.CreateElementAction)1 CreateNameSpaceAction (org.talend.designer.fileoutputxml.action.CreateNameSpaceAction)1 DeleteNodeAction (org.talend.designer.fileoutputxml.action.DeleteNodeAction)1 FOXMultiSchemaUI (org.talend.designer.fileoutputxml.ui.FOXMultiSchemaUI)1 AddElementDialog (org.talend.metadata.managment.ui.wizard.metadata.xml.dialog.AddElementDialog)1