Search in sources :

Example 36 with MDMServerDef

use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.

the class MDMServerObjectImpl method basicSetLastServerDef.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetLastServerDef(MDMServerDef newLastServerDef, NotificationChain msgs) {
    MDMServerDef oldLastServerDef = lastServerDef;
    lastServerDef = newLastServerDef;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MdmserverobjectPackage.MDM_SERVER_OBJECT__LAST_SERVER_DEF, oldLastServerDef, newLastServerDef);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 37 with MDMServerDef

use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.

the class MDMServerDefItemImpl method setServerDef.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setServerDef(MDMServerDef newServerDef) {
    MDMServerDef oldServerDef = serverDef;
    serverDef = newServerDef;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, MdmpropertiesPackage.MDM_SERVER_DEF_ITEM__SERVER_DEF, oldServerDef, serverDef));
    }
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 38 with MDMServerDef

use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.

the class DeployAllDialog method createDialogArea.

/**
 * Create contents of the dialog.
 *
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    mainContainer = (Composite) super.createDialogArea(parent);
    GridLayout mainContainerLayout = (GridLayout) mainContainer.getLayout();
    mainContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    mainContainerLayout.numColumns = 2;
    Label lblNewLabel_selserver = new Label(mainContainer, SWT.NONE);
    lblNewLabel_selserver.setText(Messages.DeployAllDialog_label_selectserver);
    lblNewLabel_selserver.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
    errorLabel = new Label(mainContainer, SWT.NONE);
    errorLabelLayoutData = new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1);
    errorLabelLayoutData.exclude = true;
    errorLabel.setLayoutData(errorLabelLayoutData);
    errorLabel.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_RED));
    comboViewer = new ComboViewer(mainContainer, SWT.DROP_DOWN | SWT.READ_ONLY);
    Combo combo = comboViewer.getCombo();
    GridData data = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1);
    combo.setLayoutData(data);
    comboViewer.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            MDMServerDef serverDef = (MDMServerDef) element;
            // $NON-NLS-1$ //$NON-NLS-2$;
            return serverDef.getName() + " (" + serverDef.getHost() + ")";
        }
    });
    comboViewer.setContentProvider(new ArrayContentProvider());
    Label emptyLabel = new Label(mainContainer, SWT.NONE);
    GridData emptydata = new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1);
    emptydata.widthHint = 98;
    emptyLabel.setLayoutData(emptydata);
    List<MDMServerDef> allServerDefs = ServerDefService.getAllServerDefs();
    comboViewer.setInput(allServerDefs);
    comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            serverDef = (MDMServerDef) ((IStructuredSelection) comboViewer.getSelection()).getFirstElement();
            treeViewer.updateCurrentServerDef(null, serverDef);
            updateErrorMsgArea(treeViewer.isServerOk());
        }
    });
    final Button reconciliationBun = new Button(mainContainer, SWT.CHECK);
    reconciliationBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            treeViewer.enableReconciliation(reconciliationBun.getSelection());
        }
    });
    reconciliationBun.setText(Messages.DeployAllDialog_reconciliation);
    reconciliationBun.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
    Composite container = new Composite(mainContainer, SWT.BORDER);
    container.setLayout(new GridLayout(2, false));
    container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    Label lblNewLabel = new Label(container, SWT.NONE);
    lblNewLabel.setText(Messages.DeployAllDialog_label);
    new Label(container, SWT.NONE);
    List<AbstractDeployCommand> commands = CommandManager.getInstance().getAllDeployCommands();
    treeViewer = new RepositoryViewObjectCheckedWidget(container, initType, commands);
    treeViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 3));
    Button selAllButton = new Button(container, SWT.NONE);
    selAllButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            treeViewer.selectAll(true);
        }
    });
    selAllButton.setText(Messages.DeployAllDialog_selectAll);
    Button deselAllBun = new Button(container, SWT.NONE);
    deselAllBun.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
    deselAllBun.setText(Messages.DeployAllDialog_deselectAll);
    deselAllBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            treeViewer.selectAll(false);
        }
    });
    Button skipDeployedBun = new Button(container, SWT.NONE);
    skipDeployedBun.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
    skipDeployedBun.setText(Messages.DeployAllDialog_skipDeployed);
    skipDeployedBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            treeViewer.skipDeployedObjects();
        }
    });
    initComboSelect();
    return container;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Combo(org.eclipse.swt.widgets.Combo) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) RepositoryViewObjectCheckedWidget(org.talend.mdm.repository.ui.widgets.RepositoryViewObjectCheckedWidget) GridLayout(org.eclipse.swt.layout.GridLayout) ComboViewer(org.eclipse.jface.viewers.ComboViewer) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) AbstractDeployCommand(org.talend.mdm.repository.core.command.deploy.AbstractDeployCommand) LabelProvider(org.eclipse.jface.viewers.LabelProvider) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 39 with MDMServerDef

use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.

the class DeployAllDialog method initComboSelect.

private void initComboSelect() {
    MDMServerDef sameServerDef = treeViewer.getSameServerDef();
    List<MDMServerDef> serverDefs = (List<MDMServerDef>) comboViewer.getInput();
    MDMServerDef defaultServerDef = null;
    if (serverDefs != null) {
        if (sameServerDef != null) {
            for (MDMServerDef def : serverDefs) {
                if (def.getName().equals(sameServerDef.getName())) {
                    defaultServerDef = def;
                    break;
                }
            }
        }
        if (defaultServerDef == null && serverDefs.size() > 0) {
            defaultServerDef = serverDefs.get(0);
        }
    }
    if (defaultServerDef != null) {
        comboViewer.setSelection(new StructuredSelection(defaultServerDef));
    }
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) List(java.util.List) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 40 with MDMServerDef

use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.

the class RepositoryViewFilterDialog method createDialogArea.

/**
 * Create contents of the dialog.
 *
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    GridLayout gl_container = new GridLayout(1, false);
    gl_container.marginRight = 5;
    container.setLayout(gl_container);
    Group nameGroup = new Group(container, SWT.NONE);
    nameGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    GridLayout gl_nameGroup = new GridLayout(1, false);
    nameGroup.setLayout(gl_nameGroup);
    nameGroup.setText(Messages.RepositoryViewFilterDialog_groupNamePattern);
    enableNameFilterBun = new Button(nameGroup, SWT.CHECK);
    enableNameFilterBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            namePatternTxt.setEnabled(enableNameFilterBun.getSelection());
        }
    });
    enableNameFilterBun.setText(Messages.RepositoryViewFilterDialog_enableNameFilter);
    namePatternTxt = new Text(nameGroup, SWT.BORDER);
    namePatternTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    namePatternTxt.setSize(440, 18);
    objectgroup = new Group(container, SWT.NONE);
    objectgroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    objectgroup.setText(Messages.RepositoryViewFilterDialog_groupServerObject);
    objectgroup.setLayout(new GridLayout(1, false));
    enableServerObjFilterBun = new Button(objectgroup, SWT.CHECK);
    enableServerObjFilterBun.setSize(183, 16);
    enableServerObjFilterBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            enableServerObjFilterComposite(enableServerObjFilterBun.getSelection());
        }
    });
    enableServerObjFilterBun.setText(Messages.RepositoryViewFilterDialog_enableServerObjFilter);
    serverObjViewer = CheckboxTableViewer.newCheckList(objectgroup, SWT.BORDER | SWT.FULL_SELECTION);
    table = serverObjViewer.getTable();
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    table.setSize(441, 121);
    enableAllBun = new Button(objectgroup, SWT.CHECK);
    enableAllBun.setSize(171, 16);
    enableAllBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean selected = enableAllBun.getSelection();
            enableAllBun.setSelection(selected);
            serverObjViewer.setAllChecked(selected);
            if (selected)
                enabledConfigs.addAll(allConfigs);
            else
                enabledConfigs.clear();
        }
    });
    enableAllBun.setText(Messages.RepositoryViewFilterDialog_enableAllServerObject);
    // 
    serverObjViewer.addCheckStateListener(new ICheckStateListener() {

        public void checkStateChanged(CheckStateChangedEvent event) {
            IRepositoryViewObject config = (IRepositoryViewObject) event.getElement();
            if (event.getChecked())
                enabledConfigs.add(config);
            else
                enabledConfigs.remove(config);
            solveProcTriCase();
            enableAllBun.setSelection(enabledConfigs.size() == allConfigs.size());
        }
    });
    serverObjViewer.setLabelProvider(new MDMRepositoryLabelProvider());
    serverObjViewer.setContentProvider(new ArrayContentProvider());
    Group lastServerGroup = new Group(container, SWT.NONE);
    lastServerGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    lastServerGroup.setLayout(new GridLayout(3, false));
    lastServerGroup.setText(Messages.RepositoryViewFilterDialog_groupLastServer);
    enableLastServerFilterBun = new Button(lastServerGroup, SWT.CHECK);
    enableLastServerFilterBun.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    enableLastServerFilterBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            enableLastServerFilterComposite(enableLastServerFilterBun.getSelection());
        }
    });
    enableLastServerFilterBun.setText(Messages.RepositoryViewFilterDialog_enableLastServerFilter);
    enableLastServerFilterBun.setSelection(false);
    new Label(lastServerGroup, SWT.NONE);
    lastServerLabel = new Label(lastServerGroup, SWT.NONE);
    lastServerLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lastServerLabel.setText(Messages.RepositoryViewFilterDialog_lblLastServer);
    serverNameTxt = new Text(lastServerGroup, SWT.BORDER | SWT.READ_ONLY);
    serverNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    selServerBun = new Button(lastServerGroup, SWT.NONE);
    selServerBun.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            SelectServerDefDialog dlg = new SelectServerDefDialog(getShell());
            if (dlg.open() == IDialogConstants.OK_ID) {
                MDMServerDef def = dlg.getSelectedServerDef();
                serverNameTxt.setText(def.getName());
            }
        }
    });
    selServerBun.setText(Messages.RepositoryViewFilterDialog_btnSelectServer);
    // 
    getShell().setText(Messages.RepositoryViewFilterDialog_title);
    // 
    initServerObjectFilter();
    return container;
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) MDMRepositoryLabelProvider(org.talend.mdm.repository.ui.navigator.MDMRepositoryLabelProvider) ICheckStateListener(org.eclipse.jface.viewers.ICheckStateListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) CheckStateChangedEvent(org.eclipse.jface.viewers.CheckStateChangedEvent) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Aggregations

MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)66 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)36 SelectServerDefDialog (org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog)15 Item (org.talend.core.model.properties.Item)11 MDMServerDefItem (org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem)10 MDMServerObjectItem (org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem)10 IStatus (org.eclipse.core.runtime.IStatus)8 MDMServerObject (org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)8 PersistenceException (org.talend.commons.exception.PersistenceException)7 AbstractDeployCommand (org.talend.mdm.repository.core.command.deploy.AbstractDeployCommand)7 TMDMService (com.amalto.workbench.webservices.TMDMService)6 CommandManager (org.talend.mdm.repository.core.command.CommandManager)6 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)6 TreeObject (com.amalto.workbench.models.TreeObject)5 XtentisException (com.amalto.workbench.utils.XtentisException)5 ArrayList (java.util.ArrayList)5 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)5 Test (org.junit.Test)5 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)5 LinkedList (java.util.LinkedList)4