Search in sources :

Example 11 with StructuredSelection

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

the class DetecteViewImpactAction method doRun.

@Override
protected void doRun() {
    RepositoryNode node = getCurrentRepositoryNode();
    if (node == null) {
        return;
    }
    IStructuredSelection selection = new StructuredSelection(node);
    // try to check via extension point first.
    UpdateManagerProviderDetector.INSTANCE.updateForRepository(selection, true);
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 12 with StructuredSelection

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

the class ConnectionFormComposite method fillFields.

private void fillFields() {
    if (connection != null) {
        removeListeners();
        String repositoryId = connection.getRepositoryId();
        if (repositoryId == null || "".equals(repositoryId)) {
            if (getRepository() != null) {
                connection.setRepositoryId(getRepository().getId());
            } else {
                connection.setRepositoryId(RepositoryConstants.REPOSITORY_LOCAL_ID);
            }
        }
        IRepositoryFactory repositoriyById = RepositoryFactoryProvider.getRepositoriyById(repositoryId);
        repositoryCombo.setSelection(new StructuredSelection(new Object[] { repositoriyById }));
        if (getRepository() != null) {
            Map<String, LabelText> map = dynamicControls.get(getRepository());
            for (String fieldKey : map.keySet()) {
                LabelText current = map.get(fieldKey);
                String string = connection.getDynamicFields().get(fieldKey);
                //$NON-NLS-1$
                current.setText(string == null ? "" : string);
            }
            Map<String, LabelledCombo> map2 = dynamicChoices.get(getRepository());
            for (String fieldKey : map2.keySet()) {
                Combo combo = map2.get(fieldKey).getCombo();
                String value = connection.getDynamicFields().get(fieldKey);
                combo.deselectAll();
                for (DynamicChoiceBean dynamicChoiceBean : getRepository().getChoices()) {
                    if (dynamicChoiceBean.getId().equals(fieldKey)) {
                        combo.select(dynamicChoiceBean.getChoiceIndex(value));
                    }
                }
            }
        }
        //$NON-NLS-1$
        nameText.setText((connection.getName() == null ? "" : connection.getName()));
        //$NON-NLS-1$
        descriptionText.setText((connection.getDescription() == null ? "" : connection.getDescription()));
        //$NON-NLS-1$
        userText.setText((connection.getUser() == null ? "" : connection.getUser()));
        //$NON-NLS-1$
        passwordText.setText((connection.getPassword() == null ? "" : connection.getPassword()));
        workSpaceText.setText(//$NON-NLS-1$
        ("".equals(connection.getWorkSpace()) || connection.getWorkSpace() == null) ? getRecentWorkSpace() : connection.getWorkSpace());
        addListeners();
    }
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) IRepositoryFactory(org.talend.core.repository.model.IRepositoryFactory) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) LabelText(org.talend.commons.ui.swt.formtools.LabelText) Combo(org.eclipse.swt.widgets.Combo) LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) DynamicChoiceBean(org.talend.core.repository.model.DynamicChoiceBean)

Example 13 with StructuredSelection

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

the class TalendZipFileExportWizard method init.

public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
    this.selection = currentSelection;
    List selectedResources = IDE.computeSelectedResources(currentSelection);
    if (!selectedResources.isEmpty()) {
        this.selection = new StructuredSelection(selectedResources);
    }
    // setWindowTitle(DataTransferMessages.DataTransfer_export);
    //$NON-NLS-1$
    setWindowTitle(Messages.getString("DataTransferMessages.DataTransfer_export"));
    //        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 : IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) List(java.util.List)

Example 14 with StructuredSelection

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

the class TalendZipFileExportWizard2 method init.

public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
    this.selection = currentSelection;
    List selectedResources = IDE.computeSelectedResources(currentSelection);
    if (!selectedResources.isEmpty()) {
        this.selection = new StructuredSelection(selectedResources);
    }
    // setWindowTitle(DataTransferMessages.DataTransfer_export);
    //$NON-NLS-1$
    setWindowTitle(Messages.getString("DataTransferMessages.DataTransfer_export"));
    //        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 : IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) List(java.util.List)

Example 15 with StructuredSelection

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

the class JobScriptsExportWizard method init.

/*
     * (non-Javadoc) Method declared on IWorkbenchWizard.
     */
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
    selection = currentSelection;
    List selectedResources = IDE.computeSelectedResources(currentSelection);
    if (!selectedResources.isEmpty()) {
        selection = new StructuredSelection(selectedResources);
    }
    populateUIMessage();
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) List(java.util.List)

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