Search in sources :

Example 1 with ResourceTreeAndListGroup

use of org.eclipse.ui.ide.dialogs.ResourceTreeAndListGroup in project tdi-studio-se by Talend.

the class TalendWizardArchiveFileResourceExportPage1 method myCreateResourcesGroup.

protected void myCreateResourcesGroup(Composite parent) {
    // create the input element, which has the root resource
    // as its only child
    List<String> notExportProjects = Arrays.asList(GeneralParametersProvider.getStrings(GeneralParameters.PROJECTS_EXCLUDED_FROM_EXPORT));
    List input = new ArrayList();
    IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
    for (int i = 0; i < projects.length; i++) {
        if (projects[i].isOpen() && !notExportProjects.contains(projects[i].getName())) {
            input.add(projects[i]);
        }
    }
    resourceGroup = new ResourceTreeAndListGroup(parent, input, getResourceProvider(IResource.FOLDER | IResource.PROJECT), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(), getResourceProvider(IResource.FILE), WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(), SWT.NONE, inRegularFontMode(parent));
    ICheckStateListener listener = new ICheckStateListener() {

        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            updateWidgetEnablements();
        }
    };
    resourceGroup.addCheckStateListener(listener);
}
Also used : ICheckStateListener(org.eclipse.jface.viewers.ICheckStateListener) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CheckStateChangedEvent(org.eclipse.jface.viewers.CheckStateChangedEvent) IProject(org.eclipse.core.resources.IProject) ResourceTreeAndListGroup(org.eclipse.ui.ide.dialogs.ResourceTreeAndListGroup)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 IProject (org.eclipse.core.resources.IProject)1 CheckStateChangedEvent (org.eclipse.jface.viewers.CheckStateChangedEvent)1 ICheckStateListener (org.eclipse.jface.viewers.ICheckStateListener)1 ResourceTreeAndListGroup (org.eclipse.ui.ide.dialogs.ResourceTreeAndListGroup)1