Exemplo n.º 1
0
 /**
  * Perform a basic project creation.
  *
  * @param project
  * @param description
  * @param subMonitor
  * @throws CoreException
  */
 private void doBasicCreateProject(
     IProject project, final IProjectDescription description, IProgressMonitor monitor)
     throws InvocationTargetException {
   CreateProjectOperation op =
       new CreateProjectOperation(description, getProjectCreationDescription());
   try {
     // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901
     // directly execute the operation so that the undo state is
     // not preserved. Making this undoable resulted in too many
     // accidental file deletions.
     op.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
   } catch (ExecutionException e) {
     throw new InvocationTargetException(e);
   }
 }
 /** Delete the marker selection. */
 public void run() {
   final IStructuredSelection sel = getStructuredSelection();
   if (sel.isEmpty()) {
     return;
   }
   List list = sel.toList();
   IMarker[] markers = new IMarker[list.size()];
   list.toArray(markers);
   IUndoableOperation op =
       new DeleteMarkersOperation(markers, BookmarkMessages.RemoveBookmark_undoText);
   execute(
       op,
       BookmarkMessages.RemoveBookmark_errorTitle,
       null,
       WorkspaceUndoUtil.getUIInfoAdapter(getView().getShell()));
 }