public MemoryViewSynchronizationService() { fSynchronizeInfo = new Hashtable<>(); fPropertyListeners = new Hashtable<>(); MemoryViewUtil.getMemoryBlockManager().addListener(this); }
@Override protected Object[] getChildren(Object parent, IPresentationContext context) throws CoreException { String id = context.getId(); if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW)) { if (parent instanceof IMemoryBlockRetrieval) { return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)parent); } } return EMPTY; }
/** * Clean up when the plug-in is shutdown */ public void shutdown() { if (fSynchronizeInfo != null) { Enumeration<SynchronizeInfo> enumeration = fSynchronizeInfo.elements(); // clean up all synchronize info objects while (enumeration.hasMoreElements()) { SynchronizeInfo info = enumeration.nextElement(); info.delete(); } fSynchronizeInfo.clear(); fSynchronizeInfo = null; } MemoryViewUtil.getMemoryBlockManager().removeListener(this); }
@Override public void run() { IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow(); if (window == null) { return; } boolean proceed = MessageDialog.openQuestion(window.getShell(), DebugUIMessages.MemoryBlocksTreeViewPane_0, DebugUIMessages.MemoryBlocksTreeViewPane_1); // if (proceed) { IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval); DebugPlugin.getDefault().getMemoryBlockManager().removeMemoryBlocks(memoryBlocks); } } }
MemoryViewUtil.getMemoryBlockManager().addMemoryBlocks(memArray); if (fAddDefaultRenderings) { addDefaultRenderings(memBlock); IMemoryBlock[] memArray = new IMemoryBlock[] { memBlock }; MemoryViewUtil.getMemoryBlockManager().addMemoryBlocks(memArray); if (fAddDefaultRenderings) { addDefaultRenderings(memBlock);
@Override public void run() { ISelection selected = fTreeViewer.getSelection(); if (selected != null && selected instanceof IStructuredSelection) { Object[] selectedMemBlks = ((IStructuredSelection) selected).toArray(); ArrayList<Object> memoryBlocks = new ArrayList<>(); for (int i = 0; i < selectedMemBlks.length; i++) { if (selectedMemBlks[i] instanceof IMemoryBlock) { memoryBlocks.add(selectedMemBlks[i]); } } DebugPlugin.getDefault().getMemoryBlockManager().removeMemoryBlocks(memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()])); } } }
DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBlocks(memArray);
private void addSelectDeltaNode(ModelDelta delta) { IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval); if (memoryBlocks != null && memoryBlocks.length > 0) { delta.addNode(memoryBlocks[0], IModelDelta.SELECT); } }
@Override public void init(IPresentationContext context) { super.init(context); DebugPlugin.getDefault().getMemoryBlockManager().addListener(this); }
@Override public synchronized void dispose() { super.dispose(); DebugPlugin.getDefault().getMemoryBlockManager().removeListener(this); }
@Override protected boolean hasChildren(Object element, IPresentationContext context) throws CoreException { String id = context.getId(); if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW)) { if (element instanceof IMemoryBlockRetrieval) { if (((IMemoryBlockRetrieval)element).supportsStorageRetrieval()) return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)element).length > 0; } } return false; }
public ViewPaneEventHandler() { DebugPlugin.getDefault().getMemoryBlockManager().addListener(this); DebugPlugin.getDefault().addDebugEventListener(this); }
public void dispose() { fDisposed = true; DebugPlugin.getDefault().getMemoryBlockManager().removeListener(this); DebugPlugin.getDefault().removeDebugEventListener(this); }
private boolean isFirstMemoryBlock() { Object input = getViewer().getInput(); if (input instanceof IMemoryBlockRetrieval) { IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval) input); if (memoryBlocks.length == 1) return true; } return false; } }
@Override public void init(IViewPart view) { fView = view; DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).addDebugContextListener(fDebugContextListener); DebugPlugin.getDefault().getMemoryBlockManager().addListener(fListener); fUpdateJob.runInUIThread(new NullProgressMonitor()); }
@Override public void dispose() { fAction = null; DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fListener); DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).removeDebugContextListener(fDebugContextListener); if (fMenuCreator != null) { fMenuCreator.dispose(); } }
/** * Returns all children of the given parent in the given context. * * @param parent * @param context * @param monitor * @return all children */ protected Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor) { String id = context.getId(); if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW)) { if (parent instanceof IMemoryBlockRetrieval) { if (((IMemoryBlockRetrieval)parent).supportsStorageRetrieval()) return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)parent); } } return EMPTY; }
DebugPlugin.getDefault().getMemoryBlockManager().addListener(fMemoryBlockListener); DebugUITools.getMemoryRenderingManager().addListener(fBindingListener);
@Override public boolean close() { fViewer.removeSelectionChangedListener(fSelectionChangedListener); memoryBlock.removeSelectionListener(fSelectionListener); addNew.removeSelectionListener(fAddNewSelectionAdapter); DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fMemoryBlockListener); DebugUITools.getMemoryRenderingManager().removeListener(fBindingListener); return super.close(); }
/** * Returns all children of the given parent object. * * @param parent * @param context * @param monitor * @return all children * @throws CoreException */ protected Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor) throws CoreException { String id = context.getId(); if (id.equals(IDebugUIConstants.ID_DEBUG_VIEW)) { return ((IDebugTarget)parent).getThreads(); } else if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW)) { if (parent instanceof IMemoryBlockRetrieval) { if (((IMemoryBlockRetrieval)parent).supportsStorageRetrieval()) return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)parent); } } return EMPTY; }