use of org.eclipse.che.ide.resource.Path in project che by eclipse.
the class MovePresenter method onMoveClicked.
/** {@inheritDoc} */
@Override
public void onMoveClicked() {
final Project project = appContext.getRootProject();
checkState(project != null);
final Path source = getSource();
final String comment = view.isURLSelected() ? view.getComment() : null;
final StatusNotification notification = new StatusNotification(locale.moveNotificationStarted(source.toString()), PROGRESS, FLOAT_MODE);
notificationManager.notify(notification);
performOperationWithCredentialsRequestIfNeeded(new RemoteSubversionOperation<CLIOutputResponse>() {
@Override
public Promise<CLIOutputResponse> perform(Credentials credentials) {
notification.setStatus(PROGRESS);
notification.setTitle(locale.moveNotificationStarted(source.toString()));
return service.move(project.getLocation(), source, getTarget(), comment, credentials);
}
}, notification).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
notification.setTitle(locale.moveNotificationSuccessful());
notification.setStatus(SUCCESS);
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError arg) throws OperationException {
notification.setTitle(locale.moveNotificationFailed());
notification.setStatus(FAIL);
}
});
view.onClose();
}
use of org.eclipse.che.ide.resource.Path in project che by eclipse.
the class PlainJavaPagePresenter method onNodeSelected.
@Override
public void onNodeSelected(List<Node> nodes) {
String projectName = dataObject.getName();
List<String> nodeRelativePath = new LinkedList<>();
for (Node node : nodes) {
Path nodeLocation = ((ResourceNode) node).getData().getLocation();
nodeRelativePath.add(nodeLocation.makeRelativeTo(valueOf(projectName)).toString());
}
if (isSourceSelected) {
view.setSourceFolder(convertAttributeValuesToString(nodeRelativePath));
} else {
view.setLibraryFolder(convertAttributeValuesToString(nodeRelativePath));
}
onCoordinatesChanged();
}
Aggregations