@Override protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) { FileRecord resourceRecord = getFileRecordFromWorkbenchPart(part); if (resourceRecord != null) { resourceRecord.getResource().getWorkspace().removeResourceChangeListener(this); } AbstractStructureInspectorPage page = (AbstractStructureInspectorPage) pageRecord.page; if (page != null) { page.dispose(); } pageRecord.dispose(); }
protected IPath getResourcePath() { AbstractStructureInspectorPage page = getCurrentViewPage(); FileRecord record = page.getFileRecord(); IResource resource = record.getResource(); return resource.getFullPath(); }
protected void setupListener(FileRecord resourceRecord) { resourceRecord .getResource() .getWorkspace() .addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); }
private void calculateFileRecord(FileRecord fileRecord) { if (fileRecord.getLOC() == 0) { fileRecord.calculateLinesOfCode(); fileRecord.calculateNumberOfMethods(); } }