import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
public class AddFileFolder extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
.getActivePage().getSelection();
public class AddFileFolder extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
.getActivePage().getSelection();
.getActiveWorkbenchWindow(event).getActivePage()
.findView(HandlerUtil.getActivePartId(event));
if (selection != null && !selection.isEmpty()
&& selection instanceof IStructuredSelection) {
Object obj = ((IStructuredSelection) selection).getFirstElement();
.getActiveWorkbenchWindow(event).getActivePage()
.findView(HandlerUtil.getActivePartId(event));
if (selection != null && !selection.isEmpty()
&& selection instanceof IStructuredSelection) {
Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof Node) {
String folderName = SingleValue.ask("Folder name",
"Enter folder name");
if (obj instanceof Node) {
String folderName = SingleValue.ask("Folder name",
"Enter folder name");
view.nodeAdded(parentNode, newNode);
parentNode.getSession().save();
} catch (RepositoryException e) {
view.nodeAdded(parentNode, newNode);
parentNode.getSession().save();
} catch (RepositoryException e) {