Search in sources :

Example 81 with Project

use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.

the class DeleteRepositoryAction method actionPerformed.

/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
    final Project project = appContext.getRootProject();
    checkState(project != null, "Null project occurred");
    dialogFactory.createConfirmDialog(constant.deleteGitRepositoryTitle(), constant.deleteGitRepositoryQuestion(project.getName()), new ConfirmCallback() {

        @Override
        public void accepted() {
            presenter.deleteRepository(project);
        }
    }, null).show();
}
Also used : Project(org.eclipse.che.ide.api.resources.Project) ConfirmCallback(org.eclipse.che.ide.api.dialogs.ConfirmCallback)

Example 82 with Project

use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.

the class ComparePresenter method showCompareWithLatest.

/**
     * Show compare window.
     *
     * @param file
     *         file name with its full path
     * @param status
     *         status of the file
     * @param revision
     *         hash of revision or branch
     */
public void showCompareWithLatest(final File file, final Status status, final String revision) {
    this.comparedFile = file;
    this.revision = revision;
    this.compareWithLatest = true;
    if (status.equals(ADDED)) {
        showCompare("");
        return;
    }
    final Optional<Project> project = file.getRelatedProject();
    if (!project.isPresent()) {
        return;
    }
    final Path relPath = file.getLocation().removeFirstSegments(project.get().getLocation().segmentCount());
    if (status.equals(DELETED)) {
        service.showFileContent(appContext.getDevMachine(), project.get().getLocation(), relPath, revision).then(new Operation<ShowFileContentResponse>() {

            @Override
            public void apply(ShowFileContentResponse content) throws OperationException {
                view.setTitle(file.getLocation().toString());
                view.setColumnTitles(locale.compareYourVersionTitle(), revision + locale.compareReadOnlyTitle());
                view.show(content.getContent(), "", file.getLocation().toString(), false);
            }
        }).catchError(new Operation<PromiseError>() {

            @Override
            public void apply(PromiseError error) throws OperationException {
                notificationManager.notify(error.getMessage(), FAIL, NOT_EMERGE_MODE);
            }
        });
    } else {
        service.showFileContent(appContext.getDevMachine(), project.get().getLocation(), relPath, revision).then(new Operation<ShowFileContentResponse>() {

            @Override
            public void apply(ShowFileContentResponse content) throws OperationException {
                showCompare(content.getContent());
            }
        }).catchError(new Operation<PromiseError>() {

            @Override
            public void apply(PromiseError error) throws OperationException {
                notificationManager.notify(error.getMessage(), FAIL, NOT_EMERGE_MODE);
            }
        });
    }
}
Also used : Path(org.eclipse.che.ide.resource.Path) Project(org.eclipse.che.ide.api.resources.Project) PromiseError(org.eclipse.che.api.promises.client.PromiseError) ShowFileContentResponse(org.eclipse.che.api.git.shared.ShowFileContentResponse) Operation(org.eclipse.che.api.promises.client.Operation) OperationException(org.eclipse.che.api.promises.client.OperationException)

Example 83 with Project

use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.

the class InitRepositoryAction method actionPerformed.

/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
    final Project project = appContext.getRootProject();
    checkState(project != null, "Null project occurred");
    dialogFactory.createConfirmDialog(constant.createTitle(), constant.messagesInitRepoQuestion(project.getName()), new ConfirmCallback() {

        @Override
        public void accepted() {
            presenter.initRepository(project);
        }
    }, null).show();
}
Also used : Project(org.eclipse.che.ide.api.resources.Project) ConfirmCallback(org.eclipse.che.ide.api.dialogs.ConfirmCallback)

Example 84 with Project

use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.

the class PullAction 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 85 with Project

use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.

the class RemoveFromIndexAction 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)

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