下面列出了怎么用org.eclipse.ui.internal.ide.actions.LTKLauncher的API类实例代码及写法,或者点击链接到github查看源代码。
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();
}
}
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 (LTKLauncher.openDeleteWizard(new StructuredSelection(resources))) {
closeMatchingEditors(resources, true);
return;
}
}
@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();
}
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();
}
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();
}