Search in sources :

Example 1 with TreeNodeContentProvider

use of org.eclipse.jface.viewers.TreeNodeContentProvider in project pmd-eclipse-plugin by pmd.

the class CPDView method init.

/*
     * @see org.eclipse.ui.ViewPart#init(org.eclipse.ui.IViewSite)
     */
@Override
public void init(IViewSite site) throws PartInitException {
    super.init(site);
    contentProvider = new TreeNodeContentProvider();
    labelProvider = new CPDViewLabelProvider();
    doubleClickListener = new CPDViewDoubleClickEventListener(this);
    tooltipListener = new CPDViewTooltipListener(this);
}
Also used : TreeNodeContentProvider(org.eclipse.jface.viewers.TreeNodeContentProvider)

Example 2 with TreeNodeContentProvider

use of org.eclipse.jface.viewers.TreeNodeContentProvider in project xtext-eclipse by eclipse.

the class OutlinePage method showBusyStatus.

/**
 * @since 2.8
 */
protected void showBusyStatus() {
    TreeViewer treeViewer = getTreeViewer();
    treeViewer.setLabelProvider(busyLabelProvider);
    treeViewer.setContentProvider(new TreeNodeContentProvider());
    treeViewer.setInput(new TreeNode[] { new TreeNode("Loading...") });
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer) TreeNode(org.eclipse.jface.viewers.TreeNode) TreeNodeContentProvider(org.eclipse.jface.viewers.TreeNodeContentProvider)

Example 3 with TreeNodeContentProvider

use of org.eclipse.jface.viewers.TreeNodeContentProvider in project pmd-eclipse-plugin by pmd.

the class CPDView2 method init.

/*
     * @see org.eclipse.ui.ViewPart#init(org.eclipse.ui.IViewSite)
     */
@Override
public void init(IViewSite site) throws PartInitException {
    super.init(site);
    contentProvider = new TreeNodeContentProvider();
    labelProvider = new CPDViewLabelProvider2();
    measureListener = new Listener() {

        public void handleEvent(Event event) {
            captureColumnWidths();
        }
    };
    resizeListener = new Listener() {

        public void handleEvent(Event event) {
            int width = treeViewer.getTree().getBounds().width;
            messageColumn.setWidth(width - SPAN_COLUMN_WIDTH);
            captureColumnWidths();
            treeViewer.refresh();
        }
    };
    nameWidthsByName = new HashMap<String, int[]>();
}
Also used : IPropertyListener(org.eclipse.ui.IPropertyListener) Listener(org.eclipse.swt.widgets.Listener) Event(org.eclipse.swt.widgets.Event) KeyEvent(org.eclipse.swt.events.KeyEvent) TreeNodeContentProvider(org.eclipse.jface.viewers.TreeNodeContentProvider)

Aggregations

TreeNodeContentProvider (org.eclipse.jface.viewers.TreeNodeContentProvider)3 TreeNode (org.eclipse.jface.viewers.TreeNode)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 KeyEvent (org.eclipse.swt.events.KeyEvent)1 Event (org.eclipse.swt.widgets.Event)1 Listener (org.eclipse.swt.widgets.Listener)1 IPropertyListener (org.eclipse.ui.IPropertyListener)1