Search in sources :

Example 16 with StructuredSelection

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

the class PublishOnSpagoExportWizard method init.

/*
     * (non-Javadoc) Method declared on IWorkbenchWizard.
     */
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
    this.selection = currentSelection;
    List selectedResources = IDE.computeSelectedResources(currentSelection);
    if (!selectedResources.isEmpty()) {
        this.selection = new StructuredSelection(selectedResources);
    }
    //$NON-NLS-1$
    setWindowTitle(Messages.getString("PublishOnSpagoExportWizard.publishJob"));
    //        setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportzip_wiz.png"));//$NON-NLS-1$
    setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(IDEWorkbenchPlugin.IDE_WORKBENCH, //$NON-NLS-1$
    "$nl$/icons/full/wizban/exportzip_wiz.png"));
    setNeedsProgressMonitor(true);
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) List(java.util.List)

Example 17 with StructuredSelection

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

the class SpagicDeployWizard method init.

/*
     * (non-Javadoc) Method declared on IWorkbenchWizard.
     */
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
    this.selection = currentSelection;
    List selectedResources = IDE.computeSelectedResources(currentSelection);
    if (!selectedResources.isEmpty()) {
        this.selection = new StructuredSelection(selectedResources);
    }
    //$NON-NLS-1$
    setWindowTitle(Messages.getString("SapgicDeployWizard.exporttospagic"));
    //        setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportzip_wiz.png"));//$NON-NLS-1$
    setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(IDEWorkbenchPlugin.IDE_WORKBENCH, //$NON-NLS-1$
    "$nl$/icons/full/wizban/exportzip_wiz.png"));
    setNeedsProgressMonitor(true);
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) List(java.util.List)

Example 18 with StructuredSelection

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

the class MemoryRuntimeComposite method initMonitoringModel.

private void initMonitoringModel() {
    final List<IActiveJvm> contructSelections = new ArrayList<IActiveJvm>();
    contructSelections.add(currentJvm);
    if (currentJvm != null) {
        viewPart.getSite().setSelectionProvider(new ProcessViewSelectionProvider(new StructuredSelection(contructSelections)));
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) ProcessViewSelectionProvider(org.talend.designer.runprocess.ui.views.ProcessViewSelectionProvider) ArrayList(java.util.ArrayList) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection)

Example 19 with StructuredSelection

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

the class MemoryRuntimeComposite method initContextInput.

@SuppressWarnings("unchecked")
private void initContextInput() {
    List<IContext> contextList = (List<IContext>) viewPart.getContextComposite().getContextComboInput();
    if (contextList != null) {
        contextCombo.setSelection(new StructuredSelection(contextList.get(0)));
        contextCombo.setInput(contextList);
        ComboViewer processContextComboViewer = viewPart.getContextComposite().getContextComboViewer();
        IContext selectedContext = (IContext) ((IStructuredSelection) processContextComboViewer.getSelection()).getFirstElement();
        for (int i = 0; i < contextList.size(); i++) {
            if (contextList.get(i).getName().equals(selectedContext.getName())) {
                contextCombo.getCombo().select(i);
            }
        }
        contextCombo.addSelectionChangedListener(new ISelectionChangedListener() {

            @Override
            public void selectionChanged(SelectionChangedEvent event) {
                viewPart.getContextComposite().runSelectionChange(event);
            }
        });
    } else {
        contextCombo.getCombo().setEnabled(false);
    }
}
Also used : IContext(org.talend.core.model.process.IContext) ComboViewer(org.eclipse.jface.viewers.ComboViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) List(java.util.List) ArrayList(java.util.ArrayList) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) Point(org.eclipse.swt.graphics.Point)

Example 20 with StructuredSelection

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

the class MBeanSashForm method createSashFormControls.

/*
     * @see AbstractSashForm#createSashFormControls(SashForm, IActionBars)
     */
@Override
protected void createSashFormControls(SashForm sashForm, final IActionBars actionBars) {
    mBeanViewer = new MBeanFilteredTree(sashForm, section).getViewer();
    mBeanContentProvider = new MBeanContentProvider();
    mBeanViewer.setContentProvider(mBeanContentProvider);
    mBeanViewer.setLabelProvider(new MyDecoratingStyledCellLabelProvider());
    selectionChangedListener = new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            ISelection selection = event.getSelection();
            if (selection instanceof StructuredSelection) {
                mBeanTabFolder.selectionChanged((StructuredSelection) selection);
            }
        }
    };
    mBeanViewer.addSelectionChangedListener(selectionChangedListener);
    mBeanViewer.setInput(new Object());
    mBeanTabFolder = new MBeanTabFolder(sashForm, section);
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) ISelection(org.eclipse.jface.viewers.ISelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent)

Aggregations

StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1376 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)782 ArrayList (java.util.ArrayList)212 ISelection (org.eclipse.jface.viewers.ISelection)177 Composite (org.eclipse.swt.widgets.Composite)167 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)133 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)128 GridData (org.eclipse.swt.layout.GridData)112 List (java.util.List)93 IFile (org.eclipse.core.resources.IFile)92 GridLayout (org.eclipse.swt.layout.GridLayout)87 SelectionEvent (org.eclipse.swt.events.SelectionEvent)82 Label (org.eclipse.swt.widgets.Label)79 TreeViewer (org.eclipse.jface.viewers.TreeViewer)78 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)68 EObject (org.eclipse.emf.ecore.EObject)67 AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)66 TableViewer (org.eclipse.jface.viewers.TableViewer)64 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)61 AdapterFactoryContentProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)60