Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Refresh Eclipse View Plugin
    primarykey
    data
    text
    <p>I created a simple view based off of the eclipse plugin view tutorial. I added functionality that allows my plugin to listen to changes on the debugger. My problem is, every time something on the debugger happens, I want my view to be refreshed and be updated with new information. Here is what I have/what I'm trying:</p> <pre><code> public void createPartControl(Composite parent) { listener = new DebugContextListener(this); DebugUITools.getDebugContextManager().addDebugContextListener(listener); // Check if there is an already started debug context IAdaptable dc = DebugUITools.getDebugContext(); if (dc != null) { dataCollection.add(new ProxyScope("hi")); // manually injecting data Object o = dc.getAdapter(IStackFrame.class); if (o instanceof IStackFrame) setStackFrame((IStackFrame) o); viewer.refresh(); // this doesn't work } viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); // Set column lines visible, and create two columns Tree tree = viewer.getTree(); tree.setHeaderVisible(true); tree.setLinesVisible(true); TreeColumn column1 = new TreeColumn(tree, SWT.LEFT); column1.setText("Name"); column1.setWidth(400); TreeColumn column2 = new TreeColumn(tree, SWT.LEFT); column2.setText("Value"); column2.setWidth(200); drillDownAdapter = new DrillDownAdapter(viewer); viewer.setContentProvider(new VariableViewContentProvider()); viewer.setLabelProvider(new VariableViewLabelProvider()); viewer.setSorter(new ViewerSorter()); viewer.setInput(getViewSite()); .... } </code></pre> <p>So basically, I have all this debug listening logic at the top, which happens inside that if statement. I know for a fact that my program gets in there. Everytime somethign changes I want to refresh my view, and I've tried doing viewer.refresh, which doesnt work. The information my view displays is based off of the dataCollection object, so that line with the dataCollection.add... is me just adding data manually as if the debugger did something. If I put that line outside the if statement, then my view works (I'm guessing this is just the original construction of the view when I first start the plugin), but when I put it inside the if statement it doesn't work, meaning my view never refreshes.</p> <p>Thank you for any help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload