use of org.eclipse.che.ide.resources.reveal.RevealResourceEvent in project che by eclipse.
the class NewFolderAction method createFolder.
final void createFolder(String name) {
Resource resource = appContext.getResource();
if (!(resource instanceof Container)) {
final Container parent = resource.getParent();
checkState(parent != null, "Parent should be a container");
resource = parent;
}
((Container) resource).newFolder(name).then(new Operation<Folder>() {
@Override
public void apply(Folder folder) throws OperationException {
eventBus.fireEvent(new RevealResourceEvent(folder));
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
dialogFactory.createMessageDialog("Error", error.getMessage(), null).show();
}
});
}
Aggregations