use of org.eclipse.che.ide.resources.impl.ResourceDeltaImpl in project che by eclipse.
the class AppContextImpl method initResourceManager.
@Override
public void initResourceManager(final Callback<ResourceManager, Exception> callback) {
if (runtime.getDevMachine() == null) {
//should never happened, but anyway
callback.onFailure(new NullPointerException("Dev machine is not initialized"));
}
if (projects != null) {
for (Project project : projects) {
eventBus.fireEvent(new ResourceChangedEvent(new ResourceDeltaImpl(project, REMOVED)));
}
projects = null;
}
resourceManager = resourceManagerFactory.newResourceManager(runtime.getDevMachine());
resourceManager.getWorkspaceProjects().then(projects -> {
AppContextImpl.this.projects = projects;
java.util.Arrays.sort(AppContextImpl.this.projects, ResourcePathComparator.getInstance());
callback.onSuccess(resourceManager);
eventBus.fireEvent(new WorkspaceReadyEvent(projects));
}).catchError(error -> {
callback.onFailure((Exception) error.getCause());
});
}
use of org.eclipse.che.ide.resources.impl.ResourceDeltaImpl in project che by eclipse.
the class AppContextImpl method onWorkspaceStopped.
@Override
public void onWorkspaceStopped(WorkspaceStoppedEvent event) {
appStateManager.get().persistWorkspaceState(getWorkspaceId()).then(ignored -> {
for (Project project : projects) {
eventBus.fireEvent(new ResourceChangedEvent(new ResourceDeltaImpl(project, REMOVED)));
}
projects = NO_PROJECTS;
resourceManager = null;
});
//goto close all editors
final EditorAgent editorAgent = editorAgentProvider.get();
final List<EditorPartPresenter> openedEditors = editorAgent.getOpenedEditors();
for (EditorPartPresenter editor : openedEditors) {
editorAgent.closeEditor(editor);
}
runtime = null;
}
Aggregations