public void run() { IResource currentResource = getCurrentResource(); if (currentResource == null || !currentResource.exists()) { return; } if (LTKLauncher.openRenameWizard(getStructuredSelection())) { return; } if (this.navigatorTree == null) { // Do a quick read only and null check if (!checkReadOnlyAndNull(currentResource)) { return; } String newName = queryNewResourceName(currentResource); if (newName == null || newName.equals("")) { //$NON-NLS-1$ return; } newPath = currentResource.getFullPath().removeLastSegments(1) .append(newName); super.run(); } else { runWithInlineEditor(); } }
@Override public void run() { final List<? extends IResource> resources = getSelectedResources(); if (!fTestingMode) { if (LTKLauncher.openDeleteWizard(getStructuredSelection())) { closeMatchingEditors(resources, true); return; } } // WARNING: do not query the selected resources more than once // since the selection may change during the run, // e.g. due to window activation when the prompt dialog is dismissed. // For more details, see Bug 60606 [Navigator] (data loss) Navigator // deletes/moves the wrong file if (!confirmDelete(resources)) { return; } final Job deletionCheckJob = new Job(IDEWorkbenchMessages.DeleteResourceAction_checkJobName) { @Override protected IStatus run(final IProgressMonitor monitor) { if (resources.isEmpty()) { return Status.CANCEL_STATUS; } scheduleDeleteJob(resources); return Status.OK_STATUS; } @Override public boolean belongsTo(final Object family) { if (IDEWorkbenchMessages.DeleteResourceAction_jobName.equals(family)) { return true; } return super.belongsTo(family); } }; deletionCheckJob.schedule(); }
@Override public void run() { final IResource currentResource = getCurrentResource(); if (currentResource == null || !currentResource.exists()) { return; } if (LTKLauncher.openRenameWizard(getStructuredSelection())) { return; } // Do a quick read only and null check if (!checkReadOnlyAndNull(currentResource)) { return; } final String newName = queryNewResourceName(currentResource); if (newName == null || newName.equals("")) { //$NON-NLS-1$ return; } newPath = currentResource.getFullPath().removeLastSegments(1).append(newName); super.run(); }
@Override public void run() { final IResource[] resources = getSelectedResourcesArray(); if (LTKLauncher.openDeleteWizard(getStructuredSelection())) { return; } Job deletionCheckJob = new Job(IDEWorkbenchMessages.DeleteResourceAction_checkJobName) { /* * (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ @Override protected IStatus run(IProgressMonitor monitor) { if (resources.length == 0) { return Status.CANCEL_STATUS; } scheduleDeleteJob(resources); return Status.OK_STATUS; } /* * (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object) */ @Override public boolean belongsTo(Object family) { if (IDEWorkbenchMessages.DeleteResourceAction_jobName.equals(family)) { return true; } return super.belongsTo(family); } }; deletionCheckJob.schedule(); }
public void run() { final IResource[] resources = getSelectedResourcesArray(); if (!fTestingMode) { if (LTKLauncher.openDeleteWizard(getStructuredSelection())) { return; } } // WARNING: do not query the selected resources more than once // since the selection may change during the run, // e.g. due to window activation when the prompt dialog is dismissed. // For more details, see Bug 60606 [Navigator] (data loss) Navigator // deletes/moves the wrong file if (!confirmDelete(resources)) { return; } Job deletionCheckJob = new Job(IDEWorkbenchMessages.DeleteResourceAction_checkJobName) { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ protected IStatus run(IProgressMonitor monitor) { if (resources.length == 0) return Status.CANCEL_STATUS; closeRelatedEditors(); scheduleDeleteJob(resources); return Status.OK_STATUS; } /* * (non-Javadoc) * * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object) */ public boolean belongsTo(Object family) { if (IDEWorkbenchMessages.DeleteResourceAction_jobName.equals(family)) { return true; } return super.belongsTo(family); } }; deletionCheckJob.schedule(); }