本文整理汇总了Java中org.eclipse.core.resources.IResourceChangeEvent.POST_CHANGE属性的典型用法代码示例。如果您正苦于以下问题:Java IResourceChangeEvent.POST_CHANGE属性的具体用法?Java IResourceChangeEvent.POST_CHANGE怎么用?Java IResourceChangeEvent.POST_CHANGE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.core.resources.IResourceChangeEvent
的用法示例。
在下文中一共展示了IResourceChangeEvent.POST_CHANGE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: workspaceChanged
void workspaceChanged(IResourceChangeEvent event) {
try {
if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) {
if (Platform.isPlatformProject((IProject)event.getResource())) {
clear();
}
}
else if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
event.getDelta().accept(new IResourceDeltaVisitor() {
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
if (delta.getKind() == IResourceDelta.ADDED
&& delta.getResource().getType() == IResource.PROJECT) {
projectAdded((IProject) delta.getResource());
}
return delta.getResource().getType() == IResource.ROOT;
}
});
}
} catch (CoreException e) {
log.log(new Status(Status.ERROR, log.getBundle().getSymbolicName(), "Error when handling IResourceChangedEvent", e));
}
}
示例2: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getSource() instanceof IWorkspace) {
switch (event.getType()) {
case IResourceChangeEvent.POST_CHANGE:
try {
if (event.getDelta() != null && editor.isActiveOn(event.getResource())) {
editor.getPageModel();
}
} catch (Exception e) {
Log.error("Failed handing post_change of resource", e);
}
break;
}
}
}
示例3: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
if ((IResourceChangeEvent.POST_CHANGE != event.getType())) {
return;
}
ResourceDeltaToIssueResult markerChangeResult = null;
synchronized (visibleIssues) {
markerChangeResult = resourceChangeToIssues.process(event, connectedResource, visibleIssues);
if (markerChangeResult != null)
visibleIssues = markerChangeResult.getIssues();
}
if (markerChangeResult != null)
for (String elementID : markerChangeResult.getChangedElementIDs()) {
notifyListeners(elementID);
}
}
示例4: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
switch (event.getType()) {
case IResourceChangeEvent.POST_CHANGE:
handleResourceDelta(event.getDelta());
break;
case IResourceChangeEvent.PRE_DELETE:
// fall through
case IResourceChangeEvent.PRE_CLOSE:
IProject project = event.getResource().getProject();
if (isInterestingProject(project)) {
removeTemplates(project.getName());
}
break;
}
}
示例5: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
List<IFile> resourcesDeleted = new ArrayList<IFile>();
if (event.getType() == IResourceChangeEvent.POST_CHANGE){
iterateResourceDelta(event.getDelta(), resourcesDeleted);
for(IFile resource : resourcesDeleted){
String resourceString = resource.getRawLocation().toOSString();
availableDefaults.remove(resourceString);
if (resourceString.equals(actualDefault)){
actualDefault = null;
defaultReport = null;
defaultConfig = null;
}
}
savePreferences();
}
}
示例6: resourceChanged
public void resourceChanged(final IResourceChangeEvent event) {
switch (event.getType()) {
case IResourceChangeEvent.PRE_DELETE:
break;
case IResourceChangeEvent.POST_CHANGE:
try {
DeltaVisitor visitor = new DeltaVisitor(ABasicEditor.this);
event.getDelta().accept(visitor);
} catch (CoreException e) {
UIUtils.showError(e);
}
break;
case IResourceChangeEvent.PRE_BUILD:
case IResourceChangeEvent.POST_BUILD:
break;
}
}
示例7: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
IResourceDelta delta = event.getDelta();
try {
final WorkspaceDeltaVisitor visitor = new WorkspaceDeltaVisitor();
delta.accept(visitor);
if (!pendingChanges && visitor.anyChanges) {
pendingChanges = true;
indexer.requestImmediateSync();
}
} catch (Exception e) {
console.printerrln(e);
}
}
}
示例8: N4JSProjectExplorerContentProvider
/**
* Creates a new content provider for the navigator with N4JS content support.
*
* @param store
* the preference store;
*/
@Inject
public N4JSProjectExplorerContentProvider(final ExternalLibraryPreferenceStore store) {
store.addListener(this);
int eventMask = IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_CHANGE;
getWorkspace().addResourceChangeListener(this::cleanBuildOrManifestChangedEvent, eventMask);
}
示例9: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event)
{
switch( event.getType() )
{
case IResourceChangeEvent.POST_CHANGE:
handleResourceDelta(event.getDelta());
processModelChanges();
break;
case IResourceChangeEvent.PRE_CLOSE:
removeModel((IProject) event.getResource());
processModelChanges();
break;
}
}
示例10: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
switch (event.getType()) {
case IResourceChangeEvent.PRE_CLOSE:
case IResourceChangeEvent.PRE_DELETE:
handlerCloseProject(event);
break;
case IResourceChangeEvent.POST_CHANGE:
handleChangeProject(event.getDelta());
break;
default:
break;
}
}
示例11: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event == null || event.getDelta() == null || event.getType() != IResourceChangeEvent.POST_CHANGE) {
return;
}
try {
event.getDelta().accept(new IResourceDeltaVisitor() {
public boolean visit(IResourceDelta delta) throws CoreException {
final IResource resource = delta.getResource();
/* Visite le workspace. */
if (resource instanceof IWorkspaceRoot) {
return true;
}
/* Visite le projet. */
if (resource instanceof IProject && delta.getKind() == IResourceDelta.CHANGED) {
/* Cas d'un changement : potentiellement une ouverture de projet. */
handleProject(resource.getProject());
}
return false;
}
});
} catch (CoreException e) {
ErrorUtils.handle(e);
}
}
示例12: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getType() != IResourceChangeEvent.POST_CHANGE) {
return;
}
IEditorInput editorInput = this.getEditorInput();
if (!(editorInput instanceof FileEditorInput)) {
return;
}
FileEditorInput fileInput = (FileEditorInput) editorInput;
IFile file = fileInput.getFile();
IResourceDelta candidate = event.getDelta().findMember(file.getFullPath());
if (candidate == null) {
return;
}
/* Changement de contenu. */
if ((candidate.getFlags() & IResourceDelta.CONTENT) == 0) {
return;
}
switch (candidate.getKind()) {
case IResourceDelta.ADDED:
case IResourceDelta.CHANGED:
checkKsp(file);
break;
case IResourceDelta.REMOVED:
default:
break;
}
}
示例13: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
IResourceDelta delta = event.getDelta();
if (delta != null) {
try {
delta.accept(this);
} catch (CoreException e) {
EditorConfigPlugin.logError("Error while .editorconfig resource changed", e);
}
}
}
}
示例14: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
try {
if (event.getType() != IResourceChangeEvent.POST_CHANGE)
return;
IResourceDelta rootDelta = event.getDelta();
rootDelta.accept(new IResourceDeltaVisitor() {
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
if (delta.getKind() != IResourceDelta.CHANGED)
return true;
if ((delta.getFlags() & IResourceDelta.CONTENT) == 0)
return true;
IResource resource = delta.getResource();
if (resource.getType() == IResource.FILE
&& "proto".equalsIgnoreCase(resource.getFileExtension())) {
String projectPathStr = workspacePathStr + "/" + resource.getFullPath().segment(0).toString();
String protoPathStr = workspacePathStr + resource.getFullPath().toString();
executor.execute(new ProtocRunnable(log, genDirName, projectPathStr, protoPathStr));
}
return true;
}
});
} catch (Throwable th) {
log.error(th);
}
}
示例15: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
try {
IResource resource = event.getResource();
switch (event.getType()) {
case IResourceChangeEvent.PRE_DELETE:
if (resource != null) {
switch (resource.getType()) {
case IResource.PROJECT:
// called when project is deleted.
deleteProject((IProject) resource);
break;
}
}
break;
case IResourceChangeEvent.PRE_CLOSE:
if (resource != null) {
switch (resource.getType()) {
case IResource.PROJECT:
// called when project is closed.
closeProject((IProject) resource);
break;
}
}
break;
case IResourceChangeEvent.POST_CHANGE:
IResourceDelta delta = event.getDelta();
if (delta != null) {
delta.accept(this);
}
break;
}
} catch (Throwable e) {
Trace.trace(Trace.SEVERE, "Error while TypeScript resource changed", e);
}
}