@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); }
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()); } }); } } } }