private String getPrefId() { // constructs id based on memory view's secondary id + the rendering view pane id // format: secondaryId:viewPaneId StringBuffer id = new StringBuffer(); IMemoryRenderingSite renderingSite = fViewPane.getMemoryRenderingSite(); IWorkbenchPartSite ps = renderingSite.getSite(); if (ps instanceof IViewSite) { IViewSite vs = (IViewSite) ps; String secondaryId = vs.getSecondaryId(); if (secondaryId != null) { id.append(secondaryId); id.append(":"); // $NON-NLS-1$ } } id.append(fViewPane.getId()); String prefId = id.toString(); return prefId; }
/** @return secondary id, or null if not available */ private String getViewSiteSecondaryId() { IMemoryRenderingSite renderingSite = fViewPane.getMemoryRenderingSite(); IWorkbenchPartSite ps = renderingSite.getSite(); if (ps instanceof IViewSite) { IViewSite vs = (IViewSite) ps; String secondaryId = vs.getSecondaryId(); return secondaryId; } return null; }
public void handleDebugEvent(DebugEvent event) { Object obj = event.getSource(); IDebugTarget dt = null; if (event.getKind() == DebugEvent.TERMINATE) { // a terminate event could happen from an IThread or IDebugTarget // Only handle terminate event from debug target if (obj instanceof IDebugTarget) { dt = ((IDebugTarget) obj); // returns empty array if dt == null IMemoryRendering[] deletedrendering = getRenderingsFromDebugTarget(dt); for (int i = 0; i < deletedrendering.length; i++) { removeMemoryBlockRendering( deletedrendering[i].getMemoryBlock(), deletedrendering[i].getRenderingId()); fViewPane.removeMemoryRendering(deletedrendering[i]); } } } }