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();
}
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);
}
});
}
}
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();
}
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);
}
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);
}
Aggregations