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 ExplorerCurrentProjectNameMacro method expand.
/** {@inheritDoc} */
@Override
public Promise<String> expand() {
List<Node> selectedNodes = projectExplorer.getTree().getSelectionModel().getSelectedNodes();
if (selectedNodes.isEmpty() || selectedNodes.size() > 1) {
return promises.resolve("");
}
final Node node = selectedNodes.get(0);
if (node instanceof ResourceNode) {
final Optional<Project> project = ((ResourceNode) node).getData().getRelatedProject();
if (!project.isPresent()) {
return promises.resolve("");
}
return promises.resolve(project.get().getName());
}
return promises.resolve("");
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class CopyPresenter method onCopyClicked.
/** {@inheritDoc} */
@Override
public void onCopyClicked() {
final Project project = appContext.getRootProject();
Preconditions.checkState(project != null);
final Path src = view.isSourceCheckBoxSelected() ? Path.valueOf(view.getSourcePath()) : toRelative(project, sourceNode);
final Path target = view.isTargetCheckBoxSelected() ? Path.valueOf(view.getTargetUrl()) : toRelative(project, this.target);
final String comment = view.isTargetCheckBoxSelected() ? view.getComment() : null;
final StatusNotification notification = new StatusNotification(constants.copyNotificationStarted(src.toString()), PROGRESS, FLOAT_MODE);
notificationManager.notify(notification);
view.hide();
performOperationWithCredentialsRequestIfNeeded(new RemoteSubversionOperation<CLIOutputResponse>() {
@Override
public Promise<CLIOutputResponse> perform(Credentials credentials) {
notification.setStatus(PROGRESS);
notification.setTitle(constants.copyNotificationStarted(src.toString()));
return service.copy(project.getLocation(), src, target, comment, credentials);
}
}, notification).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
printResponse(response.getCommand(), response.getOutput(), response.getErrOutput(), constants.commandCopy());
notification.setTitle(constants.copyNotificationSuccessful());
notification.setStatus(SUCCESS);
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
notification.setTitle(constants.copyNotificationFailed());
notification.setStatus(FAIL);
}
});
}
Aggregations