use of org.eclipse.che.ide.api.event.ActivePartChangedEvent in project che by eclipse.
the class FileWatcher method handleFileOperations.
@Inject
private void handleFileOperations(EventBus eventBus) {
eventBus.addHandler(ResourceChangedEvent.getType(), new ResourceChangedEvent.ResourceChangedHandler() {
@Override
public void onResourceChanged(ResourceChangedEvent event) {
if (event.getDelta().getKind() != REMOVED) {
return;
}
if ((event.getDelta().getFlags() & DERIVED) == 0) {
return;
}
final Resource resource = event.getDelta().getResource();
final Optional<Resource> srcFolder = resource.getParentWithMarker(SourceFolderMarker.ID);
if (srcFolder.isPresent()) {
reparseAllOpenedFiles();
}
}
});
eventBus.addHandler(ActivePartChangedEvent.TYPE, new ActivePartChangedHandler() {
@Override
public void onActivePartChanged(ActivePartChangedEvent event) {
if (event.getActivePart() instanceof TextEditor) {
if (editor2reconcile.contains(event.getActivePart())) {
reParseEditor((TextEditor) event.getActivePart());
}
}
}
});
}
Aggregations