/** * Creates a marker annotation model with the given resource as the source * of the markers. * * @param resource the resource */ public ResourceMarkerAnnotationModel(IResource resource) { Assert.isNotNull(resource); fResource= resource; fWorkspace= resource.getWorkspace(); }
/** * Creates a marker annotation model with the given resource as the source * of the markers. * * @param resource the resource */ public ResourceMarkerAnnotationModel(IResource resource) { Assert.isNotNull(resource); fResource= resource; fWorkspace= resource.getWorkspace(); }
@Override public String getValue(String variable, IResource resource) { return resource.getWorkspace().getRoot().getLocationURI().toASCIIString(); } }
@Override public void inputChanged(Viewer newViewer, Object oldInput, Object newInput) { if (oldInput == null) { IResource resource = (IResource) newInput; resource.getWorkspace().addResourceChangeListener(this); } this.viewer = newViewer; this.input = (IResource) newInput; }
/** * The visual part that is using this content provider is about * to be disposed. Deallocate all allocated SWT resources. */ @Override public void dispose() { if (input != null) { input.getWorkspace().removeResourceChangeListener(this); input = null; } }
@Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (this.input != null) { this.input.getWorkspace().removeResourceChangeListener(this); } this.input = (IResource) newInput; if (this.input != null) { this.input.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); } this.viewer = (TableViewer) viewer; }
/** * The visual part that is using this content provider is about * to be disposed. Deallocate all allocated SWT resources. */ @Override public void dispose() { IResource resource = (IResource) viewer.getInput(); if (resource != null) { resource.getWorkspace().removeResourceChangeListener(this); } }
protected IRefreshMonitor createPollingMonitor(IResource resource) { PollingMonitor monitor = ((Workspace)resource.getWorkspace()).getRefreshManager().monitors.pollMonitor; monitor.monitor(resource); return monitor; }
public void resetMonitors(IResource resource) { MonitorManager manager = ((Workspace)resource.getWorkspace()).getRefreshManager().monitors; manager.unmonitor(resource); manager.monitor(resource); } }
@Override protected ISchedulingRule getSchedulingRule() { if (this.pkgName.length == 0) return null; // no resource is going to be created IResource parentResource = ((JavaElement) getParentElement()).resource(); IResource resource = ((IContainer) parentResource).getFolder(new Path(this.pkgName[0])); return resource.getWorkspace().getRuleFactory().createRule(resource); } /**
protected ISchedulingRule getSchedulingRule() { if (this.pkgName.length == 0) return null; // no resource is going to be created IResource parentResource = ((JavaElement) getParentElement()).resource(); IResource resource = ((IContainer) parentResource).getFolder(new Path(this.pkgName[0])); return resource.getWorkspace().getRuleFactory().createRule(resource); } /**
protected ISchedulingRule getSchedulingRule() { if (this.pkgName.length == 0) return null; // no resource is going to be created IResource parentResource = ((JavaElement) getParentElement()).resource(); IResource resource = ((IContainer) parentResource).getFolder(new Path(this.pkgName[0])); return resource.getWorkspace().getRuleFactory().createRule(resource); } /**
protected ISchedulingRule getSchedulingRule() { IResource resource = getCompilationUnit().getResource(); IWorkspace workspace = resource.getWorkspace(); return workspace.getRuleFactory().modifyRule(resource); } /**
protected ISchedulingRule getSchedulingRule() { IResource resource = getCompilationUnit().getResource(); IWorkspace workspace = resource.getWorkspace(); return workspace.getRuleFactory().modifyRule(resource); } /**
@Override protected ISchedulingRule getSchedulingRule() { IResource resource = getCompilationUnit().getResource(); IWorkspace workspace = resource.getWorkspace(); return workspace.getRuleFactory().modifyRule(resource); } /**
public void resetMonitors(IResource resource, IProgressMonitor progressMonitor) { SubMonitor subMonitor = SubMonitor.convert(progressMonitor, 2); MonitorManager manager = ((Workspace) resource.getWorkspace()).getRefreshManager().monitors; manager.unmonitor(resource, subMonitor.split(1)); manager.monitor(resource, subMonitor.split(1)); } }
protected ISchedulingRule getSchedulingRule() { IResource resource = getElementToProcess().getResource(); if (resource == null) return null; IWorkspace workspace = resource.getWorkspace(); if (resource.exists()) { return workspace.getRuleFactory().modifyRule(resource); } else { return workspace.getRuleFactory().createRule(resource); } } /**
protected ISchedulingRule getSchedulingRule() { IResource resource = getElementToProcess().getResource(); if (resource == null) return null; IWorkspace workspace = resource.getWorkspace(); if (resource.exists()) { return workspace.getRuleFactory().modifyRule(resource); } else { return workspace.getRuleFactory().createRule(resource); } } /**
@Override protected ISchedulingRule getSchedulingRule() { IResource resource = getElementToProcess().getResource(); if (resource == null) return null; IWorkspace workspace = resource.getWorkspace(); if (resource.exists()) { return workspace.getRuleFactory().modifyRule(resource); } else { return workspace.getRuleFactory().createRule(resource); } } /**
@Override protected ISchedulingRule getSchedulingRule() { IResource resource = getCompilationUnit().getResource(); IWorkspace workspace = resource.getWorkspace(); if (resource.exists()) { return workspace.getRuleFactory().modifyRule(resource); } else { return workspace.getRuleFactory().createRule(resource); } } /**