private IAction createWorkbenchAction(IStructuredSelection selection) { DeleteResourceAction action= new DeleteResourceAction(getShell()); action.selectionChanged(selection); return action; }
public void run(IStructuredSelection selection) { if (ReorgUtils.containsOnlyProjects(selection.toList())) { createWorkbenchAction(selection).run(); return; } try { RefactoringExecutionStarter.startDeleteRefactoring(selection.toArray(), getShell()); } catch (CoreException e) { ExceptionHandler.handle(e, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } } }
dialogMessage= MessageFormat.format(ReorgMessages.DeleteWorkingSet_removeorhideworkingset_single, new Object[] { workingSet.getLabel() }); dialog= new MessageDialog(getShell(), ReorgMessages.DeleteWorkingSet_single, null, dialogMessage, MessageDialog.QUESTION, new String[] { ReorgMessages.DeleteWorkingSet_Hide, ReorgMessages.DeleteWorkingSet_Remove, IDialogConstants.CANCEL_LABEL }, 0) { dialog= new MessageDialog(getShell(), ReorgMessages.DeleteWorkingSet_multiple, null, MessageFormat.format(ReorgMessages.DeleteWorkingSet_removeorhideworkingset_multiple, new Object[] { new Integer(selection.size()) }), MessageDialog.QUESTION, new String[] { ReorgMessages.DeleteWorkingSet_Hide, ReorgMessages.DeleteWorkingSet_Remove,
dialogMessage= MessageFormat.format(ReorgMessages.DeleteWorkingSet_removeorhideworkingset_single, new Object[] { workingSet.getLabel() }); dialog= new MessageDialog(getShell(), ReorgMessages.DeleteWorkingSet_single, null, dialogMessage, MessageDialog.QUESTION, new String[] { ReorgMessages.DeleteWorkingSet_Hide, ReorgMessages.DeleteWorkingSet_Remove, IDialogConstants.CANCEL_LABEL }, 0) { dialog= new MessageDialog(getShell(), ReorgMessages.DeleteWorkingSet_multiple, null, MessageFormat.format(ReorgMessages.DeleteWorkingSet_removeorhideworkingset_multiple, new Object[] { Integer.valueOf(selection.size()) }), MessageDialog.QUESTION, new String[] { ReorgMessages.DeleteWorkingSet_Hide, ReorgMessages.DeleteWorkingSet_Remove,
@Override public void run(IStructuredSelection selection) { if (ReorgUtils.containsOnlyProjects(selection.toList())) { createWorkbenchAction(selection).run(); return; } if (ReorgUtils.containsOnlyWorkingSets(selection.toList())){ deleteWorkingSets(selection); return; } try { RefactoringExecutionStarter.startDeleteRefactoring(selection.toArray(), getShell()); } catch (CoreException e) { ExceptionHandler.handle(e, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } } }
@Override public void run(IStructuredSelection selection) { if (ReorgUtils.containsOnlyProjects(selection.toList())) { createWorkbenchAction(selection).run(); return; } if (ReorgUtils.containsOnlyWorkingSets(selection.toList())){ deleteWorkingSets(selection); return; } try { RefactoringExecutionStarter.startDeleteRefactoring(selection.toArray(), getShell()); } catch (CoreException e) { ExceptionHandler.handle(e, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } } }