Search in sources :

Example 26 with Project

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));
}
Also used : Project(org.eclipse.che.ide.api.resources.Project)

Example 27 with 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);
}
Also used : Project(org.eclipse.che.ide.api.resources.Project)

Example 28 with 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);
}
Also used : Project(org.eclipse.che.ide.api.resources.Project)

Example 29 with 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);
}
Also used : Project(org.eclipse.che.ide.api.resources.Project)

Example 30 with 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."));
        }
    });
}
Also used : Project(org.eclipse.che.ide.api.resources.Project) Optional(com.google.common.base.Optional) PromiseError(org.eclipse.che.api.promises.client.PromiseError) Resource(org.eclipse.che.ide.api.resources.Resource) Operation(org.eclipse.che.api.promises.client.Operation) File(org.eclipse.che.ide.api.resources.File) VirtualFile(org.eclipse.che.ide.api.resources.VirtualFile) OperationException(org.eclipse.che.api.promises.client.OperationException)

Aggregations

Project (org.eclipse.che.ide.api.resources.Project)127 Resource (org.eclipse.che.ide.api.resources.Resource)74 OperationException (org.eclipse.che.api.promises.client.OperationException)53 Operation (org.eclipse.che.api.promises.client.Operation)51 PromiseError (org.eclipse.che.api.promises.client.PromiseError)48 VirtualFile (org.eclipse.che.ide.api.resources.VirtualFile)24 CLIOutputResponse (org.eclipse.che.plugin.svn.shared.CLIOutputResponse)18 Promise (org.eclipse.che.api.promises.client.Promise)16 EditorPartPresenter (org.eclipse.che.ide.api.editor.EditorPartPresenter)14 Container (org.eclipse.che.ide.api.resources.Container)14 List (java.util.List)12 StatusNotification (org.eclipse.che.ide.api.notification.StatusNotification)12 Path (org.eclipse.che.ide.resource.Path)12 Optional (com.google.common.base.Optional)11 ArrayList (java.util.ArrayList)10 File (org.eclipse.che.ide.api.resources.File)10 Credentials (org.eclipse.che.ide.api.subversion.Credentials)10 FunctionException (org.eclipse.che.api.promises.client.FunctionException)9 JavaUtil.isJavaProject (org.eclipse.che.ide.ext.java.client.util.JavaUtil.isJavaProject)9 TextEditor (org.eclipse.che.ide.api.editor.texteditor.TextEditor)8