Package de.tobject.findbugs.view.explorer

Examples of de.tobject.findbugs.view.explorer.BugContentProvider


    }

    public void run(IAction action) {
        if (navigator != null) {
            CommonViewer viewer = navigator.getCommonViewer();
            BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
            // provider.setRefreshRequested(true);

            Object[] expandedElements = viewer.getExpandedElements();
            Object input = viewer.getInput();
            if (provider.getChildren(input).length == 0) {
                viewer.setInput(null);
                if (input instanceof IWorkingSet || input instanceof IWorkspaceRoot) {
                    viewer.setInput(input);
                } else {
                    viewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
                }
                viewer.refresh(true);
            } else {
                provider.reSetInput();
            }
            viewer.setExpandedElements(expandedElements);
        }
    }
View Full Code Here


        Object input = navigator.getCommonViewer().getInput();
        if (input instanceof IMarker) {
            return true;
        }
        if (input instanceof BugGroup) {
            BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
            BugGroup bugGroup = (BugGroup) input;
            Grouping grouping = provider.getGrouping();
            if (grouping == null) {
                return false;
            }
            // as long as the current input is on the "visible" children list
            // (workspace is invisible)
View Full Code Here

    public void markerSelected(IWorkbenchPart part, IMarker marker) {
        if (selectionInProgress) {
            return;
        }
        BugContentProvider provider = BugContentProvider.getProvider(getNavigatorContentService());
        CommonViewer commonViewer = getCommonViewer();
        if (marker == null) {
            commonViewer.setSelection(new StructuredSelection(), false);
        } else if (provider.isFiltered(marker)) {
            Object parent = provider.getParent(marker);
            if (parent != null) {
                commonViewer.setSelection(new StructuredSelection(parent), true);
            }
        } else {
            commonViewer.setSelection(new StructuredSelection(marker), true);
View Full Code Here

        selection = adaptSelection((IStructuredSelection) selection);
        super.selectReveal(selection);
    }

    private ISelection adaptSelection(IStructuredSelection selection) {
        BugContentProvider provider = BugContentProvider.getProvider(getNavigatorContentService());
        Set<Object> accepted = new HashSet<Object>();
        Iterator<?> iter = selection.iterator();
        while (iter.hasNext()) {
            Object object = iter.next();
            Set<Object> supported = provider.getShowInTargets(object);
            accepted.addAll(supported);
        }
        return new StructuredSelection(accepted.toArray());
    }
View Full Code Here

            }
        }
        String ids = FindBugsConstants.encodeIds(sortedIds);
        final IPreferenceStore store = FindbugsPlugin.getDefault().getPreferenceStore();
        store.setValue(FindBugsConstants.LAST_USED_EXPORT_FILTER, ids);
        BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
        if (!provider.isBugFilterActive()) {
            MessageDialog.openWarning(null, "Toggle Filter", "Filtering by pattern or type id is currently not enabled!\n"
                    + "To enable it, please select \"Toggle Filters...->Bugs by Id\" filter!");

        }
        provider.refreshFilters();
        CommonViewer viewer = navigator.getCommonViewer();
        Object[] expandedElements = viewer.getExpandedElements();
        viewer.refresh(true);
        viewer.setExpandedElements(expandedElements);
        data = null;
View Full Code Here

    public void run(IAction action) {
        if (navigator == null) {
            return;
        }
        BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
        List<GroupType> list = provider.getGrouping().asList();
        GroupSelectionDialog dialog = new GroupSelectionDialog(navigator.getSite().getShell(), list);
        dialog.setTitle("Bug Group Configuration");
        int result = dialog.open();
        if (result != Window.OK) {
            return;
        }
        Grouping grouping = Grouping.createFrom(dialog.getGroups());
        if (grouping == null) {
            return;
        }
        provider.setGrouping(grouping);
        CommonViewer viewer = navigator.getCommonViewer();
        Object[] expandedElements = viewer.getExpandedElements();
        provider.reSetInput();
        viewer.setExpandedElements(expandedElements);
    }
View Full Code Here

    public void selectionChanged(IAction action, ISelection selection) {
        if (navigator == null) {
            action.setEnabled(false);
            return;
        }
        BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
        action.setEnabled(provider.getGrouping() != null);
    }
View Full Code Here

        }
        String selectedIds = dialog.getSelectedIds();

        FindbugsPlugin.getDefault().getPreferenceStore().setValue(FindBugsConstants.LAST_USED_EXPORT_FILTER, selectedIds);

        BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
        provider.refreshFilters();
        CommonViewer viewer = navigator.getCommonViewer();
        Object[] expandedElements = viewer.getExpandedElements();
        viewer.refresh(true);
        viewer.setExpandedElements(expandedElements);
    }
View Full Code Here

    public void selectionChanged(IAction action, ISelection selection) {
        if (navigator == null) {
            action.setEnabled(false);
            return;
        }
        BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
        if (provider == null)
            throw new NullPointerException("Null provider");
        action.setEnabled(provider.getGrouping() != null);
    }
View Full Code Here

        }
        Grouping grouping = getGrouping(action.getId());
        if (grouping == null) {
            return;
        }
        BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());
        provider.setGrouping(grouping);
        CommonViewer viewer = navigator.getCommonViewer();
        Object[] expandedElements = viewer.getExpandedElements();
        provider.reSetInput();
        viewer.setExpandedElements(expandedElements);
    }
View Full Code Here

TOP

Related Classes of de.tobject.findbugs.view.explorer.BugContentProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.