use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class InitRepositoryAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
super.updateInPerspective(event);
final Project project = appContext.getRootProject();
event.getPresentation().setEnabled(project != null && !GitUtil.isUnderGit(project));
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class PushAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
final Project project = appContext.getRootProject();
checkState(project != null, "Null project occurred");
presenter.showDialog(project);
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class ResetFilesAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
final Project project = appContext.getRootProject();
checkState(project != null, "Null project occurred");
presenter.showDialog(project);
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class ShowMergeAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
final Project project = appContext.getRootProject();
checkState(project != null, "Null project occurred");
presenter.showDialog(project);
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class BasicActiveFileHandler method tryFindFileInProject.
protected void tryFindFileInProject(final Location location, final AsyncCallback<VirtualFile> callback) {
Resource resource = appContext.getResource();
if (resource == null) {
callback.onFailure(new IllegalStateException("Resource is undefined"));
return;
}
Optional<Project> project = resource.getRelatedProject();
if (!project.isPresent()) {
callback.onFailure(new IllegalStateException("Project is undefined"));
return;
}
project.get().getFile(location.getTarget()).then(new Operation<Optional<File>>() {
@Override
public void apply(Optional<File> file) throws OperationException {
if (file.isPresent()) {
openFileAndScrollToLine(file.get(), location.getLineNumber(), callback);
} else {
callback.onFailure(new IllegalArgumentException(location.getTarget() + " not found."));
}
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
callback.onFailure(new IllegalArgumentException(location.getTarget() + " not found."));
}
});
}
Aggregations