Search in sources :

Example 46 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class ComponentSettingsView method createButtonListener.

/**
     * DOC zwang Comment method "createButtons".
     */
private void createButtonListener() {
    // TODO Auto-generated method stub
    // tabFactory.getTabbedPropertyComposite().getComposite().setBackground(
    // ImageProvider.getImage(EImage.COMPOSITE_BACKGROUND).getBackground());
    Button compactButton = tabFactory.getTabbedPropertyComposite().getCompactButton();
    if (compactButton != null && !compactButton.isDisposed()) {
        compactButton.setVisible(true);
        if (compactListener == null) {
            compactListener = new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    getPreference().setValue(TalendDesignerPrefConstants.VIEW_OPTIONS, ComponentSettingsView.DEFAULT);
                    if (getDc() != null) {
                        getDc().dispose();
                        Composite composite = getParentMap().get(ComponentSettingsView.PARENT);
                        EComponentCategory category2 = getCategoryMap().get(ComponentSettingsView.CATEGORY);
                        if (composite != null && category2 != null) {
                            createDynamicComposite(composite, element, category2);
                        }
                    }
                }
            };
            compactButton.addSelectionListener(compactListener);
        }
    }
    Button tableButton = tabFactory.getTabbedPropertyComposite().getTableButton();
    if (tableButton != null && !tableButton.isDisposed()) {
        tableButton.setVisible(true);
        if (tableButtonListener == null) {
            tableButtonListener = new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    getPreference().setValue(TalendDesignerPrefConstants.VIEW_OPTIONS, ComponentSettingsView.TABLEVIEW);
                    if (getDc() != null) {
                        getDc().dispose();
                        Composite composite = getParentMap().get(ComponentSettingsView.PARENT);
                        EComponentCategory category2 = getCategoryMap().get(ComponentSettingsView.CATEGORY);
                        if (composite != null && category2 != null) {
                            createDynamicComposite(composite, element, category2);
                        }
                    }
                }
            };
            tableButton.addSelectionListener(tableButtonListener);
        }
    }
}
Also used : MainConnectionComposite(org.talend.designer.core.ui.editor.properties.connections.MainConnectionComposite) Composite(org.eclipse.swt.widgets.Composite) SubjobBasicComposite(org.talend.designer.core.ui.views.subjob.SubjobBasicComposite) AbstractNotePropertyComposite(org.talend.designer.core.ui.editor.properties.notes.AbstractNotePropertyComposite) MissingSettingsMultiThreadDynamicComposite(org.talend.designer.core.ui.views.properties.composites.MissingSettingsMultiThreadDynamicComposite) BasicNotePropertyComposite(org.talend.designer.core.ui.editor.properties.notes.BasicNotePropertyComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) EComponentCategory(org.talend.core.model.process.EComponentCategory)

Example 47 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class MissingSettingsMultiThreadDynamicComposite method afterCreateMessagesComposite.

@Override
public void afterCreateMessagesComposite(MessagesComposite messComposite) {
    final Element ele = this.getElement();
    if (ele instanceof Node && isVisibleTopMessages()) {
        final IComponent component = ((Node) ele).getComponent();
        messComposite.updateTopMessages(//$NON-NLS-1$
        Messages.getString(//$NON-NLS-1$
        "MissingSettingsMultiThreadDynamicComposite_missingModulesMessages", component.getName()), IStatus.WARNING);
        if (messComposite instanceof MessagesWithActionComposite) {
            MessagesWithActionComposite messWithActionComposite = (MessagesWithActionComposite) messComposite;
            messWithActionComposite.updateActionButton(//$NON-NLS-1$
            Messages.getString("MissingSettingsMultiThreadDynamicComposite.installName") + "...", //$NON-NLS-1$
            null);
            messWithActionComposite.addActionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    if (!missModulesNeeded.isEmpty()) {
                        ModulesInstallerUtil.forceInstallModules(getShell(), component, missModulesNeeded);
                        checkVisibleTopMessages();
                    }
                }
            });
        }
    }
    super.afterCreateMessagesComposite(messComposite);
}
Also used : IComponent(org.talend.core.model.components.IComponent) Element(org.talend.core.model.process.Element) Node(org.talend.designer.core.ui.editor.nodes.Node) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) MessagesWithActionComposite(org.talend.commons.ui.swt.composites.MessagesWithActionComposite)

Example 48 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class SchemaDetailsCheckBoxCellEditor method createControl.

@Override
protected Control createControl(Composite parent) {
    checkBtn = new Button(parent, SWT.CHECK);
    checkBtn.addKeyListener(new KeyAdapter() {

        public void keyReleased(KeyEvent e) {
            if (e.character == '') {
                // Escape
                fireCancelEditor();
            }
        }
    });
    checkBtn.addFocusListener(getButtonFocusListener());
    checkBtn.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            markDirty();
            doSetValue(checkBtn.getSelection());
        // fireApplyEditorValue();
        }
    });
    setValueValid(true);
    return checkBtn;
}
Also used : KeyEvent(org.eclipse.swt.events.KeyEvent) Button(org.eclipse.swt.widgets.Button) KeyAdapter(org.eclipse.swt.events.KeyAdapter) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 49 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class MemoryRuntimeComposite method addListeners.

private void addListeners() {
    runtimeButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            getRemoteStatus();
            boolean isRunButtonPressed = runtimeButton.getText().equals(Messages.getString("ProcessComposite.exec"));
            boolean isKillButtonPressed = runtimeButton.getText().equals(Messages.getString("ProcessComposite.kill"));
            if (lock && isRunButtonPressed) {
                // $NON-NLS-1$
                //$NON-NLS-1$ //$NON-NLS-2$
                MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.anotherJobMonitoring"));
                return;
            }
            if (isCommandlineRun) {
                //$NON-NLS-1$ //$NON-NLS-2$
                MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.commandlineForbidden"));
                return;
            }
            if (isRemoteRun && !isRemoteMonitoring) {
                //$NON-NLS-1$ //$NON-NLS-2$
                MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.remoteMonitoringUnavailable"));
                return;
            }
            if (processContext != null && !processContext.isRunning() && isRunButtonPressed) {
                // $NON-NLS-1$
                runtimeButton.setEnabled(false);
                isReadyToStart = true;
                exec();
            }
            if (processContext != null && (processContext.isRunning() || isReadyToStart)) {
                if (isRunButtonPressed) {
                    if (!acquireJVM()) {
                        isReadyToStart = false;
                        runtimeButton.setEnabled(true);
                        //$NON-NLS-1$
                        MessageDialog.openWarning(//$NON-NLS-1$
                        getShell(), //$NON-NLS-1$
                        "Warning", //$NON-NLS-1$
                        Messages.getString("ProcessView.connectToMonitorServerFailed"));
                        return;
                    }
                    initMonitoringModel();
                    refreshMonitorComposite();
                    processContext.setMonitoring(true);
                    AbstractRuntimeGraphcsComposite.setMonitoring(true);
                    setRuntimeButtonByStatus(false);
                    isReadyToStart = false;
                    if (periodCombo.isEnabled() && periodCombo.getSelectionIndex() != 0) {
                        startCustomerGCSchedule();
                    }
                    //$NON-NLS-1$
                    String content = getExecutionInfo("Start");
                    messageManager.setStartMessage(content, getDisplay().getSystemColor(SWT.COLOR_BLUE), getDisplay().getSystemColor(SWT.COLOR_WHITE));
                    ((RuntimeGraphcsComposite) chartComposite).displayReportField();
                    lock = true;
                } else if (isKillButtonPressed) {
                    // $NON-NLS-1$
                    processContext.kill();
                }
            } else {
                //$NON-NLS-1$ //$NON-NLS-2$
                MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.noJobRunning"));
            }
            runtimeButton.setEnabled(true);
        }
    });
    gcCheckButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            isGCSelected = gcCheckButton.getSelection();
            periodCombo.setEnabled(isGCSelected);
            if (!isGCSelected) {
                periodCombo.select(0);
                if (processContext != null && processContext.isRunning()) {
                    // cancel GC timer task during job running.
                    doScheduledGc(0);
                }
            }
        }
    });
    periodCombo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            startCustomerGCSchedule();
        }
    });
    propertyChangeListener = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            runProcessContextChanged(evt);
        }
    };
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 50 with SelectionAdapter

use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.

the class AdvanceSettingComposite method addListeners.

/**
     * DOC Administrator Comment method "addListeners".
     */
private void addListeners() {
    // TODO Auto-generated method stub
    watchBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            processContext.setWatchAllowed(watchBtn.getSelection());
            processManager.setExecTime(watchBtn.getSelection());
        }
    });
    saveJobBeforeRunButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            processContext.setSaveBeforeRun(saveJobBeforeRunButton.getSelection());
            processManager.setSaveJobBeforeRun(saveJobBeforeRunButton.getSelection());
        }
    });
    perfBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(final SelectionEvent e) {
            processContext.setMonitorPerf(perfBtn.getSelection());
            processManager.setStat(perfBtn.getSelection());
        }
    });
    clearBeforeExec.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            processContext.setClearBeforeExec(clearBeforeExec.getSelection());
            processManager.setClearBeforeExec(clearBeforeExec.getSelection());
        }
    });
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Aggregations

SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3041 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3036 GridData (org.eclipse.swt.layout.GridData)1608 Button (org.eclipse.swt.widgets.Button)1600 Composite (org.eclipse.swt.widgets.Composite)1220 Label (org.eclipse.swt.widgets.Label)1106 GridLayout (org.eclipse.swt.layout.GridLayout)1095 Text (org.eclipse.swt.widgets.Text)773 ModifyListener (org.eclipse.swt.events.ModifyListener)638 ModifyEvent (org.eclipse.swt.events.ModifyEvent)630 Group (org.eclipse.swt.widgets.Group)459 FormAttachment (org.eclipse.swt.layout.FormAttachment)428 FormData (org.eclipse.swt.layout.FormData)428 Shell (org.eclipse.swt.widgets.Shell)407 FormLayout (org.eclipse.swt.layout.FormLayout)406 Event (org.eclipse.swt.widgets.Event)384 Listener (org.eclipse.swt.widgets.Listener)378 Display (org.eclipse.swt.widgets.Display)353 ShellEvent (org.eclipse.swt.events.ShellEvent)323 ShellAdapter (org.eclipse.swt.events.ShellAdapter)321