Search in sources :

Example 1 with PatternFilter

use of org.eclipse.ui.dialogs.PatternFilter in project linuxtools by eclipse.

the class BrowserView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    PatternFilter filter = new PatternFilter();
    FilteredTree filteredTree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, filter, true);
    viewer = filteredTree.getViewer();
    viewer.setContentProvider(new ViewContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
    IHandlerService handlerService = getSite().getService(IHandlerService.class);
    collapseHandler = new CollapseAllHandler(getViewer());
    handlerService.activateHandler(CollapseAllHandler.COMMAND_ID, collapseHandler);
    refreshHandler = new RefreshHandler();
    handlerService.activateHandler(RefreshHandler.COMMAND_ID, refreshHandler);
}
Also used : PatternFilter(org.eclipse.ui.dialogs.PatternFilter) IHandlerService(org.eclipse.ui.handlers.IHandlerService) FilteredTree(org.eclipse.ui.dialogs.FilteredTree) CollapseAllHandler(org.eclipse.ui.handlers.CollapseAllHandler)

Example 2 with PatternFilter

use of org.eclipse.ui.dialogs.PatternFilter in project arduino-eclipse-plugin by Sloeber.

the class LibrarySelectionPage method createTree.

public void createTree(Composite parent) {
    // filtering applied to all columns
    PatternFilter filter = new PatternFilter() {

        @Override
        protected boolean isLeafMatch(final Viewer viewer1, final Object element) {
            int numberOfColumns = ((TreeViewer) viewer1).getTree().getColumnCount();
            boolean isMatch = false;
            for (int columnIndex = 0; columnIndex < numberOfColumns; columnIndex++) {
                String labelText = LibraryLabelProvider.getColumnText(element, columnIndex);
                isMatch |= wordMatches(labelText);
            }
            return isMatch;
        }
    };
    this.tree = new FilteredTree(parent, SWT.CHECK | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION, filter, true) {

        @SuppressWarnings("synthetic-access")
        @Override
        protected TreeViewer doCreateTreeViewer(Composite composite, int style) {
            CheckboxTreeViewer viewer1 = new CheckboxTreeViewer(composite);
            viewer1.setCheckStateProvider(new LibraryCheckProvider());
            viewer1.setLabelProvider(new LibraryLabelProvider());
            viewer1.setContentProvider(new LibraryContentProvider());
            return viewer1;
        }
    };
    this.viewer = this.tree.getViewer();
    this.viewer.setInput(this.libs);
    TreeColumn name = new TreeColumn(this.viewer.getTree(), SWT.LEFT);
    name.setWidth(400);
    TreeColumn version = new TreeColumn(this.viewer.getTree(), SWT.LEFT);
    version.setWidth(100);
    // create the editor and set its attributes
    this.editor = new TreeEditor(this.viewer.getTree());
    this.editor.horizontalAlignment = SWT.LEFT;
    this.editor.grabHorizontal = true;
    this.editor.setColumn(1);
    // this ensures the tree labels are displayed correctly
    this.viewer.refresh(true);
    // enable tooltips
    ColumnViewerToolTipSupport.enableFor(this.viewer);
    // tree interactions listener
    this.viewer.getTree().addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            if (LibrarySelectionPage.this.editor.getEditor() != null) {
                LibrarySelectionPage.this.editor.getEditor().dispose();
            }
            final TreeItem item = event.item instanceof TreeItem ? (TreeItem) event.item : null;
            if (item != null && event.detail == SWT.CHECK) {
                if (item.getData() instanceof LibraryTree.Category) {
                    item.setGrayed(false);
                    for (LibraryTree.Library child : ((LibraryTree.Category) item.getData()).getLibraries()) {
                        if (item.getChecked()) {
                            child.setVersion(child.getLatest());
                        } else {
                            child.setVersion(null);
                        }
                    }
                    for (TreeItem child : item.getItems()) {
                        child.setChecked(item.getChecked());
                        if (item.getChecked()) {
                            child.setText(1, ((LibraryTree.Library) child.getData()).getLatest());
                        } else {
                            child.setText(1, emptyString);
                        }
                    }
                } else {
                    if (item.getChecked()) {
                        ((LibraryTree.Library) item.getData()).setVersion(((LibraryTree.Library) item.getData()).getLatest());
                        item.setText(1, ((LibraryTree.Library) item.getData()).getLatest());
                    } else {
                        ((LibraryTree.Library) item.getData()).setVersion(null);
                        item.setText(1, emptyString);
                    }
                    verifySubtreeCheckStatus(item.getParentItem());
                }
            }
            if (item != null && item.getItemCount() == 0 && item.getChecked()) {
                // Create the dropdown and add data to it
                final CCombo combo = new CCombo(LibrarySelectionPage.this.viewer.getTree(), SWT.READ_ONLY);
                for (VersionNumber version1 : ((LibraryTree.Library) item.getData()).getVersions()) {
                    combo.add(version1.toString());
                }
                // Select the previously selected item from the cell
                combo.select(combo.indexOf(item.getText(1)));
                // Compute the width for the editor
                // Also, compute the column width, so that the dropdown fits
                // Set the focus on the dropdown and set into the editor
                combo.setFocus();
                LibrarySelectionPage.this.editor.setEditor(combo, item, 1);
                // Add a listener to set the selected item back into the
                // cell
                combo.addSelectionListener(new SelectionAdapter() {

                    @Override
                    public void widgetSelected(SelectionEvent event1) {
                        ((LibraryTree.Library) item.getData()).setVersion(combo.getText());
                        item.setText(1, combo.getText());
                        // Item selected: end the editing session
                        combo.dispose();
                    }
                });
            }
        }
    });
}
Also used : PatternFilter(org.eclipse.ui.dialogs.PatternFilter) TreeItem(org.eclipse.swt.widgets.TreeItem) CheckboxTreeViewer(org.eclipse.jface.viewers.CheckboxTreeViewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) Viewer(org.eclipse.jface.viewers.Viewer) CheckboxTreeViewer(org.eclipse.jface.viewers.CheckboxTreeViewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) FilteredTree(org.eclipse.ui.dialogs.FilteredTree) LibraryTree(io.sloeber.core.api.LibraryManager.LibraryTree) TreeColumn(org.eclipse.swt.widgets.TreeColumn) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Composite(org.eclipse.swt.widgets.Composite) TreeEditor(org.eclipse.swt.custom.TreeEditor) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Point(org.eclipse.swt.graphics.Point) VersionNumber(io.sloeber.core.api.VersionNumber) CheckboxTreeViewer(org.eclipse.jface.viewers.CheckboxTreeViewer) CCombo(org.eclipse.swt.custom.CCombo)

Example 3 with PatternFilter

use of org.eclipse.ui.dialogs.PatternFilter in project mylyn.docs by eclipse.

the class QuickOutlinePopupDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    patternFilter = new PatternFilter();
    filteredTree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, patternFilter, true);
    int heightHint = (filteredTree.getViewer().getTree().getItemHeight() * 12) + Math.max(filteredTree.getFilterControl().getSize().y, 12);
    GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, heightHint).applyTo(filteredTree);
    filteredTree.getViewer().setUseHashlookup(true);
    filteredTree.getViewer().setContentProvider(new BaseWorkbenchContentProvider());
    filteredTree.getViewer().setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    filteredTree.getViewer().setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
    filteredTree.getViewer().getTree().addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
            handleSelection();
        }

        public void widgetSelected(SelectionEvent e) {
        // nothing to do
        }
    });
    // dispose when escape is pressed
    filteredTree.getViewer().getTree().addKeyListener(new KeyListener() {

        public void keyPressed(KeyEvent e) {
            if (e.character == 0x1B) {
                dispose();
            }
        }

        public void keyReleased(KeyEvent e) {
        }
    });
    // single mouse click causes selection
    filteredTree.getViewer().getTree().addMouseListener(new MouseAdapter() {

        @Override
        public void mouseUp(MouseEvent e) {
            Tree tree = filteredTree.getViewer().getTree();
            if ((tree.getSelectionCount() < 1) || (e.button != 1)) {
                return;
            }
            // Selection is made in the selection changed listener
            Object object = tree.getItem(new Point(e.x, e.y));
            TreeItem selection = tree.getSelection()[0];
            if (selection.equals(object)) {
                handleSelection();
            }
        }
    });
    return filteredTree;
}
Also used : PatternFilter(org.eclipse.ui.dialogs.PatternFilter) MouseEvent(org.eclipse.swt.events.MouseEvent) TreeItem(org.eclipse.swt.widgets.TreeItem) MouseAdapter(org.eclipse.swt.events.MouseAdapter) FilteredTree(org.eclipse.ui.dialogs.FilteredTree) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point) KeyEvent(org.eclipse.swt.events.KeyEvent) BaseWorkbenchContentProvider(org.eclipse.ui.model.BaseWorkbenchContentProvider) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FilteredTree(org.eclipse.ui.dialogs.FilteredTree) Tree(org.eclipse.swt.widgets.Tree) KeyListener(org.eclipse.swt.events.KeyListener) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 4 with PatternFilter

use of org.eclipse.ui.dialogs.PatternFilter in project egit by eclipse.

the class CommitViewerComparator method createFileSection.

private Section createFileSection(Composite container) {
    Section filesSection = toolkit.createSection(container, ExpandableComposite.TITLE_BAR | ExpandableComposite.CLIENT_INDENT);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(filesSection);
    Composite filesArea = toolkit.createComposite(filesSection);
    filesSection.setClient(filesArea);
    toolkit.paintBordersFor(filesArea);
    GridLayoutFactory.fillDefaults().extendedMargins(2, 2, 2, 2).applyTo(filesArea);
    ToolBar filesToolbar = new ToolBar(filesSection, SWT.FLAT);
    filesSection.setTextClient(filesToolbar);
    PatternFilter patternFilter = new PatternFilter() {

        @Override
        protected boolean isLeafMatch(Viewer viewer, Object element) {
            if (element instanceof CommitItem) {
                CommitItem commitItem = (CommitItem) element;
                return wordMatches(commitItem.path);
            }
            return super.isLeafMatch(viewer, element);
        }
    };
    patternFilter.setIncludeLeadingWildcard(true);
    FilteredCheckboxTree resourcesTreeComposite = new FilteredCheckboxTree(filesArea, toolkit, SWT.FULL_SELECTION, patternFilter) {

        @Override
        protected WorkbenchJob doCreateRefreshJob() {
            // workaround for file filter not having an explicit change
            // listener
            WorkbenchJob filterJob = super.doCreateRefreshJob();
            filterJob.addJobChangeListener(new JobChangeAdapter() {

                @Override
                public void done(IJobChangeEvent event) {
                    if (event.getResult().isOK()) {
                        getDisplay().asyncExec(new Runnable() {

                            @Override
                            public void run() {
                                updateFileSectionText();
                            }
                        });
                    }
                }
            });
            return filterJob;
        }
    };
    Tree resourcesTree = resourcesTreeComposite.getViewer().getTree();
    resourcesTree.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
    resourcesTreeComposite.setLayoutData(GridDataFactory.fillDefaults().hint(600, 200).grab(true, true).create());
    resourcesTree.addSelectionListener(new CommitItemSelectionListener());
    resourcesTree.setHeaderVisible(true);
    if (getPreferenceStore().getBoolean(UIPreferences.WARN_BEFORE_COMMITTING) && getPreferenceStore().getBoolean(UIPreferences.BLOCK_COMMIT)) {
        ignoreErrors = new Button(resourcesTreeComposite, SWT.CHECK);
        ignoreErrors.setText(UIText.CommitDialog_IgnoreErrors);
        ignoreErrors.setSelection(false);
        ignoreErrors.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                Button button = (Button) e.getSource();
                boolean enable = button.getSelection();
                updateMessage();
                updateCommitButtons(enable);
            }
        });
    }
    TreeColumn statCol = new TreeColumn(resourcesTree, SWT.LEFT);
    statCol.setText(UIText.CommitDialog_Status);
    statCol.setWidth(150);
    statCol.addSelectionListener(new HeaderSelectionListener(CommitItem.Order.ByStatus));
    TreeColumn resourceCol = new TreeColumn(resourcesTree, SWT.LEFT);
    resourceCol.setText(UIText.CommitDialog_Path);
    resourceCol.setWidth(415);
    resourceCol.addSelectionListener(new HeaderSelectionListener(CommitItem.Order.ByFile));
    filesViewer = resourcesTreeComposite.getCheckboxTreeViewer();
    new TreeViewerColumn(filesViewer, statCol).setLabelProvider(createStatusLabelProvider());
    new TreeViewerColumn(filesViewer, resourceCol).setLabelProvider(new CommitPathLabelProvider());
    ColumnViewerToolTipSupport.enableFor(filesViewer);
    filesViewer.setContentProvider(new CommitFileContentProvider());
    filesViewer.setUseHashlookup(true);
    IDialogSettings settings = org.eclipse.egit.ui.Activator.getDefault().getDialogSettings();
    if (settings.get(SHOW_UNTRACKED_PREF) != null) {
        // note, no matter how the dialog settings are, if
        // the preferences force us to include untracked files
        // we must show them
        showUntracked = Boolean.valueOf(settings.get(SHOW_UNTRACKED_PREF)).booleanValue() || getPreferenceStore().getBoolean(UIPreferences.COMMIT_DIALOG_INCLUDE_UNTRACKED);
    }
    filesViewer.addFilter(new CommitItemFilter());
    filesViewer.setInput(items.toArray());
    MenuManager menuManager = new MenuManager();
    menuManager.setRemoveAllWhenShown(true);
    menuManager.addMenuListener(createContextMenuListener());
    filesViewer.getTree().setMenu(menuManager.createContextMenu(filesViewer.getTree()));
    filesViewer.addCheckStateListener(new ICheckStateListener() {

        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            updateFileSectionText();
        }
    });
    showUntrackedItem = new ToolItem(filesToolbar, SWT.CHECK);
    Image showUntrackedImage = UIIcons.UNTRACKED_FILE.createImage();
    UIUtils.hookDisposal(showUntrackedItem, showUntrackedImage);
    showUntrackedItem.setImage(showUntrackedImage);
    showUntrackedItem.setToolTipText(UIText.CommitDialog_ShowUntrackedFiles);
    showUntrackedItem.setSelection(showUntracked);
    showUntrackedItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            showUntracked = showUntrackedItem.getSelection();
            filesViewer.refresh(true);
            updateFileSectionText();
            updateMessage();
        }
    });
    ToolItem checkAllItem = new ToolItem(filesToolbar, SWT.PUSH);
    Image checkImage = UIIcons.CHECK_ALL.createImage();
    UIUtils.hookDisposal(checkAllItem, checkImage);
    checkAllItem.setImage(checkImage);
    checkAllItem.setToolTipText(UIText.CommitDialog_SelectAll);
    checkAllItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            filesViewer.setAllChecked(true);
            updateFileSectionText();
            updateMessage();
        }
    });
    ToolItem uncheckAllItem = new ToolItem(filesToolbar, SWT.PUSH);
    Image uncheckImage = UIIcons.UNCHECK_ALL.createImage();
    UIUtils.hookDisposal(uncheckAllItem, uncheckImage);
    uncheckAllItem.setImage(uncheckImage);
    uncheckAllItem.setToolTipText(UIText.CommitDialog_DeselectAll);
    uncheckAllItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            filesViewer.setAllChecked(false);
            updateFileSectionText();
            updateMessage();
        }
    });
    if (!allowToChangeSelection) {
        amendingItem.setSelection(false);
        amendingItem.setEnabled(false);
        showUntrackedItem.setSelection(false);
        showUntrackedItem.setEnabled(false);
        checkAllItem.setEnabled(false);
        uncheckAllItem.setEnabled(false);
        filesViewer.addCheckStateListener(new ICheckStateListener() {

            @Override
            public void checkStateChanged(CheckStateChangedEvent event) {
                if (!event.getChecked())
                    filesViewer.setAllChecked(true);
                updateFileSectionText();
            }
        });
        filesViewer.setAllChecked(true);
    } else {
        final boolean includeUntracked = getPreferenceStore().getBoolean(UIPreferences.COMMIT_DIALOG_INCLUDE_UNTRACKED);
        for (CommitItem item : items) {
            if (!preselectAll && !preselectedFiles.contains(item.path))
                continue;
            if (item.status == Status.ASSUME_UNCHANGED)
                continue;
            if (!includeUntracked && item.status == Status.UNTRACKED)
                continue;
            filesViewer.setChecked(item, true);
        }
    }
    statCol.pack();
    resourceCol.pack();
    return filesSection;
}
Also used : PatternFilter(org.eclipse.ui.dialogs.PatternFilter) FilteredCheckboxTree(org.eclipse.egit.ui.internal.components.FilteredCheckboxTree) ICheckStateListener(org.eclipse.jface.viewers.ICheckStateListener) JobChangeAdapter(org.eclipse.core.runtime.jobs.JobChangeAdapter) CachedCheckboxTreeViewer(org.eclipse.egit.ui.internal.components.CachedCheckboxTreeViewer) Viewer(org.eclipse.jface.viewers.Viewer) Image(org.eclipse.swt.graphics.Image) Button(org.eclipse.swt.widgets.Button) TreeColumn(org.eclipse.swt.widgets.TreeColumn) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FilteredCheckboxTree(org.eclipse.egit.ui.internal.components.FilteredCheckboxTree) Tree(org.eclipse.swt.widgets.Tree) ToolItem(org.eclipse.swt.widgets.ToolItem) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) WorkbenchJob(org.eclipse.ui.progress.WorkbenchJob) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) IJobChangeEvent(org.eclipse.core.runtime.jobs.IJobChangeEvent) Section(org.eclipse.ui.forms.widgets.Section) TreeViewerColumn(org.eclipse.jface.viewers.TreeViewerColumn) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) ToolBar(org.eclipse.swt.widgets.ToolBar) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) CheckStateChangedEvent(org.eclipse.jface.viewers.CheckStateChangedEvent)

Example 5 with PatternFilter

use of org.eclipse.ui.dialogs.PatternFilter in project egit by eclipse.

the class GitSelectRepositoryPage method createControl.

@Override
public void createControl(Composite parent) {
    Composite main = new Composite(parent, SWT.NONE);
    GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).applyTo(main);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(main);
    // use a filtered tree
    FilteredTree tree = new FilteredTree(main, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL, new PatternFilter(), true);
    tv = tree.getViewer();
    GridDataFactory.fillDefaults().grab(true, true).applyTo(tree);
    tv.setContentProvider(new RepositoriesViewContentProvider() {

        @Override
        public Object[] getElements(Object inputElement) {
            Object[] elements = super.getElements(inputElement);
            if (allowBare) {
                return elements;
            }
            List<Object> result = new ArrayList<>();
            for (Object element : elements) {
                if (element instanceof RepositoryTreeNode) {
                    RepositoryTreeNode node = (RepositoryTreeNode) element;
                    if (node.getRepository() != null && !node.getRepository().isBare()) {
                        result.add(element);
                    }
                }
            }
            bareMsg.setVisible(result.size() != elements.length);
            return result.toArray();
        }

        // we never show children, only the Repository nodes
        @Override
        public Object[] getChildren(Object parentElement) {
            return null;
        }

        @Override
        public boolean hasChildren(Object element) {
            return false;
        }
    });
    tv.setLabelProvider(new RepositoriesViewLabelProvider());
    Composite tb = new Composite(main, SWT.NONE);
    GridLayoutFactory.fillDefaults().numColumns(1).applyTo(tb);
    GridDataFactory.fillDefaults().grab(false, true).applyTo(tb);
    addRepo = new Button(tb, SWT.PUSH);
    GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(addRepo);
    addRepo.setText(UIText.GitSelectRepositoryPage_AddButton);
    addRepo.setToolTipText(UIText.GitSelectRepositoryPage_AddTooltip);
    addRepo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            List<String> configuredDirs = util.getConfiguredRepositories();
            RepositorySearchWizard wizard = new RepositorySearchWizard(configuredDirs, allowBare);
            WizardDialog dlg = new WizardDialog(getShell(), wizard);
            if (dlg.open() == Window.OK && !wizard.getDirectories().isEmpty()) {
                Set<String> dirs = wizard.getDirectories();
                for (String dir : dirs) {
                    File gitDir = FileUtils.canonicalize(new File(dir));
                    GerritUtil.tryToAutoConfigureForGerrit(gitDir);
                    util.addConfiguredRepository(gitDir);
                }
                checkPage();
            }
        }
    });
    if (!allowBare) {
        bareMsg = new Composite(main, SWT.NONE);
        bareMsg.setLayout(new RowLayout());
        bareMsg.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
        Label imageLabel = new Label(bareMsg, SWT.NONE);
        imageLabel.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO));
        Label textLabel = new Label(bareMsg, SWT.WRAP);
        textLabel.setText(UIText.GitSelectRepositoryPage_BareRepositoriesHidden);
        bareMsg.setVisible(false);
    }
    tv.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            checkPage();
        }
    });
    tv.addDoubleClickListener(new IDoubleClickListener() {

        @Override
        public void doubleClick(DoubleClickEvent event) {
            checkPage();
            if (isPageComplete())
                getContainer().showPage(getNextPage());
        }
    });
    tv.setInput(util.getConfiguredRepositories());
    configChangeListener = new IPreferenceChangeListener() {

        @Override
        public void preferenceChange(PreferenceChangeEvent event) {
            if (RepositoryUtil.PREFS_DIRECTORIES_REL.equals(event.getKey())) {
                Display display = tv.getControl().getDisplay();
                display.asyncExec(() -> {
                    if (!tv.getControl().isDisposed()) {
                        refreshRepositoryList();
                        checkPage();
                    }
                });
            }
        }
    };
    util.getPreferences().addPreferenceChangeListener(configChangeListener);
    // we need to select at least a repository to become complete
    setPageComplete(false);
    Dialog.applyDialogFont(main);
    setControl(main);
}
Also used : PatternFilter(org.eclipse.ui.dialogs.PatternFilter) Set(java.util.Set) Label(org.eclipse.swt.widgets.Label) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) FilteredTree(org.eclipse.ui.dialogs.FilteredTree) RepositoriesViewLabelProvider(org.eclipse.egit.ui.internal.repository.RepositoriesViewLabelProvider) RepositoriesViewContentProvider(org.eclipse.egit.ui.internal.repository.RepositoriesViewContentProvider) RepositorySearchWizard(org.eclipse.egit.ui.internal.repository.RepositorySearchWizard) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ArrayList(java.util.ArrayList) List(java.util.List) PreferenceChangeEvent(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) IPreferenceChangeListener(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) RepositoryTreeNode(org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode) WizardDialog(org.eclipse.jface.wizard.WizardDialog) File(java.io.File) Display(org.eclipse.swt.widgets.Display)

Aggregations

PatternFilter (org.eclipse.ui.dialogs.PatternFilter)31 FilteredTree (org.eclipse.ui.dialogs.FilteredTree)23 Composite (org.eclipse.swt.widgets.Composite)20 GridLayout (org.eclipse.swt.layout.GridLayout)12 TreeViewer (org.eclipse.jface.viewers.TreeViewer)11 Viewer (org.eclipse.jface.viewers.Viewer)11 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)9 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)9 CheckStateChangedEvent (org.eclipse.jface.viewers.CheckStateChangedEvent)8 ICheckStateListener (org.eclipse.jface.viewers.ICheckStateListener)8 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)7 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)7 SelectionEvent (org.eclipse.swt.events.SelectionEvent)7 GridData (org.eclipse.swt.layout.GridData)7 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)6 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)6 Label (org.eclipse.swt.widgets.Label)6 Tree (org.eclipse.swt.widgets.Tree)6 CachedCheckboxTreeViewer (org.eclipse.egit.ui.internal.components.CachedCheckboxTreeViewer)5 FilteredCheckboxTree (org.eclipse.egit.ui.internal.components.FilteredCheckboxTree)5