public void propertyChange(PropertyChangeEvent event) { if (fPart instanceof IDebugView) { IDebugView view = (IDebugView) fPart; view.getViewer().refresh(); } }
/** * @see AbstractDebugActionDelegate#initialize(IAction, ISelection) */ @Override protected boolean initialize(IAction action, ISelection selection) { if (!isInitialized()) { IDebugView adapter= getView().getAdapter(IDebugView.class); if (adapter != null) { if (adapter.getViewer() instanceof TreeModelViewer) { setViewer((TreeModelViewer) adapter.getViewer()); } adapter.setAction(getActionId(), action); } return super.initialize(action, selection); } return false; }
private void valueChanged(boolean on) { final Viewer viewer = getView().getViewer(); if (viewer.getControl().isDisposed()) { return; } IDebugModelPresentation debugLabelProvider= getView().getAdapter(IDebugModelPresentation.class); if (debugLabelProvider != null) { Boolean typesStatus = on ? Boolean.TRUE : Boolean.FALSE; debugLabelProvider.setAttribute(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, typesStatus); if (viewer instanceof TreeModelViewer) { TreeModelViewer treeViewer = (TreeModelViewer) viewer; treeViewer.getPresentationContext().setProperty(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, typesStatus); } BusyIndicator.showWhile(viewer.getControl().getDisplay(), () -> viewer.refresh()); } }
@Override protected void computeLabels(Object element, IPresentationContext context, ILabelRequestMonitor monitor) { DelegatingModelPresentation presentation = DebugElementHelper.getPresentation(); // Honor view specific settings in a debug view by copying model presentation settings // into the debug element helper's presentation before we get the label. This allows // for qualified name and type name settings to remain in tact. if (element instanceof IDebugElement && context.getPart() instanceof IDebugView) { IDebugView debugView = (IDebugView)context.getPart(); IDebugModelPresentation pres = debugView.getPresentation(((IDebugElement)element).getModelIdentifier()); Map<String, Object> settings = null; synchronized (presentation) { if (pres instanceof DelegatingModelPresentation) { settings = ((DelegatingModelPresentation)pres).getAttributes(); } else if (pres instanceof LazyModelPresentation) { settings = ((LazyModelPresentation)pres).getAttributes(); } if (settings != null) { for (Entry<String, Object> entry : settings.entrySet()) { presentation.setAttribute(entry.getKey(), entry.getValue()); } super.computeLabels(element, context, monitor); return; } } } super.computeLabels(element, context, monitor); }
@Override public void init(IViewPart view) { fView = view; IDebugView debugView = getView().getAdapter(IDebugView.class); if (debugView != null) { debugView.setAction(getActionId(), getAction()); } super.init(view); }
public void run(IAction action) { final StructuredViewer viewer = getStructuredViewer(); IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class); if (view != null) { IDebugModelPresentation pres = view.getPresentation(JDIDebugModel.getPluginIdentifier()); if (pres != null) { pres.setAttribute(JDIModelPresentation.DISPLAY_QUALIFIED_NAMES, (getValue() ? Boolean.TRUE : Boolean.FALSE)); BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable() { public void run() { viewer.refresh(); IPreferenceStore store = getPreferenceStore(); String key = getView().getSite().getId() + "." + getPreferenceKey(); //$NON-NLS-1$ store.setValue(key, getValue()); } }); } } } }
protected StructuredViewer getStructuredViewer() { IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class); if (view != null) { Viewer viewer = view.getViewer(); if (viewer instanceof StructuredViewer) { return (StructuredViewer)viewer; } } return null; }
protected StructuredViewer getStructuredViewer() { IDebugView view = getView().getAdapter(IDebugView.class); if (view != null) { Viewer viewer = view.getViewer(); if (viewer instanceof StructuredViewer) { return (StructuredViewer)viewer; } } return null; } }
public void run(IAction action) { HeapWalkingManager.getDefault().setShowReferenceInVarView(action.isChecked()); // If the current target doesn't support instance retrieval, warn the user that turning the option on will not do anything. if (action.isChecked() && fView.getViewer() != null){ if (fView.getViewer().getInput() instanceof IJavaStackFrame){ if (!HeapWalkingManager.supportsHeapWalking(fView.getViewer().getInput())){ JDIDebugUIPlugin.statusDialog(Messages.AllReferencesInViewActionDelegate_0,new Status(IStatus.WARNING,JDIDebugUIPlugin.getUniqueIdentifier(),Messages.AllReferencesInViewActionDelegate_1)); } } } }
public void propertyChange(PropertyChangeEvent event) { if (JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW.equals(event.getProperty()) || JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT.equals(event.getProperty())){ if (fAction != null){ fAction.setChecked(HeapWalkingManager.getDefault().isShowReferenceInVarView()); fView.getViewer().refresh(); } } } }
/** * Compute an anchor based on selected item in the tree. * * @param view anchor view * @return anchor point */ protected static Point getAnchor(IDebugView view) { Control control = view.getViewer().getControl(); if (control instanceof Tree) { Tree tree = (Tree) control; TreeItem[] selection = tree.getSelection(); if (selection.length > 0) { Rectangle bounds = selection[0].getBounds(); return tree.toDisplay(new Point(bounds.x, bounds.y + bounds.height)); } } return control.toDisplay(0, 0); }
/** * @see IActionDelegate#run(IAction) */ @Override public void run(IAction action){ if (!(getView() instanceof IDebugView)) { return; } Viewer viewer = ((IDebugView) getView()).getViewer(); if (viewer instanceof TreeViewer) { ArrayList<TreeItem> allVisible= new ArrayList<>(); Tree tree= ((TreeViewer) viewer).getTree(); collectExpandedAndVisible(tree.getItems(), allVisible); tree.setSelection(allVisible.toArray(new TreeItem[allVisible.size()])); // force viewer selection change viewer.setSelection(viewer.getSelection()); } }
protected void selectServerProcess(Object process) { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow() ; if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IWorkbenchPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW); if (part != null) { IDebugView view = (IDebugView)part.getAdapter(IDebugView.class); if (view != null) { Viewer viewer = view.getViewer(); if (viewer != null) { viewer.setSelection(new StructuredSelection(process)); } } } } } }
unableToResolveType(); ISelection selection= view.getViewer().getSelection(); if (!selection.isEmpty() && selection instanceof IStructuredSelection) { IStructuredSelection viewerSelection= (IStructuredSelection)selection;
Control control = debugView.getViewer().getControl(); if (control instanceof Tree) { Tree tree = (Tree) control;
if (lastException != null) { IExpression exp = new JavaInspectExpression(exception.getExceptionTypeName(), lastException); Tree tree = (Tree) ((IDebugView)part).getViewer().getControl(); TreeItem[] selection2 = tree.getSelection(); Rectangle bounds = selection2[0].getBounds();