Search in sources :

Example 51 with IStructuredSelection

use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.

the class JobSettingsView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    // tabFactory = new HorizontalTabFactory();
    this.parent = parent;
    tabFactory.initComposite(parent, false);
    tabFactory.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            TalendPropertyTabDescriptor descriptor = (TalendPropertyTabDescriptor) selection.getFirstElement();
            if (descriptor == null) {
                return;
            }
            if (currentSelectedTab != null) {
                if ((!currentSelectedTab.getData().equals(descriptor.getData()) || currentSelectedTab.getData() != descriptor.getData() || currentSelectedTab.getCategory() != descriptor.getCategory())) {
                    for (Control curControl : tabFactory.getTabComposite().getChildren()) {
                        curControl.dispose();
                    }
                }
            }
            if (element == null || !element.equals(descriptor.getData()) || currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
                Object data = descriptor.getData();
                if (data instanceof Element) {
                    element = (Element) data;
                    currentSelectedTab = descriptor;
                    IDynamicProperty propertyComposite = createTabComposite(tabFactory.getTabComposite(), element, descriptor.getCategory());
                } else if (data instanceof IRepositoryViewObject) {
                    IRepositoryViewObject viewObject = (IRepositoryViewObject) data;
                    IProcess process = getProcess(viewObject);
                    if (process != null && process instanceof Element && process.getId().equals(viewObject.getId()) && process.getVersion().equals(viewObject.getVersion())) {
                        data = process;
                    }
                    currentSelectedTab = descriptor;
                    IDynamicProperty propertyComposite = createTabComposite(tabFactory.getTabComposite(), data, descriptor.getCategory());
                } else if (data instanceof IEditorPart) {
                    currentSelectedTab = descriptor;
                    IRepositoryViewObject repObj = retrieveBusiness((IEditorPart) data);
                    if (repObj != null) {
                        IDynamicProperty propertyComposite = createTabComposite(tabFactory.getTabComposite(), repObj, descriptor.getCategory());
                    }
                } else {
                    currentSelectedTab = descriptor;
                    IDynamicProperty propertyComposite = createTabComposite(tabFactory.getTabComposite(), null, descriptor.getCategory());
                }
                selectedPrimary = false;
            }
        }
    });
}
Also used : Control(org.eclipse.swt.widgets.Control) IDynamicProperty(org.talend.core.ui.properties.tab.IDynamicProperty) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) Element(org.talend.core.model.process.Element) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) EmptyRepositoryObject(org.talend.core.model.repository.EmptyRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor) IEditorPart(org.eclipse.ui.IEditorPart) IProcess(org.talend.core.model.process.IProcess)

Example 52 with IStructuredSelection

use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.

the class JobSettingsView method setElement.

/**
     *
     * DOC ggu Comment method "setElement".
     *
     * @param obj
     */
private void setElement(Object obj, final String title, Image image) {
    EComponentCategory[] categories = null;
    if (obj != null && obj instanceof Process) {
        process = (Process) obj;
        if (currentSelectedTab != null && currentSelectedTab.getData().equals(process) && !cleaned) {
            return;
        }
        categories = getCategories(process);
    } else if (obj != null && obj instanceof IRepositoryViewObject) {
        categories = getCategories(obj);
        IRepositoryViewObject viewObject = (IRepositoryViewObject) obj;
        IProcess process = getProcess(viewObject);
        if (process != null && process instanceof Element && process.getId().equals(viewObject.getId()) && process.getVersion().equals(viewObject.getVersion())) {
            categories = getCategories(process);
        }
    } else if (obj instanceof IEditorPart) {
        if (CorePlugin.getDefault().getDiagramModelService().isBusinessDiagramEditor((IEditorPart) obj)) {
            categories = getCategories(obj);
        }
    } else {
        BusinessType type = CorePlugin.getDefault().getDiagramModelService().getBusinessModelType(obj);
        if (BusinessType.NOTE.equals(type) || BusinessType.SHAP.equals(type) || BusinessType.CONNECTION.equals(type)) {
            categories = getCategories(obj);
        } else {
            cleanDisplay();
            return;
        }
    }
    final List<TalendPropertyTabDescriptor> descriptors = new ArrayList<TalendPropertyTabDescriptor>();
    for (EComponentCategory category : categories) {
        TalendPropertyTabDescriptor d = new TalendPropertyTabDescriptor(category);
        d.setData(obj);
        descriptors.add(d);
    }
    tabFactory.setInput(descriptors);
    setPartName(title, image);
    cleaned = false;
    tabFactory.setSelection(new IStructuredSelection() {

        @Override
        public Object getFirstElement() {
            return null;
        }

        @Override
        public Iterator iterator() {
            return null;
        }

        @Override
        public int size() {
            return 0;
        }

        @Override
        public Object[] toArray() {
            return null;
        }

        @Override
        public List toList() {
            List<TalendPropertyTabDescriptor> d = new ArrayList<TalendPropertyTabDescriptor>();
            if (descriptors.size() > 0) {
                if (currentSelectedTab != null) {
                    for (TalendPropertyTabDescriptor ds : descriptors) {
                        if (ds.getCategory() == currentSelectedTab.getCategory()) {
                            d.add(ds);
                            return d;
                        }
                    }
                }
                d.add(descriptors.get(0));
            }
            return d;
        }

        @Override
        public boolean isEmpty() {
            return false;
        }
    });
}
Also used : Element(org.talend.core.model.process.Element) BusinessType(org.talend.core.model.business.BusinessType) ArrayList(java.util.ArrayList) IProcess(org.talend.core.model.process.IProcess) Process(org.talend.designer.core.ui.editor.process.Process) IEditorPart(org.eclipse.ui.IEditorPart) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) Iterator(java.util.Iterator) EmptyRepositoryObject(org.talend.core.model.repository.EmptyRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) List(java.util.List) ArrayList(java.util.ArrayList) IProcess(org.talend.core.model.process.IProcess) EComponentCategory(org.talend.core.model.process.EComponentCategory)

Example 53 with IStructuredSelection

use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.

the class DeploymentComposite method addListeners.

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

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (groupIdCheckbox.getSelection()) {
                groupIdText.setEnabled(true);
                groupIdText.setText(groupId);
            } else {
                groupIdText.setEnabled(false);
                groupIdText.setText(defaultGroupId);
                // remove key, so will be default groupId
                Command cmd = new MavenDeploymentValueChangeCommand(process, MavenConstants.NAME_GROUP_ID, null);
                getCommandStack().execute(cmd);
            }
        }
    });
    groupIdText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            String currentGroupId = groupIdText.getText();
            if (currentGroupId != null && !currentGroupId.trim().equals("")) {
                //$NON-NLS-1$
                groupIdText.setBackground(getBackground());
                //$NON-NLS-1$
                groupIdText.setToolTipText("");
                if (!defaultGroupId.equals(currentGroupId)) {
                    groupId = currentGroupId;
                } else {
                    currentGroupId = null;
                }
                Command cmd = new MavenDeploymentValueChangeCommand(process, MavenConstants.NAME_GROUP_ID, currentGroupId);
                getCommandStack().execute(cmd);
            } else {
                groupIdText.setBackground(COLOR_RED);
                //$NON-NLS-1$
                groupIdText.setToolTipText(Messages.getString("DeploymentComposite.valueWarning"));
            }
        }
    });
    versionCheckbox.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (versionCheckbox.getSelection()) {
                versionText.setEnabled(true);
                versionText.setText(version);
            } else {
                versionText.setEnabled(false);
                versionText.setText(defaultVersion);
                // remove key, so will be default version
                Command cmd = new MavenDeploymentValueChangeCommand(process, MavenConstants.NAME_USER_VERSION, null);
                getCommandStack().execute(cmd);
            }
        }
    });
    versionText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            String currentVersion = versionText.getText();
            if (//$NON-NLS-1$
            currentVersion != null && !currentVersion.trim().equals("") && !MavenVersionUtils.isValidMavenVersion(currentVersion)) {
                //$NON-NLS-1$
                versionText.setToolTipText(Messages.getString("DeploymentComposite.valueWarning"));
                versionText.setBackground(COLOR_RED);
            } else {
                //$NON-NLS-1$
                versionText.setToolTipText("");
                versionText.setBackground(getBackground());
                if (!defaultVersion.equals(currentVersion)) {
                    version = currentVersion;
                } else {
                    currentVersion = null;
                }
                // if empty, remove it from job, else will set the new value
                Command cmd = new MavenDeploymentValueChangeCommand(process, MavenConstants.NAME_USER_VERSION, currentVersion);
                getCommandStack().execute(cmd);
            }
        }
    });
    buildTypeCombo.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            final ISelection selection = event.getSelection();
            if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
                final Object elem = ((IStructuredSelection) selection).getFirstElement();
                if (elem instanceof BuildType) {
                    Command cmd = new MavenDeploymentValueChangeCommand(process, TalendProcessArgumentConstant.ARG_BUILD_TYPE, ((BuildType) elem).getName());
                    getCommandStack().execute(cmd);
                }
            }
        }
    });
}
Also used : ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ModifyEvent(org.eclipse.swt.events.ModifyEvent) MavenDeploymentValueChangeCommand(org.talend.designer.core.ui.editor.cmd.MavenDeploymentValueChangeCommand) Command(org.eclipse.gef.commands.Command) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ISelection(org.eclipse.jface.viewers.ISelection) MavenDeploymentValueChangeCommand(org.talend.designer.core.ui.editor.cmd.MavenDeploymentValueChangeCommand) BuildType(org.talend.core.runtime.repository.build.BuildType) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject)

Example 54 with IStructuredSelection

use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.

the class VarsDataMapTableView method createToolItems.

@Override
protected void createToolItems() {
    // /////////////////////////////////////////////////////////////////
    ToolItem addEntryItem = new ToolItem(toolBarActions, SWT.PUSH);
    addEntryItem.setEnabled(!getMapperManager().componentIsReadOnly());
    //$NON-NLS-1$
    addEntryItem.setToolTipText(Messages.getString("VarsDataMapTableView.entryItemTooltip.addVariable"));
    addEntryItem.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.ADD_ICON)));
    addEntryItem.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            TableViewerCreator<IColumnEntry> tableViewerCreator = getExtendedTableViewerForColumns().getTableViewerCreator();
            tableViewerCreator.applyActivatedCellEditor();
            Table table = getExtendedTableViewerForColumns().getTable();
            int[] indices = table.getSelectionIndices();
            int indexInsert = table.getItemCount();
            if (indices.length > 0) {
                indexInsert = indices[indices.length - 1] + 1;
            }
            IDataMapTable dataMapTable = VarsDataMapTableView.this.getDataMapTable();
            String varName = null;
            if (dataMapTable instanceof VarsTable) {
                //$NON-NLS-1$
                varName = ((VarsTable) dataMapTable).findUniqueColumnName("var");
            } else {
                throw new UnsupportedOperationException(Messages.getString(//$NON-NLS-1$
                "VarsDataMapTableView.exceptionMessage.caseNotFound"));
            }
            ILanguage currentLanguage = LanguageProvider.getCurrentLanguage();
            String type = null;
            if (currentLanguage.getCodeLanguage() == ECodeLanguage.JAVA) {
                type = JavaTypesManager.STRING.getId();
            } else {
                // fix bug 0018996 ,when add a var row,there is no default type,this bug exsit for long time
                type = PerlTypesManager.STRING;
            }
            mapperManager.addNewVarEntry(VarsDataMapTableView.this, varName, indexInsert, type);
            tableViewerCreatorForColumns.getTableViewer().refresh();
            if (canBeResizedAtPreferedSize()) {
                VarsDataMapTableView.this.changeSize(VarsDataMapTableView.this.getPreferredSize(true, true, false), true, true);
                changeMinimizeState(false);
            }
            mapperManager.getUiManager().refreshBackground(true, false);
            table.setSelection(indexInsert);
            removeEntryItem.setEnabled(true);
            moveUpEntryItem.setEnabled(true);
            moveDownEntryItem.setEnabled(true);
        }
    });
    // /////////////////////////////////////////////////////////////////
    // /////////////////////////////////////////////////////////////////
    removeEntryItem = new ToolItem(toolBarActions, SWT.PUSH);
    removeEntryItem.setEnabled(false);
    removeEntryItem.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.MINUS_ICON)));
    //$NON-NLS-1$
    removeEntryItem.setToolTipText(Messages.getString("VarsDataMapTableView.entryItemTooltip.removeVariable"));
    removeEntryItem.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            IStructuredSelection selection = (IStructuredSelection) tableViewerCreatorForColumns.getTableViewer().getSelection();
            List<ITableEntry> selectedBeans = selection.toList();
            for (ITableEntry entry : selectedBeans) {
                mapperManager.removeTableEntry(entry);
            }
            if (selectedBeans.size() > 0) {
                tableViewerCreatorForColumns.getTableViewer().refresh();
                mapperManager.getUiManager().refreshBackground(true, false);
                if (canBeResizedAtPreferedSize()) {
                    resizeAtExpandedSize();
                }
            }
            removeEntryItem.setEnabled(false);
        }
    });
    // /////////////////////////////////////////////////////////////////
    // /////////////////////////////////////////////////////////////////
    moveUpEntryItem = new ToolItem(toolBarActions, SWT.PUSH);
    moveUpEntryItem.setEnabled(false);
    moveUpEntryItem.setImage(ImageProvider.getImage(EImage.UP_ICON));
    //$NON-NLS-1$
    moveUpEntryItem.setToolTipText(Messages.getString("VarsDataMapTableView.entryItemTooltip.moveUpVariable"));
    moveUpEntryItem.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            AbstractExtendedTableViewer viewer = getExtendedTableViewerForColumns();
            ExtendedTableMoveCommand moveCommand = new ExtendedTableMoveCommand(viewer.getExtendedTableModel(), true, viewer.getTableViewerCreator().getTable().getSelectionIndices());
            viewer.getTableViewerCreator().applyActivatedCellEditor();
            viewer.executeCommand(moveCommand);
        }
    });
    // /////////////////////////////////////////////////////////////////
    // /////////////////////////////////////////////////////////////////
    moveDownEntryItem = new ToolItem(toolBarActions, SWT.PUSH);
    moveDownEntryItem.setEnabled(false);
    moveDownEntryItem.setImage(ImageProvider.getImage(EImage.DOWN_ICON));
    //$NON-NLS-1$
    moveDownEntryItem.setToolTipText(Messages.getString("VarsDataMapTableView.entryItemTooltip.movedownVariable"));
    moveDownEntryItem.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            AbstractExtendedTableViewer viewer = getExtendedTableViewerForColumns();
            ExtendedTableMoveCommand moveCommand = new ExtendedTableMoveCommand(viewer.getExtendedTableModel(), false, viewer.getTableViewerCreator().getTable().getSelectionIndices());
            viewer.getTableViewerCreator().applyActivatedCellEditor();
            viewer.executeCommand(moveCommand);
        }
    });
// /////////////////////////////////////////////////////////////////
}
Also used : ExtendedTableMoveCommand(org.talend.commons.ui.swt.advanced.dataeditor.commands.ExtendedTableMoveCommand) VarsTable(org.talend.designer.mapper.model.table.VarsTable) TableViewerCreator(org.talend.commons.ui.swt.tableviewer.TableViewerCreator) IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) Table(org.eclipse.swt.widgets.Table) VarsTable(org.talend.designer.mapper.model.table.VarsTable) ITableEntry(org.talend.designer.abstractmap.model.tableentry.ITableEntry) IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ILanguage(org.talend.designer.mapper.language.ILanguage) SelectionEvent(org.eclipse.swt.events.SelectionEvent) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) AbstractExtendedTableViewer(org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer) List(java.util.List) ToolItem(org.eclipse.swt.widgets.ToolItem) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 55 with IStructuredSelection

use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.

the class ProcessView method createPartControl.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
     */
@Override
public void createPartControl(Composite parent) {
    this.parent = parent;
    parent.setLayout(new FillLayout());
    sash = new SashForm(parent, SWT.HORIZONTAL | SWT.SMOOTH);
    sash.setLayoutData(new GridData(GridData.FILL_BOTH));
    sash.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    GridLayout layout = new GridLayout();
    sash.setLayout(layout);
    Composite left = new Composite(sash, SWT.NONE);
    left.setLayout(new FillLayout());
    Composite right = new Composite(sash, SWT.NONE);
    right.setLayout(new FormLayout());
    FormData layouDatag = new FormData();
    layouDatag.left = new FormAttachment(0, 0);
    layouDatag.width = 32;
    layouDatag.top = new FormAttachment(0, 0);
    layouDatag.bottom = new FormAttachment(100, 0);
    final Composite buttonComposite = new Composite(right, SWT.ERROR);
    buttonComposite.setLayoutData(layouDatag);
    buttonComposite.setLayout(new GridLayout());
    Composite cotextCom = new Composite(right, SWT.NONE);
    layouDatag = new FormData();
    layouDatag.left = new FormAttachment(0, 32);
    layouDatag.right = new FormAttachment(100, 0);
    layouDatag.top = new FormAttachment(0, 0);
    layouDatag.bottom = new FormAttachment(100, 0);
    cotextCom.setLayoutData(layouDatag);
    cotextCom.setLayout(new GridLayout());
    tabFactory.initComposite(left, false);
    moveButton = new Button(buttonComposite, SWT.PUSH);
    //$NON-NLS-1$
    moveButton.setText(">>");
    moveButton.setToolTipText(Messages.getString("ProcessComposite.hideContext"));
    final GridData layoutData = new GridData();
    layoutData.verticalAlignment = GridData.CENTER;
    layoutData.horizontalAlignment = GridData.CENTER;
    layoutData.grabExcessHorizontalSpace = true;
    layoutData.grabExcessVerticalSpace = true;
    moveButton.setLayoutData(layoutData);
    addListeners();
    sash.setSashWidth(5);
    sash.setWeights(new int[] { 18, 5 });
    contextComposite = new ProcessContextComposite(cotextCom, SWT.NONE);
    contextComposite.setBackground(right.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    // processComposite = new ProcessComposite(tabFactory.getTabComposite(), SWT.H_SCROLL | SWT.V_SCROLL |
    // SWT.NO_FOCUS);
    // dc = processComposite;
    // createBasicComposite(tabFactory.getTabComposite(), element, null);
    tabFactory.getTabComposite().layout();
    tabFactory.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            TalendPropertyTabDescriptor descriptor = (TalendPropertyTabDescriptor) selection.getFirstElement();
            if (descriptor == null) {
                return;
            }
            if (currentSelectedTab != null && (currentSelectedTab.getCategory() != descriptor.getCategory())) {
                for (Control curControl : tabFactory.getTabComposite().getChildren()) {
                    curControl.dispose();
                }
            }
            if (currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
                currentSelectedTab = descriptor;
                selectedPrimary = false;
                createDynamicComposite(tabFactory.getTabComposite(), (Element) descriptor.getData(), descriptor.getCategory());
            }
        }
    });
    setElement();
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    IHandler handler1;
    IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    if (brandingService.getBrandingConfiguration().isAllowDebugMode()) {
        Action debugAction = new DebugAction();
        handler1 = new ActionHandler(debugAction);
        handlerService.activateHandler(debugAction.getActionDefinitionId(), handler1);
    }
    Action killAction = new KillAction();
    handler1 = new ActionHandler(killAction);
    handlerService.activateHandler(killAction.getActionDefinitionId(), handler1);
    FocusListener fl = new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            //$NON-NLS-1$
            log.trace(Messages.getString("ProcessView.gainFocusLog"));
            IContextService contextService = (IContextService) RunProcessPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
            //$NON-NLS-1$
            ca = contextService.activateContext("talend.runProcess");
        }

        @Override
        public void focusLost(FocusEvent e) {
            //$NON-NLS-1$
            log.trace(Messages.getString("ProcessView.lostFocusLog"));
            if (ca != null) {
                IContextService contextService = (IContextService) RunProcessPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
                contextService.deactivateContext(ca);
            }
        }
    };
    addListenerOnChildren(parent, fl);
    rubjobManager.setProcessShell(getSite().getShell());
    contextManagerListener = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (RunProcessContextManager.PROP_ACTIVE.equals(evt.getPropertyName())) {
                // rubjobManager.setBooleanTrace(false);
                runningProcessChanged();
            }
        }
    };
    RunProcessPlugin.getDefault().getRunProcessContextManager().addPropertyChangeListener(contextManagerListener);
    runAction = new RunAction();
}
Also used : Action(org.eclipse.jface.action.Action) ClearPerformanceAction(org.talend.designer.runprocess.ui.actions.ClearPerformanceAction) PropertyChangeListener(java.beans.PropertyChangeListener) Element(org.talend.core.model.process.Element) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) FocusEvent(org.eclipse.swt.events.FocusEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ProcessContextComposite(org.talend.designer.runprocess.ui.ProcessContextComposite) Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) IContextService(org.eclipse.ui.contexts.IContextService) FormAttachment(org.eclipse.swt.layout.FormAttachment) FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) PropertyChangeEvent(java.beans.PropertyChangeEvent) TraceDebugProcessComposite(org.talend.designer.runprocess.ui.TraceDebugProcessComposite) Composite(org.eclipse.swt.widgets.Composite) TargetExecComposite(org.talend.designer.runprocess.ui.TargetExecComposite) MemoryRuntimeComposite(org.talend.designer.runprocess.ui.MemoryRuntimeComposite) AdvanceSettingComposite(org.talend.designer.runprocess.ui.AdvanceSettingComposite) MultipleThreadDynamicComposite(org.talend.designer.core.ui.views.properties.MultipleThreadDynamicComposite) ProcessComposite(org.talend.designer.runprocess.ui.ProcessComposite) ProcessContextComposite(org.talend.designer.runprocess.ui.ProcessContextComposite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) FillLayout(org.eclipse.swt.layout.FillLayout) TalendPropertyTabDescriptor(org.talend.core.ui.properties.tab.TalendPropertyTabDescriptor) IBrandingService(org.talend.core.ui.branding.IBrandingService) SashForm(org.eclipse.swt.custom.SashForm) IHandlerService(org.eclipse.ui.handlers.IHandlerService) GridData(org.eclipse.swt.layout.GridData) IHandler(org.eclipse.core.commands.IHandler) ActionHandler(org.eclipse.ui.commands.ActionHandler) FocusListener(org.eclipse.swt.events.FocusListener)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)600 ISelection (org.eclipse.jface.viewers.ISelection)177 GridData (org.eclipse.swt.layout.GridData)97 ArrayList (java.util.ArrayList)88 Composite (org.eclipse.swt.widgets.Composite)80 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)78 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)77 SelectionEvent (org.eclipse.swt.events.SelectionEvent)74 GridLayout (org.eclipse.swt.layout.GridLayout)73 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)67 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)60 List (java.util.List)56 TableViewer (org.eclipse.jface.viewers.TableViewer)51 Button (org.eclipse.swt.widgets.Button)51 Iterator (java.util.Iterator)46 IResource (org.eclipse.core.resources.IResource)42 RepositoryNode (org.talend.repository.model.RepositoryNode)41 IFile (org.eclipse.core.resources.IFile)40 TreeViewer (org.eclipse.jface.viewers.TreeViewer)39 Label (org.eclipse.swt.widgets.Label)38