Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-08 03:12:28 -0400
committerAlexander Kurtakov2017-09-08 03:12:51 -0400
commitb3c56b7f12d085ef7a40b169876746c16871d8c6 (patch)
tree05d941656f31ec643c278002abf8518f37466a41 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui
parentfa2b847f155ce5cc60fac6a40a39aae766823467 (diff)
downloadeclipse.platform.debug-b3c56b7f12d085ef7a40b169876746c16871d8c6.tar.gz
eclipse.platform.debug-b3c56b7f12d085ef7a40b169876746c16871d8c6.tar.xz
eclipse.platform.debug-b3c56b7f12d085ef7a40b169876746c16871d8c6.zip
Revert "Bug 521038 - Replaced anonymous Runnable classes by lambda expression"
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupCycleHandler.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/UnsupportedModeHandler.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java129
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java201
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java267
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java343
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java175
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java7
51 files changed, 1286 insertions, 999 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index 6373542b1..a8ae9ca77 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -398,11 +398,14 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
}
final Object [] ret = new Object[1];
final CoreException [] exc = new CoreException[1];
- BusyIndicator.showWhile(null, () -> {
- try {
- ret[0] = element.createExecutableExtension(classAttribute);
- } catch (CoreException e) {
- exc[0] = e;
+ BusyIndicator.showWhile(null, new Runnable() {
+ @Override
+ public void run() {
+ try {
+ ret[0] = element.createExecutableExtension(classAttribute);
+ } catch (CoreException e) {
+ exc[0] = e;
+ }
}
});
if (exc[0] != null) {
@@ -581,12 +584,14 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
// do the asynchronous exec last - see bug 209920
getStandardDisplay().asyncExec(
- () -> {
- // initialize the selected resource `
- SelectedResourceManager.getDefault();
- // forces launch shortcuts to be initialized so their
- // key-bindings work
- getLaunchConfigurationManager().getLaunchShortcuts();
+ new Runnable() {
+ @Override
+ public void run() {
+ //initialize the selected resource `
+ SelectedResourceManager.getDefault();
+ // forces launch shortcuts to be initialized so their key-bindings work
+ getLaunchConfigurationManager().getLaunchShortcuts();
+ }
});
}
@@ -1260,7 +1265,12 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
if (group == null) {
return status;
}
- Runnable r = () -> DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(configuration), group.getIdentifier(), status);
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(configuration), group.getIdentifier(), status);
+ }
+ };
DebugUIPlugin.getStandardDisplay().asyncExec(r);
}
finally {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
index de9b68bea..f9f0a4303 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
@@ -214,15 +214,26 @@ public class DebugUIPreferenceInitializer extends AbstractPreferenceInitializer
public static void setThemeBasedPreferences(final IPreferenceStore store, final boolean fireEvent) {
Display display= PlatformUI.getWorkbench().getDisplay();
- Runnable runnable = () -> {
- ColorRegistry registry = null;
- if (PlatformUI.isWorkbenchRunning()) {
- registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+ Runnable runnable= new Runnable() {
+ @Override
+ public void run() {
+ ColorRegistry registry= null;
+ if (PlatformUI.isWorkbenchRunning()) {
+ registry= PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+ }
+ setDefault(store,
+ IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR,
+ findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_BACKGROUND, new RGB(255, 255, 255)), fireEvent);
+ setDefault(store,
+ IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR,
+ findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_OUT, new RGB(0, 0, 0)), fireEvent);
+ setDefault(store,
+ IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR,
+ findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_IN, new RGB(0, 200, 125)), fireEvent);
+ setDefault(store,
+ IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR,
+ findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_ERR, new RGB(255, 0, 0)), fireEvent);
}
- setDefault(store, IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR, findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_BACKGROUND, new RGB(255, 255, 255)), fireEvent);
- setDefault(store, IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR, findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_OUT, new RGB(0, 0, 0)), fireEvent);
- setDefault(store, IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR, findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_IN, new RGB(0, 200, 125)), fireEvent);
- setDefault(store, IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR, findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_ERR, new RGB(255, 0, 0)), fireEvent);
};
if (display.getThread() == Thread.currentThread()) {
runnable.run();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
index d6b6262d7..25c71b47a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
@@ -85,7 +85,18 @@ public class ImageDescriptorRegistry {
}
private void hookDisplay() {
- fDisplay.asyncExec(() -> fDisplay.disposeExec(() -> dispose()));
+ fDisplay.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ fDisplay.disposeExec(new Runnable() {
+
+ @Override
+ public void run() {
+ dispose();
+ }
+ });
+ }
+ });
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
index 9c0172169..d0bb87c70 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
@@ -27,10 +27,13 @@ public class WorkingDirectoryStatusHandler implements IStatusHandler {
@Override
public Object handleStatus(IStatus status, Object source) {
final boolean[] result = new boolean[1];
- DebugUIPlugin.getStandardDisplay().syncExec(() -> {
- String title = DebugUIMessages.WorkingDirectoryStatusHandler_Eclipse_Runtime_1;
- String message = DebugUIMessages.WorkingDirectoryStatusHandler_0;
- result[0] = (MessageDialog.openQuestion(DebugUIPlugin.getShell(), title, message));
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ String title= DebugUIMessages.WorkingDirectoryStatusHandler_Eclipse_Runtime_1;
+ String message= DebugUIMessages.WorkingDirectoryStatusHandler_0;
+ result[0]= (MessageDialog.openQuestion(DebugUIPlugin.getShell(), title, message));
+ }
});
return Boolean.valueOf(result[0]);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
index 820a08469..a5d928e23 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
@@ -101,19 +101,22 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
fIsShift = isShift;
final MultiStatus status=
new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, getStatusMessage(), null);
- BusyIndicator.showWhile(Display.getCurrent(), () -> {
- Iterator<?> selectionIter = selection.iterator();
- while (selectionIter.hasNext()) {
- Object element = selectionIter.next();
- try {
- // Action's enablement could have been changed since
- // it was last enabled. Check that the action is still
- // enabled before running the action.
- if (isEnabledFor(element)) {
- doAction(element);
+ BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
+ @Override
+ public void run() {
+ Iterator<?> selectionIter = selection.iterator();
+ while (selectionIter.hasNext()) {
+ Object element= selectionIter.next();
+ try {
+ // Action's enablement could have been changed since
+ // it was last enabled. Check that the action is still
+ // enabled before running the action.
+ if (isEnabledFor(element)) {
+ doAction(element);
+ }
+ } catch (DebugException e) {
+ status.merge(e.getStatus());
}
- } catch (DebugException e) {
- status.merge(e.getStatus());
}
}
});
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
index e2dca1c41..5c896783e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
@@ -169,19 +169,22 @@ public class AddToFavoritesAction extends SelectionListenerAction {
@Override
public void run() {
final CoreException[] ex = new CoreException[1];
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), () -> {
- try {
- List<String> list = getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
- if (list == null) {
- list = new ArrayList<String>();
+ BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ try {
+ List<String> list = getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
+ if (list == null) {
+ list = new ArrayList<String>();
+ }
+ list.add(getGroup().getIdentifier());
+ ILaunchConfigurationWorkingCopy copy = getLaunchConfiguration().getWorkingCopy();
+ copy.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, list);
+ copy.doSave();
+ setEnabled(false);
+ } catch (CoreException e) {
+ ex[0] = e;
}
- list.add(getGroup().getIdentifier());
- ILaunchConfigurationWorkingCopy copy = getLaunchConfiguration().getWorkingCopy();
- copy.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, list);
- copy.doSave();
- setEnabled(false);
- } catch (CoreException e) {
- ex[0] = e;
}
});
if (ex[0] != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
index 3d70cf3eb..7ac218073 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
@@ -44,24 +44,27 @@ public abstract class ToggleFilterAction extends Action {
if (getViewer().getControl().isDisposed()) {
return;
}
- BusyIndicator.showWhile(getViewer().getControl().getDisplay(), () -> {
- if (on) {
- ViewerFilter filter = getViewerFilter();
- ViewerFilter[] filters = getViewer().getFilters();
- boolean alreadyAdded = false;
- for (int i = 0; i < filters.length; i++) {
- ViewerFilter addedFilter = filters[i];
- if (addedFilter.equals(filter)) {
- alreadyAdded = true;
- break;
+ BusyIndicator.showWhile(getViewer().getControl().getDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ if (on) {
+ ViewerFilter filter= getViewerFilter();
+ ViewerFilter[] filters= getViewer().getFilters();
+ boolean alreadyAdded= false;
+ for (int i= 0; i < filters.length; i++) {
+ ViewerFilter addedFilter= filters[i];
+ if (addedFilter.equals(filter)) {
+ alreadyAdded= true;
+ break;
+ }
+ }
+ if (!alreadyAdded) {
+ getViewer().addFilter(filter);
}
- }
- if (!alreadyAdded) {
- getViewer().addFilter(filter);
- }
- } else {
- getViewer().removeFilter(getViewerFilter());
+ } else {
+ getViewer().removeFilter(getViewerFilter());
+ }
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
index f7cc45af2..1fdb32f8c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
@@ -245,16 +245,19 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
if (shell == null || shell.isDisposed()) {
return;
}
- Runnable r = () -> {
- IWorkbenchWindow ww = getView().getViewSite().getPage().getWorkbenchWindow();
- if (ww == null) {
- return;
- }
- Shell s = ww.getShell();
- if (s == null || s.isDisposed()) {
- return;
+ Runnable r= new Runnable() {
+ @Override
+ public void run() {
+ IWorkbenchWindow ww= getView().getViewSite().getPage().getWorkbenchWindow();
+ if (ww == null) {
+ return;
+ }
+ Shell s= ww.getShell();
+ if (s == null || s.isDisposed()) {
+ return;
+ }
+ update();
}
- update();
};
shell.getDisplay().asyncExec(r);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
index ea2803182..a30973340 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
@@ -70,7 +70,12 @@ public class ShowTypesAction extends Action {
TreeModelViewer treeViewer = (TreeModelViewer) viewer;
treeViewer.getPresentationContext().setProperty(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, typesStatus);
}
- BusyIndicator.showWhile(viewer.getControl().getDisplay(), () -> viewer.refresh());
+ BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ viewer.refresh();
+ }
+ });
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
index fefe8cbfd..851b2d4a7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
@@ -30,29 +30,44 @@ public class ExecuteActionRequest extends DebugCommandRequest {
super(elements);
}
- @Override
+ @Override
public void done() {
- if (fParticipant != null) {
+ if (fParticipant != null) {
fParticipant.requestDone(this);
fParticipant = null;
}
- final IStatus status = getStatus();
- if (status != null) {
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> MessageDialog.openError(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()));
- break;
- case IStatus.WARNING:
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> MessageDialog.openWarning(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()));
- break;
- case IStatus.INFO:
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> MessageDialog.openInformation(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()));
- break;
+ final IStatus status = getStatus();
+ if (status != null) {
+ switch (status.getSeverity()) {
+ case IStatus.ERROR:
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
+ }
+ });
+ break;
+ case IStatus.WARNING:
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openWarning(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
+ }
+ });
+ break;
+ case IStatus.INFO:
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openInformation(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
+ }
+ });
+ break;
default:
break;
- }
- }
- }
+ }
+ }
+ }
public void setCommandParticipant(ICommandParticipant participant) {
fParticipant = participant;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
index 3495f7a09..b0d0713bf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
@@ -36,21 +36,24 @@ import org.eclipse.jface.viewers.StructuredSelection;
*/
public class TerminateAndRelaunchAction extends DebugCommandAction {
- @Override
+ @Override
public void postExecute(IRequest request, final Object[] targets) {
- if (request.getStatus() == null || request.getStatus().isOK()) {
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> {
- // Must be run in the UI thread since the launch can require
- // prompting to proceed
- for (int i = 0; i < targets.length; i++) {
- ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
- if (launch != null) {
- RelaunchActionDelegate.relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
- }
- }
- });
- }
- }
+ if (request.getStatus() == null || request.getStatus().isOK()) {
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ // Must be run in the UI thread since the launch can require
+ // prompting to proceed
+ for (int i = 0; i < targets.length; i++) {
+ ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
+ if (launch != null) {
+ RelaunchActionDelegate.relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
+ }
+ }
+ }
+ });
+ }
+ }
@Override
protected ISelection getContext() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
index fe449fe12..b56924351 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
@@ -579,7 +579,13 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
final ToolBar bar = entry.getValue();
if(bar != null && !bar.isDisposed()) {
final MouseTrackAdapter listener = fMouseListener;
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> bar.removeMouseTrackListener(listener));
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ bar.removeMouseTrackListener(listener);
+ }
+ });
+
}
}
fWindows.clear();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
index d4a7b0752..57f07a8e7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
@@ -59,7 +59,12 @@ public class DebugContextSourceProvider extends AbstractSourceProvider implement
values.put(IDebugUIConstants.DEBUG_CONTEXT_SOURCE_NAME, event.getContext());
// make sure fireSourceChanged is called on the UI thread
if (Display.getCurrent() == null) {
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> fireSourceChanged(ISources.ACTIVE_CURRENT_SELECTION, values));
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ fireSourceChanged(ISources.ACTIVE_CURRENT_SELECTION, values);
+ }
+ });
} else {
fireSourceChanged(ISources.ACTIVE_CURRENT_SELECTION, values);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index e661d079d..c02a87ede 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -59,9 +59,12 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
fWindow.getPartService().addPartListener(this);
// need to register source provider on the UI thread (bug 438396)
- window.getShell().getDisplay().asyncExec(() -> {
- if (fWindow != null) {
- fSourceProvider = new DebugContextSourceProvider(DebugWindowContextService.this, evaluationService);
+ window.getShell().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (fWindow != null) {
+ fSourceProvider = new DebugContextSourceProvider(DebugWindowContextService.this, evaluationService);
+ }
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupCycleHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupCycleHandler.java
index f9cc6e80a..746cc7581 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupCycleHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupCycleHandler.java
@@ -27,10 +27,12 @@ public class GroupCycleHandler implements IStatusHandler {
@Override
public Object handleStatus(IStatus status, final Object source) throws CoreException {
- PlatformUI.getWorkbench().getDisplay().asyncExec(
- () -> MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
- , DebugUIMessages.GroupLaunch_Error, NLS.bind(DebugUIMessages.GroupLaunch_Cycle, source.toString()))
- );
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DebugUIMessages.GroupLaunch_Error, NLS.bind(DebugUIMessages.GroupLaunch_Cycle, source.toString()));
+ }
+ });
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/UnsupportedModeHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/UnsupportedModeHandler.java
index 0ec79618f..de4a090bd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/UnsupportedModeHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/UnsupportedModeHandler.java
@@ -30,10 +30,12 @@ public class UnsupportedModeHandler implements IStatusHandler {
public Object handleStatus(IStatus status, Object source) throws CoreException {
if (source instanceof String[]) {
final String[] data = (String[]) source;
- PlatformUI.getWorkbench().getDisplay().asyncExec(
- () -> MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
- , DebugUIMessages.GroupLaunch_Error, NLS.bind(DebugUIMessages.GroupLaunch_Cannot_launch, data[0], data[1]))
- );
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DebugUIMessages.GroupLaunch_Error, NLS.bind(DebugUIMessages.GroupLaunch_Cannot_launch, data[0], data[1]));
+ }
+ });
}
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
index 75b60eda9..5e4b35728 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
@@ -307,15 +307,20 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
* @param path the path from the text widget
*/
protected void resetSelection(final IPath path) {
- BusyIndicator.showWhile(getShell().getDisplay(), () -> {
- File file = new File(path.toOSString());
- DebugFileSystemElement dummyparent = new DebugFileSystemElement(IInternalDebugCoreConstants.EMPTY_STRING, null, true);
- dummyparent.setPopulated();
- DebugFileSystemElement element = new DebugFileSystemElement(FileSystemStructureProvider.INSTANCE.getLabel(file), dummyparent, file.isDirectory());
- element.setFileSystemObject(file);
- element.getFiles();
- selectionGroup.setRoot(dummyparent);
- });
+ BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ File file = new File(path.toOSString());
+ DebugFileSystemElement dummyparent = new DebugFileSystemElement(IInternalDebugCoreConstants.EMPTY_STRING, null, true);
+ dummyparent.setPopulated();
+ DebugFileSystemElement element = new DebugFileSystemElement(FileSystemStructureProvider.INSTANCE.getLabel(file),
+ dummyparent,
+ file.isDirectory());
+ element.setFileSystemObject(file);
+ element.getFiles();
+ selectionGroup.setRoot(dummyparent);
+ }
+ });
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
index 7e31a9cfb..1559bebfa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
@@ -98,7 +98,15 @@ public abstract class AbstractLaunchConfigurationAction extends SelectionListene
return;
}
}
- Runnable r = () -> performAction();
+ Runnable r = new Runnable() {
+ /**
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ performAction();
+ }
+ };
BusyIndicator.showWhile(getShell().getDisplay(), r);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index 4efa9abb2..dc91023de 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -590,7 +590,12 @@ public class LaunchConfigurationTabGroupViewer {
setInput0(input);
}
else {
- DebugUIPlugin.getStandardDisplay().syncExec(() -> setInput0(input));
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ setInput0(input);
+ }
+ });
}
}
@@ -619,27 +624,31 @@ public class LaunchConfigurationTabGroupViewer {
*/
protected void inputChanged(Object input) {
final Object finput = input;
- Runnable r = () -> {
- try {
- fViewform.setRedraw(false);
- if (finput instanceof ILaunchConfiguration) {
- ILaunchConfiguration configuration = (ILaunchConfiguration) finput;
- boolean refreshtabs = !delegatesEqual(fWorkingCopy, configuration);
- fOriginal = configuration;
- fWorkingCopy = configuration.getWorkingCopy();
- displayInstanceTabs(refreshtabs);
- } else if (finput instanceof ILaunchConfigurationType) {
- fDescription = getDescription((ILaunchConfigurationType) finput);
- setNoInput();
- } else {
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ fViewform.setRedraw(false);
+ if (finput instanceof ILaunchConfiguration) {
+ ILaunchConfiguration configuration = (ILaunchConfiguration)finput;
+ boolean refreshtabs = !delegatesEqual(fWorkingCopy, configuration);
+ fOriginal = configuration;
+ fWorkingCopy = configuration.getWorkingCopy();
+ displayInstanceTabs(refreshtabs);
+ } else if (finput instanceof ILaunchConfigurationType) {
+ fDescription = getDescription((ILaunchConfigurationType)finput);
+ setNoInput();
+ } else {
+ setNoInput();
+ }
+ } catch (CoreException ce) {
+ errorDialog(ce);
setNoInput();
}
- } catch (CoreException ce) {
- errorDialog(ce);
- setNoInput();
- } finally {
- refreshStatus();
- fViewform.setRedraw(true);
+ finally {
+ refreshStatus();
+ fViewform.setRedraw(true);
+ }
}
};
BusyIndicator.showWhile(getShell().getDisplay(), r);
@@ -859,19 +868,22 @@ public class LaunchConfigurationTabGroupViewer {
// Use a final Object array to store the tab group and any exception that
// results from the Runnable
final Object[] finalArray = new Object[2];
- Runnable runnable = () -> {
- ILaunchConfigurationTabGroup tabGroup = null;
- try {
- tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(getWorkingCopy(), getLaunchConfigurationDialog().getMode());
- finalArray[0] = tabGroup;
- } catch (CoreException ce) {
- finalArray[1] = ce;
- return;
- }
- tabGroup.createTabs(getLaunchConfigurationDialog(), getLaunchConfigurationDialog().getMode());
- ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(getLaunchConfigurationDialog());
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ ILaunchConfigurationTabGroup tabGroup = null;
+ try {
+ tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(getWorkingCopy(), getLaunchConfigurationDialog().getMode());
+ finalArray[0] = tabGroup;
+ } catch (CoreException ce) {
+ finalArray[1] = ce;
+ return;
+ }
+ tabGroup.createTabs(getLaunchConfigurationDialog(), getLaunchConfigurationDialog().getMode());
+ ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
+ for (int i = 0; i < tabs.length; i++) {
+ tabs[i].setLaunchConfigurationDialog(getLaunchConfigurationDialog());
+ }
}
};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
index 4fed3cb6b..808033ff1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
@@ -268,11 +268,14 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
final ILaunchConfiguration from = getLaunchManager().getMovedFrom(configuration);
// handle asynchronously: @see bug 198428 - Deadlock deleting launch configuration
Display display = DebugUIPlugin.getStandardDisplay();
- display.asyncExec(() -> {
- if (!fTree.isDisposed()) {
- handleConfigurationAdded(configuration, from);
- }
- });
+ display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if(!fTree.isDisposed()) {
+ handleConfigurationAdded(configuration, from);
+ }
+ }
+ });
}
}
@@ -362,10 +365,13 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
}
// handle asynchronously: @see bug 198428 - Deadlock deleting launch configuration
Display display = DebugUIPlugin.getStandardDisplay();
- display.asyncExec(() -> {
- if (!fTree.isDisposed()) {
- handleConfigurationRemoved(configuration);
- }
+ display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if(!fTree.isDisposed()) {
+ handleConfigurationRemoved(configuration);
+ }
+ }
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
index ff5253d34..a8dc148c1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
@@ -39,10 +39,13 @@ public class LaunchDelegateNotAvailableHandler implements IStatusHandler {
final ILaunchConfiguration config = (ILaunchConfiguration) infos[0];
final String mode = (String) infos[1];
final Shell shell = DebugUIPlugin.getShell();
- Runnable runnable = () -> {
- ILaunchGroup group = DebugUITools.getLaunchGroup(config, mode);
- if (group != null) {
- DebugUITools.openLaunchConfigurationDialog(shell, config, group.getIdentifier(), null);
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ ILaunchGroup group = DebugUITools.getLaunchGroup(config, mode);
+ if (group != null) {
+ DebugUITools.openLaunchConfigurationDialog(shell, config, group.getIdentifier(), null);
+ }
}
};
DebugUIPlugin.getStandardDisplay().asyncExec(runnable);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index fd281d86d..cf6b28eca 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -219,25 +219,31 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
if (asyncDisplay == null || asyncDisplay.isDisposed()) {
return Status.CANCEL_STATUS;
}
- asyncDisplay.asyncExec(() -> {
- IStatus result = null;
- Throwable throwable = null;
- try {
- if (monitor.isCanceled()) {
- result = Status.CANCEL_STATUS;
- } else {
- result = runInUIThread(monitor);
- }
-
- } catch (Throwable t) {
- throwable = t;
- } finally {
- if (result == null) {
- result = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, LaunchConfigurationsMessages.PerspectiveManager_Error_1, throwable);
- }
- done(result);
- }
- });
+ asyncDisplay.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ IStatus result = null;
+ Throwable throwable = null;
+ try {
+ if (monitor.isCanceled()) {
+ result = Status.CANCEL_STATUS;
+ } else {
+ result = runInUIThread(monitor);
+ }
+
+ } catch(Throwable t){
+ throwable = t;
+ } finally {
+ if (result == null) {
+ result = new Status(IStatus.ERROR,
+ PlatformUI.PLUGIN_ID, IStatus.ERROR,
+ LaunchConfigurationsMessages.PerspectiveManager_Error_1,
+ throwable);
+ }
+ done(result);
+ }
+ }
+ });
return Job.ASYNC_FINISH;
}
@@ -300,17 +306,20 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*/
@Override
public synchronized void launchRemoved(final ILaunch launch) {
- ISuspendTrigger trigger = launch.getAdapter(ISuspendTrigger.class);
- if (trigger != null) {
- trigger.removeSuspendTriggerListener(this);
- }
- Runnable r = () -> {
- IContextActivation[] activations = fLaunchToContextActivations.remove(launch);
- if (activations != null) {
- for (int i = 0; i < activations.length; i++) {
- IContextActivation activation = activations[i];
- activation.getContextService().deactivateContext(activation);
- }
+ ISuspendTrigger trigger = launch.getAdapter(ISuspendTrigger.class);
+ if (trigger != null) {
+ trigger.removeSuspendTriggerListener(this);
+ }
+ Runnable r= new Runnable() {
+ @Override
+ public void run() {
+ IContextActivation[] activations = fLaunchToContextActivations.remove(launch);
+ if (activations != null) {
+ for (int i = 0; i < activations.length; i++) {
+ IContextActivation activation = activations[i];
+ activation.getContextService().deactivateContext(activation);
+ }
+ }
}
};
async(r);
@@ -420,9 +429,13 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* failure is associated with
*/
protected void switchFailed(final Throwable t, final String launchName) {
- sync(() -> DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.PerspectiveManager_Error_1,
+ sync(new Runnable() {
+ @Override
+ public void run() {
+ DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.PerspectiveManager_Error_1,
MessageFormat.format(LaunchConfigurationsMessages.PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4, new Object[] { launchName }),
- t));
+ t);
+ }});
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index 8587279b9..b7bb3427e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
@@ -22,12 +22,14 @@ import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
+
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockExtension;
@@ -63,6 +65,7 @@ import org.eclipse.debug.internal.ui.views.memory.renderings.ReformatAction;
import org.eclipse.debug.internal.ui.views.memory.renderings.ResetToBaseAddressAction;
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLine;
+
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.memory.AbstractTableRendering;
@@ -74,6 +77,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
import org.eclipse.debug.ui.memory.IMemoryRenderingType;
import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
import org.eclipse.debug.ui.memory.MemoryRenderingElement;
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -83,8 +87,10 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
+
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.TextViewer;
+
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.CellEditor;
@@ -98,6 +104,7 @@ import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TextCellEditor;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.StyledText;
@@ -129,6 +136,7 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
+
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
@@ -1143,12 +1151,15 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
private void topVisibleAddressChanged(final BigInteger address) {
- final Runnable runnable = () -> {
- if (fTableViewer.getTable().isDisposed()) {
- return;
- }
+ final Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (fTableViewer.getTable().isDisposed()) {
+ return;
+ }
- doTopVisibleAddressChanged(address);
+ doTopVisibleAddressChanged(address);
+ }
};
runOnUIThread(runnable);
}
@@ -1219,23 +1230,27 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
private void selectedAddressChanged(final BigInteger address) {
- Runnable runnable = () -> {
+ Runnable runnable = new Runnable() {
- if (fTableViewer.getTable().isDisposed()) {
- return;
- }
+ @Override
+ public void run() {
+
+ if (fTableViewer.getTable().isDisposed()) {
+ return;
+ }
- // call this to make the table viewer to reload when needed
- int i = fTableViewer.indexOf(address);
- if (i < 0) {
- // the model may not have been populated yet,
- // try to predict if the address will be in the buffer
- boolean contained = isAddressBufferred(address);
- if (!contained) {
- topVisibleAddressChanged(address);
+ // call this to make the table viewer to reload when needed
+ int i = fTableViewer.indexOf(address);
+ if (i < 0) {
+ // the model may not have been populated yet,
+ // try to predict if the address will be in the buffer
+ boolean contained = isAddressBufferred(address);
+ if (!contained) {
+ topVisibleAddressChanged(address);
+ }
}
+ fTableViewer.setSelection(address);
}
- fTableViewer.setSelection(address);
};
runOnUIThread(runnable);
@@ -2135,23 +2150,26 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
}
- Runnable runnable = () -> {
- showTable();
- if (keyIndex >= 0) {
- // address is within range, set cursor and reveal
- fTableViewer.setSelection(address);
- updateSyncTopAddress(getTopVisibleAddress());
- updateSyncSelectedAddress(address);
- } else {
- // load at the address
- fTableViewer.setSelection(address);
- reloadTable(address);
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ showTable();
+ if (keyIndex >= 0) {
+ // address is within range, set cursor and reveal
+ fTableViewer.setSelection(address);
+ updateSyncTopAddress(getTopVisibleAddress());
+ updateSyncSelectedAddress(address);
+ } else {
+ // load at the address
+ fTableViewer.setSelection(address);
+ reloadTable(address);
- updateSyncSelectedAddress(address);
- if (!isDynamicLoad()) {
- updateSyncPageStartAddress(address);
+ updateSyncSelectedAddress(address);
+ if (!isDynamicLoad()) {
+ updateSyncPageStartAddress(address);
+ }
+ updateSyncTopAddress(address);
}
- updateSyncTopAddress(address);
}
};
runOnUIThread(runnable);
@@ -2384,13 +2402,16 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fContentDescriptor.setLoadAddress(address);
final BigInteger finaladdress = address;
- Runnable runnable = () -> {
- if (fTableViewer.getTable().isDisposed()) {
- return;
- }
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (fTableViewer.getTable().isDisposed()) {
+ return;
+ }
- fTableViewer.setTopIndex(finaladdress);
- refresh();
+ fTableViewer.setTopIndex(finaladdress);
+ refresh();
+ }
};
runOnUIThread(runnable);
@@ -2545,13 +2566,16 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return;
}
- Display.getDefault().asyncExec(() -> {
- int rowSize = getBytesPerLine();
- if (rowSize < newColumnSize) {
- rowSize = newColumnSize;
- }
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ int rowSize = getBytesPerLine();
+ if (rowSize < newColumnSize) {
+ rowSize = newColumnSize;
+ }
- format(rowSize, newColumnSize);
+ format(rowSize, newColumnSize);
+ }
});
}
@@ -2564,13 +2588,16 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return;
}
- Display.getDefault().asyncExec(() -> {
- int colSize = getBytesPerColumn();
- if (newRowSize < colSize) {
- colSize = newRowSize;
- }
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ int colSize = getBytesPerColumn();
+ if (newRowSize < colSize) {
+ colSize = newRowSize;
+ }
- format(newRowSize, colSize);
+ format(newRowSize, colSize);
+ }
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
index a08b52ab4..c2aad191b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
@@ -65,14 +65,17 @@ public class Prompter implements IStatusHandler {
final Object[] result = new Object[1];
final CoreException[] exception = new CoreException[1];
final Object lock = this;
- Runnable r = () -> {
- try {
- result[0] = handler.handleStatus(status, source);
- } catch (CoreException e) {
- exception[0] = e;
- }
- synchronized (lock) {
- lock.notifyAll();
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ result[0] = handler.handleStatus(status, source);
+ } catch (CoreException e) {
+ exception[0] = e;
+ }
+ synchronized (lock) {
+ lock.notifyAll();
+ }
}
};
DebugUIPlugin.getStandardDisplay().syncExec(r);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
index fb4128dd2..20ed4bbf0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
@@ -551,12 +551,18 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
*/
private IEditorPart openEditor(final IWorkbenchPage page, final IEditorInput input, final String id) {
final IEditorPart[] editor = new IEditorPart[] {null};
- Runnable r = () -> {
- if (!page.getWorkbenchWindow().getWorkbench().isClosing()) {
- try {
- editor[0] = page.openEditor(input, id, false, IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT);
- } catch (PartInitException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIViewsMessages.LaunchView_Error_1, DebugUIViewsMessages.LaunchView_Exception_occurred_opening_editor_for_debugger__2, e);
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ if (!page.getWorkbenchWindow().getWorkbench().isClosing()) {
+ try {
+ editor[0] = page.openEditor(input, id, false, IWorkbenchPage.MATCH_ID|IWorkbenchPage.MATCH_INPUT);
+ } catch (PartInitException e) {
+ DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(),
+ DebugUIViewsMessages.LaunchView_Error_1,
+ DebugUIViewsMessages.LaunchView_Exception_occurred_opening_editor_for_debugger__2,
+ e);
+ }
}
}
};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
index 32256bde6..e851b1ee9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
@@ -63,9 +63,12 @@ public class ArchiveFilter extends ViewerFilter {
* Search for all archives in the workspace.
*/
private void init() {
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), () -> {
- fArchives = new HashSet<IResource>();
- traverse(ResourcesPlugin.getWorkspace().getRoot(), fArchives);
+ BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ fArchives = new HashSet<IResource>();
+ traverse(ResourcesPlugin.getWorkspace().getRoot(), fArchives);
+ }
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
index b851fea18..67c97cca6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
@@ -94,7 +94,12 @@ abstract class PromptingResolver implements IDynamicVariableResolver {
String value = null;
setupDialog(argument);
- DebugUIPlugin.getStandardDisplay().syncExec(() -> prompt());
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ prompt();
+ }
+ });
if (dialogResultString != null) {
value = dialogResultString;
lastValue = dialogResultString;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
index 90f3c9814..e5a4c2449 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
@@ -71,7 +71,12 @@ public class SelectedResourceManager {
}
else {
final IStructuredSelection[] selection = new IStructuredSelection[1];
- DebugUIPlugin.getStandardDisplay().syncExec(() -> selection[0] = getCurrentSelection0());
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ selection[0] = getCurrentSelection0();
+ }
+ });
return selection[0];
}
}
@@ -121,7 +126,12 @@ public class SelectedResourceManager {
}
else {
final IResource[] resource = new IResource[1];
- DebugUIPlugin.getStandardDisplay().syncExec(() -> resource[0] = getSelectedResource0());
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ resource[0] = getSelectedResource0();
+ }
+ });
return resource[0];
}
}
@@ -179,7 +189,12 @@ public class SelectedResourceManager {
}
else {
final String[] text = new String[1];
- DebugUIPlugin.getStandardDisplay().syncExec(() -> text[0] = getSelectedText0());
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ text[0] = getSelectedText0();
+ }
+ });
return text[0];
}
}
@@ -226,7 +241,12 @@ public class SelectedResourceManager {
}
else {
final IWorkbenchWindow[] window = new IWorkbenchWindow[1];
- DebugUIPlugin.getStandardDisplay().syncExec(() -> window[0] = DebugUIPlugin.getActiveWorkbenchWindow());
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ window[0] = DebugUIPlugin.getActiveWorkbenchWindow();
+ }
+ });
return window[0];
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
index 0c8377d71..2920ebf81 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
@@ -608,14 +608,17 @@ public abstract class AsynchronousModel {
//update viewer outside the lock
final ModelNode[] finalUnmap = unmap;
- preservingSelection(() -> {
- if (finalUnmap != null) {
- for (int i = 0; i < finalUnmap.length; i++) {
- viewer.unmapNode(finalUnmap[i]);
- }
- }
- viewer.nodeChildrenChanged(parentNode);
- });
+ preservingSelection(new Runnable() {
+ @Override
+ public void run() {
+ if (finalUnmap != null) {
+ for (int i = 0; i < finalUnmap.length; i++) {
+ viewer.unmapNode(finalUnmap[i]);
+ }
+ }
+ viewer.nodeChildrenChanged(parentNode);
+ }
+ });
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
index ea979e5ee..fb83b9a8f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
@@ -266,7 +266,12 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
disableRedraw();
try {
- preservingSelection(() -> buildItemChain(input));
+ preservingSelection(new Runnable() {
+ @Override
+ public void run() {
+ buildItemChain(input);
+ }
+ });
} finally {
enableRedraw();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
index 4f209f9fe..84f75aff8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
@@ -78,43 +78,50 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
@Override
protected synchronized void scheduleViewerUpdate() {
- // If filtering is enabled perform child update on all children in order
- // to update
- // viewer filters.
+ // If filtering is enabled perform child update on all children in order to update
+ // viewer filters.
if (fShouldFilter || fFilteredChildren != null) {
- if (fChildrenUpdate == null) {
- int startIdx;
- int count;
- if (fShouldFilter) {
- startIdx = 0;
- count = getCount();
- } else {
- startIdx = fFilteredChildren[0];
- int endIdx = fFilteredChildren[fFilteredChildren.length - 1];
- count = endIdx - startIdx + 1;
- }
+ if (fChildrenUpdate == null) {
+ int startIdx;
+ int count;
+ if (fShouldFilter) {
+ startIdx = 0;
+ count = getCount();
+ } else {
+ startIdx = fFilteredChildren[0];
+ int endIdx = fFilteredChildren[fFilteredChildren.length - 1];
+ count = endIdx - startIdx + 1;
+ }
- fChildrenUpdate = new ChildrenUpdate(getContentProvider(), getViewerInput(), getElementPath(), getElement(), startIdx, count, getElementContentProvider()) {
- @Override
+ fChildrenUpdate = new ChildrenUpdate(getContentProvider(), getViewerInput(), getElementPath(), getElement(), startIdx, count, getElementContentProvider()) {
+ @Override
protected void performUpdate() {
- performUpdate(true);
- ChildrenCountUpdate.super.scheduleViewerUpdate();
- }
+ performUpdate(true);
+ ChildrenCountUpdate.super.scheduleViewerUpdate();
+ }
- @Override
+ @Override
protected void scheduleViewerUpdate() {
- execInDisplayThread(() -> {
- if (!getContentProvider().isDisposed() && !isCanceled()) {
- performUpdate();
- }
- });
- }
- };
- execInDisplayThread(() -> fChildrenUpdate.startRequest());
- return;
- }
+ execInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (!getContentProvider().isDisposed() && !isCanceled()) {
+ performUpdate();
+ }
+ }
+ });
+ }
+ };
+ execInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ fChildrenUpdate.startRequest();
+ }
+ });
+ return;
+ }
} else {
- super.scheduleViewerUpdate();
+ super.scheduleViewerUpdate();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
index 668284e64..433b8d38f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
@@ -65,26 +65,24 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
fEqual = equal;
}
- /*
- * (non-Javadoc)
+ /* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
@Override
public void done() {
- ITreeModelViewer viewer = getContentProvider().getViewer();
- if (viewer == null) {
- return; // disposed
- }
- if (viewer.getDisplay().getThread() == Thread.currentThread()) {
- fProvider.getStateTracker().compareFinished(ElementCompareRequest.this, fDelta);
- } else {
- viewer.getDisplay().asyncExec(() -> {
- if (getContentProvider().isDisposed()) {
- return;
- }
- fProvider.getStateTracker().compareFinished(ElementCompareRequest.this, fDelta);
- });
- }
+ ITreeModelViewer viewer = getContentProvider().getViewer();
+ if (viewer == null) return; // disposed
+ if (viewer.getDisplay().getThread() == Thread.currentThread()) {
+ fProvider.getStateTracker().compareFinished(ElementCompareRequest.this, fDelta);
+ } else {
+ viewer.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (getContentProvider().isDisposed()) return;
+ fProvider.getStateTracker().compareFinished(ElementCompareRequest.this, fDelta);
+ }
+ });
+ }
}
public boolean isEqual() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
index 2c54dc77f..6e53cf171 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
@@ -47,21 +47,24 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ
*/
@Override
public void done() {
+
ITreeModelViewer viewer = getContentProvider().getViewer();
- if (viewer == null) {
- return; // disposed
- }
+ if (viewer == null) return; // disposed
if (viewer.getDisplay().getThread() == Thread.currentThread()) {
- doComplete();
+ doComplete();
} else {
- viewer.getDisplay().asyncExec(() -> doComplete());
+ viewer.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ doComplete();
+ }
+ });
}
+
}
private void doComplete() {
- if (getContentProvider().isDisposed()) {
- return;
- }
+ if (getContentProvider().isDisposed()) return;
if (!isCanceled() && (getStatus() == null || getStatus().isOK())) {
// replace the element with a memento
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
index 02a8f502e..fafeebd65 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
@@ -306,49 +306,53 @@ public class InternalVirtualTreeModelViewer extends Viewer
@Override
public void remove(final Object parentOrTreePath, final int index) {
final List<TreePath> oldSelection = new LinkedList<TreePath>(Arrays.asList(((TreeSelection) getSelection()).getPaths()));
- preservingSelection(() -> {
- TreePath removedPath = null;
- VirtualItem[] parentItems = findItems(parentOrTreePath);
- for (int i = 0; i < parentItems.length; i++) {
- VirtualItem parentItem = parentItems[i];
- if (parentItem.isDisposed()) {
- continue;
- }
-
- // Parent item is not expanded so just update its contents so
- // that
- // the plus sign gets refreshed.
- if (!parentItem.getExpanded()) {
- parentItem.setNeedsCountUpdate();
- parentItem.setItemCount(-1);
- virtualLazyUpdateHasChildren(parentItem);
- }
-
- if (index < parentItem.getItemCount()) {
- VirtualItem item = parentItem.getItem(new VirtualItem.Index(index));
-
- if (item.getData() != null) {
- removedPath = getTreePathFromItem(item);
- disassociate(item);
+ preservingSelection(new Runnable() {
+ @Override
+ public void run() {
+ TreePath removedPath = null;
+ VirtualItem[] parentItems = findItems(parentOrTreePath);
+ for (int i = 0; i < parentItems.length; i++) {
+ VirtualItem parentItem = parentItems[i];
+ if (parentItem.isDisposed()) {
+ continue;
}
- parentItem.remove(item.getIndex());
- }
- }
-
- if (removedPath != null) {
- boolean removed = false;
- for (Iterator<TreePath> it = oldSelection.iterator(); it.hasNext();) {
- TreePath path = it.next();
- if (path.startsWith(removedPath, null)) {
- it.remove();
- removed = true;
- }
- }
- if (removed) {
- setSelection(new TreeSelection(oldSelection.toArray(new TreePath[oldSelection.size()])), false);
- }
- }
- });
+
+ // Parent item is not expanded so just update its contents so that
+ // the plus sign gets refreshed.
+ if (!parentItem.getExpanded()) {
+ parentItem.setNeedsCountUpdate();
+ parentItem.setItemCount(-1);
+ virtualLazyUpdateHasChildren(parentItem);
+ }
+
+ if (index < parentItem.getItemCount()) {
+ VirtualItem item =parentItem.getItem(new VirtualItem.Index(index));
+
+ if (item.getData() != null) {
+ removedPath = getTreePathFromItem(item);
+ disassociate(item);
+ }
+ parentItem.remove(item.getIndex());
+ }
+ }
+
+ if (removedPath != null) {
+ boolean removed = false;
+ for (Iterator<TreePath> it = oldSelection.iterator(); it.hasNext();) {
+ TreePath path = it.next();
+ if (path.startsWith(removedPath, null)) {
+ it.remove();
+ removed = true;
+ }
+ }
+ if (removed) {
+ setSelection(
+ new TreeSelection(oldSelection.toArray(new TreePath[oldSelection.size()])),
+ false);
+ }
+ }
+ }
+ });
}
@Override
@@ -545,17 +549,20 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- private void validate() {
- if (fValidateRunnable == null) {
- fValidateRunnable = () -> {
- if (!fTree.isDisposed()) {
- fValidateRunnable = null;
- fTree.validate();
- }
- };
- getDisplay().asyncExec(fValidateRunnable);
- }
- }
+ private void validate() {
+ if (fValidateRunnable == null) {
+ fValidateRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (!fTree.isDisposed()) {
+ fValidateRunnable = null;
+ fTree.validate();
+ }
+ }
+ };
+ getDisplay().asyncExec(fValidateRunnable);
+ }
+ }
@Override
protected void inputChanged(Object input, Object oldInput) {
@@ -621,51 +628,57 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- @Override
+ @Override
public void setChildCount(final Object elementOrTreePath, final int count) {
- preservingSelection(() -> {
- VirtualItem[] items = findItems(elementOrTreePath);
- for (int i = 0; i < items.length; i++) {
- VirtualItem[] children = items[i].getItems();
- for (int j = 0; j < children.length; j++) {
- if (children[j].getData() != null && children[j].getIndex().intValue() >= count) {
- disassociate(children[j]);
- }
- }
+ preservingSelection(new Runnable() {
+ @Override
+ public void run() {
+ VirtualItem[] items = findItems(elementOrTreePath);
+ for (int i = 0; i < items.length; i++) {
+ VirtualItem[] children = items[i].getItems();
+ for (int j = 0; j < children.length; j++) {
+ if (children[j].getData() != null && children[j].getIndex().intValue() >= count) {
+ disassociate(children[j]);
+ }
+ }
- items[i].setItemCount(count);
- }
- });
- validate();
- }
+ items[i].setItemCount(count);
+ }
+ }
+ });
+ validate();
+ }
- @Override
+ @Override
public void setHasChildren(final Object elementOrTreePath, final boolean hasChildren) {
- preservingSelection(() -> {
- VirtualItem[] items = findItems(elementOrTreePath);
- for (int i = 0; i < items.length; i++) {
- VirtualItem item = items[i];
-
- if (!hasChildren) {
- VirtualItem[] children = item.getItems();
- for (int j = 0; j < children.length; j++) {
- if (children[j].getData() != null) {
- disassociate(children[j]);
- }
- }
- }
-
- item.setHasItems(hasChildren);
- if (hasChildren) {
- if (!item.getExpanded()) {
- item.setItemCount(-1);
- } else {
- virtualLazyUpdateChildCount(item);
- }
- }
- }
- });
- }
+ preservingSelection(new Runnable() {
+ @Override
+ public void run() {
+ VirtualItem[] items = findItems(elementOrTreePath);
+ for (int i = 0; i < items.length; i++) {
+ VirtualItem item = items[i];
+
+ if (!hasChildren) {
+ VirtualItem[] children = item.getItems();
+ for (int j = 0; j < children.length; j++) {
+ if (children[j].getData() != null) {
+ disassociate(children[j]);
+ }
+ }
+ }
+
+ item.setHasItems(hasChildren);
+ if (hasChildren) {
+ if (!item.getExpanded()) {
+ item.setItemCount(-1);
+ } else {
+ virtualLazyUpdateChildCount(item);
+ }
+ }
+ }
+ }
+ });
+ }
@Override
public boolean getHasChildren(Object elementOrTreePath) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
index e264a72dd..128101422 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
@@ -196,35 +196,40 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
return wrapperedMonitor;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.operations.IRunnableContext#run(boolean, boolean,
- * IRunnableWithProgress)
- */
- @Override
- public void run(final boolean fork, final boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
- final InvocationTargetException[] invokes = new InvocationTargetException[1];
- final InterruptedException[] interrupt = new InterruptedException[1];
- Runnable dialogWaitRunnable = () -> {
- try {
- TimeTriggeredProgressMonitorDialog.super.run(fork, cancelable, runnable);
- } catch (InvocationTargetException e1) {
- invokes[0] = e1;
- } catch (InterruptedException e2) {
- interrupt[0] = e2;
- }
- };
- final Display display = PlatformUI.getWorkbench().getDisplay();
- if (display == null) {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.operations.IRunnableContext#run(boolean, boolean, IRunnableWithProgress)
+ */
+ @Override
+ public void run(final boolean fork, final boolean cancelable,
+ final IRunnableWithProgress runnable) throws InvocationTargetException,
+ InterruptedException {
+ final InvocationTargetException[] invokes = new InvocationTargetException[1];
+ final InterruptedException[] interrupt = new InterruptedException[1];
+ Runnable dialogWaitRunnable = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ TimeTriggeredProgressMonitorDialog.super.run(fork, cancelable, runnable);
+ } catch (InvocationTargetException e) {
+ invokes[0] = e;
+ } catch (InterruptedException e) {
+ interrupt[0]= e;
+ }
+ }
+ };
+ final Display display = PlatformUI.getWorkbench().getDisplay();
+ if (display == null) {
return;
}
- // show a busy cursor until the dialog opens
- BusyIndicator.showWhile(display, dialogWaitRunnable);
- if (invokes[0] != null) {
- throw invokes[0];
- }
- if (interrupt[0] != null) {
- throw interrupt[0];
- }
- }
+ //show a busy cursor until the dialog opens
+ BusyIndicator.showWhile(display, dialogWaitRunnable);
+ if (invokes[0] != null) {
+ throw invokes[0];
+ }
+ if (interrupt[0] != null) {
+ throw interrupt[0];
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index ad7be8233..9afa548cf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -724,76 +724,73 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
notifyUpdate(UPDATE_BEGINS, update);
}
- /**
- * Notification an update request has completed
- *
- * @param updates the updates to notify
- */
+ /**
+ * Notification an update request has completed
+ *
+ * @param updates the updates to notify
+ */
void updatesComplete(final List<ViewerUpdateMonitor> updates) {
- for (int i = 0; i < updates.size(); i++) {
- ViewerUpdateMonitor update = updates.get(i);
- notifyUpdate(UPDATE_COMPLETE, update);
- if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
- DebugUIPlugin.trace("\tEND - " + update); //$NON-NLS-1$
- }
- }
-
- // Wait a single cycle to allow viewer to queue requests triggered by
- // completed updates.
- getViewer().getDisplay().asyncExec(() -> {
- if (isDisposed()) {
- return;
- }
+ for (int i = 0; i < updates.size(); i++) {
+ ViewerUpdateMonitor update = updates.get(i);
+ notifyUpdate(UPDATE_COMPLETE, update);
+ if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
+ DebugUIPlugin.trace("\tEND - " + update); //$NON-NLS-1$
+ }
+ }
- for (int i = 0; i < updates.size(); i++) {
- ViewerUpdateMonitor update = updates.get(i);
-
- // Search for update in list using identity test. Otherwise a
- // completed canceled
- // update may trigger removal of up-to-date running update on
- // the same element.
- List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(update.getSchedulingPath());
- boolean found = false;
- if (requests != null) {
- for (int j = 0; j < requests.size(); j++) {
- if (requests.get(j) == update) {
- found = true;
- requests.remove(j);
- break;
- }
- }
+ // Wait a single cycle to allow viewer to queue requests triggered by completed updates.
+ getViewer().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
}
- if (found) {
- // Trigger may initiate new updates, so wait to remove
- // requests array from
- // fRequestsInProgress map. This way updateStarted() will
- // not send a
- // redundant "UPDATE SEQUENCE STARTED" notification.
- trigger(update.getSchedulingPath());
- } else {
- // Update may be removed from in progress list if it was
- // canceled by schedule().
- Assert.isTrue(update.isCanceled());
- }
- if (requests != null && requests.isEmpty()) {
- fRequestsInProgress.remove(update.getSchedulingPath());
- }
- }
- if (fRequestsInProgress.isEmpty() && fWaitingRequests.isEmpty() && fModelSequenceRunning) {
- fModelSequenceRunning = false;
- if (fRevealPath != null) {
- getViewer().reveal(fRevealPath, fRevealIndex);
- fRevealPath = null;
- }
- if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
- DebugUIPlugin.trace("MODEL SEQUENCE ENDS"); //$NON-NLS-1$
- }
- notifyUpdate(UPDATE_SEQUENCE_COMPLETE, null);
- }
- });
+ for (int i = 0; i < updates.size(); i++) {
+ ViewerUpdateMonitor update = updates.get(i);
+
+ // Search for update in list using identity test. Otherwise a completed canceled
+ // update may trigger removal of up-to-date running update on the same element.
+ List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(update.getSchedulingPath());
+ boolean found = false;
+ if (requests != null) {
+ for (int j = 0; j < requests.size(); j++) {
+ if (requests.get(j) == update) {
+ found = true;
+ requests.remove(j);
+ break;
+ }
+ }
+ }
+
+ if (found) {
+ // Trigger may initiate new updates, so wait to remove requests array from
+ // fRequestsInProgress map. This way updateStarted() will not send a
+ // redundant "UPDATE SEQUENCE STARTED" notification.
+ trigger(update.getSchedulingPath());
+ } else {
+ // Update may be removed from in progress list if it was canceled by schedule().
+ Assert.isTrue( update.isCanceled() );
+ }
+ if (requests != null && requests.isEmpty()) {
+ fRequestsInProgress.remove(update.getSchedulingPath());
+ }
+ }
+ if (fRequestsInProgress.isEmpty() && fWaitingRequests.isEmpty() && fModelSequenceRunning) {
+ fModelSequenceRunning = false;
+ if (fRevealPath != null) {
+ getViewer().reveal(fRevealPath, fRevealIndex);
+ fRevealPath = null;
+ }
+ if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
+ DebugUIPlugin.trace("MODEL SEQUENCE ENDS"); //$NON-NLS-1$
+ }
+ notifyUpdate(UPDATE_SEQUENCE_COMPLETE, null);
+ }
+ }
+ });
- }
+ }
/**
* @return Returns true if there are outstanding updates in the viewer.
@@ -882,56 +879,53 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
fStateTracker.cancelStateSubtreeUpdates(path);
}
- /**
- * Returns whether this given request should be run, or should wait for
- * parent update to complete.
- *
- * @param update the update the schedule
- */
- private void schedule(final ViewerUpdateMonitor update) {
- Assert.isTrue(getViewer().getDisplay().getThread() == Thread.currentThread());
+ /**
+ * Returns whether this given request should be run, or should wait for
+ * parent update to complete.
+ *
+ * @param update the update the schedule
+ */
+ private void schedule(final ViewerUpdateMonitor update) {
+ Assert.isTrue(getViewer().getDisplay().getThread() == Thread.currentThread());
- TreePath schedulingPath = update.getSchedulingPath();
+ TreePath schedulingPath = update.getSchedulingPath();
List<ViewerUpdateMonitor> requests = fWaitingRequests.get(schedulingPath);
- if (requests == null) {
+ if (requests == null) {
requests = new LinkedList<ViewerUpdateMonitor>();
- requests.add(update);
- fWaitingRequests.put(schedulingPath, requests);
+ requests.add(update);
+ fWaitingRequests.put(schedulingPath, requests);
List<ViewerUpdateMonitor> inProgressList = fRequestsInProgress.get(schedulingPath);
- if (inProgressList != null) {
- int staleUpdateIndex = inProgressList.indexOf(update);
- if (staleUpdateIndex >= 0) {
- // Cancel update and remove from requests list. Removing
- // from
- // fRequestsInProgress ensures that isRequestBlocked() won't
- // be triggered
- // by a canceled update.
- ViewerUpdateMonitor staleUpdate = inProgressList.remove(staleUpdateIndex);
- staleUpdate.cancel();
- // Note: Do not reset the inProgressList to null. This would
- // cause the
- // updateStarted() method to think that a new update
- // sequence is
- // being started. Since there are waiting requests for this
- // scheduling
- // path, the list will be cleaned up later.
- }
- }
- if (inProgressList == null || inProgressList.isEmpty()) {
- getViewer().getDisplay().asyncExec(() -> {
- if (isDisposed()) {
- return;
- }
- trigger(update.getSchedulingPath());
- });
- }
- } else {
- // there are waiting requests: coalesce with existing request and
- // add to list
- requests.add(coalesce(requests, update));
- }
- }
+ if (inProgressList != null) {
+ int staleUpdateIndex = inProgressList.indexOf(update);
+ if (staleUpdateIndex >= 0) {
+ // Cancel update and remove from requests list. Removing from
+ // fRequestsInProgress ensures that isRequestBlocked() won't be triggered
+ // by a canceled update.
+ ViewerUpdateMonitor staleUpdate = inProgressList.remove(staleUpdateIndex);
+ staleUpdate.cancel();
+ // Note: Do not reset the inProgressList to null. This would cause the
+ // updateStarted() method to think that a new update sequence is
+ // being started. Since there are waiting requests for this scheduling
+ // path, the list will be cleaned up later.
+ }
+ }
+ if (inProgressList == null || inProgressList.isEmpty()) {
+ getViewer().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
+ }
+ trigger(update.getSchedulingPath());
+ }
+ });
+ }
+ } else {
+ // there are waiting requests: coalesce with existing request and add to list
+ requests.add(coalesce(requests, update));
+ }
+ }
/**
* Tries to coalesce the given request with any request in the list. If a match is found,
@@ -1768,37 +1762,40 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
/**
- * Schedules given update to be performed on the viewer. Updates are queued
- * up if they are completed in the same UI cycle.
- *
+ * Schedules given update to be performed on the viewer.
+ * Updates are queued up if they are completed in the same
+ * UI cycle.
* @param update Update to perform.
*/
void scheduleViewerUpdate(ViewerUpdateMonitor update) {
- Display display;
- Runnable updateJob = null;
- synchronized (this) {
- if (isDisposed()) {
+ Display display;
+ Runnable updateJob = null;
+ synchronized(this) {
+ if (isDisposed()) {
return;
}
- display = getViewer().getDisplay();
- fCompletedUpdates.add(update);
- if (fCompletedUpdatesRunnable == null) {
- fCompletedUpdatesRunnable = () -> {
- if (!isDisposed()) {
- performUpdates();
- }
- };
- updateJob = fCompletedUpdatesRunnable;
- }
- }
+ display = getViewer().getDisplay();
+ fCompletedUpdates.add(update);
+ if (fCompletedUpdatesRunnable == null) {
+ fCompletedUpdatesRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (!isDisposed()) {
+ performUpdates();
+ }
+ }
+ };
+ updateJob = fCompletedUpdatesRunnable;
+ }
+ }
- if (updateJob != null) {
- if (Thread.currentThread() == display.getThread()) {
- performUpdates();
- } else {
- display.asyncExec(updateJob);
- }
- }
+ if (updateJob != null) {
+ if (Thread.currentThread() == display.getThread()) {
+ performUpdates();
+ } else {
+ display.asyncExec(updateJob);
+ }
+ }
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
index 2692ae93e..705b10734 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
@@ -100,17 +100,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
*/
private List<ILabelUpdate> fUpdatesInProgress = new ArrayList<ILabelUpdate>();
- private final class RunnableImplementation implements Runnable {
- @Override
- public void run() {
- if (isDisposed()) {
- return;
- }
- startRequests(this);
- }
- }
-
- /**
+ /**
* Delta visitor actively cancels the outstanding label updates for
* elements that are changed and are about to be updated.
*/
@@ -273,25 +263,33 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
@Override
public boolean update(TreePath elementPath) {
- Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
+ Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
- cancelPathUpdates(elementPath);
+ cancelPathUpdates(elementPath);
String[] visibleColumns = fViewer.getVisibleColumns();
Object element = elementPath.getLastSegment();
IElementLabelProvider presentation = ViewerAdapterService.getLabelProvider(element);
if (presentation != null) {
List<ILabelUpdate> updates = fPendingUpdates.get(presentation);
- if (updates == null) {
+ if (updates == null) {
updates = new LinkedList<ILabelUpdate>();
- fPendingUpdates.put(presentation, updates);
- }
- updates.add(new LabelUpdate(fViewer.getInput(), elementPath, this, visibleColumns, fViewer.getPresentationContext()));
- fPendingUpdatesRunnable = new RunnableImplementation();
- fViewer.getDisplay().asyncExec(fPendingUpdatesRunnable);
+ fPendingUpdates.put(presentation, updates);
+ }
+ updates.add(new LabelUpdate(fViewer.getInput(), elementPath, this, visibleColumns, fViewer.getPresentationContext()));
+ fPendingUpdatesRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
+ }
+ startRequests(this);
+ }
+ };
+ fViewer.getDisplay().asyncExec(fPendingUpdatesRunnable);
return true;
} else {
- return false;
+ return false;
}
}
@@ -389,38 +387,41 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
return fViewer.getPresentationContext();
}
- /**
- * A label update is complete.
- *
- * @param update Update that is to be completed.
- */
- synchronized void complete(ILabelUpdate update) {
- if (fViewer == null) {
+ /**
+ * A label update is complete.
+ *
+ * @param update Update that is to be completed.
+ */
+ synchronized void complete(ILabelUpdate update) {
+ if (fViewer == null) {
return;
}
if (fComplete == null) {
fComplete = new LinkedList<ILabelUpdate>();
- fViewer.getDisplay().asyncExec(() -> {
- if (isDisposed()) {
- return;
- }
- List<ILabelUpdate> updates = null;
- synchronized (TreeModelLabelProvider.this) {
- updates = fComplete;
- fComplete = null;
- }
- for (ILabelUpdate itrUpdate : updates) {
- if (itrUpdate.isCanceled()) {
- updateComplete(itrUpdate);
- } else {
- ((LabelUpdate) itrUpdate).performUpdate();
+ fViewer.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
}
- }
+ List<ILabelUpdate> updates = null;
+ synchronized (TreeModelLabelProvider.this) {
+ updates = fComplete;
+ fComplete = null;
+ }
+ for (ILabelUpdate itrUpdate : updates) {
+ if (itrUpdate.isCanceled()) {
+ updateComplete(itrUpdate);
+ } else {
+ ((LabelUpdate) itrUpdate).performUpdate();
+ }
+ }
+ }
});
}
fComplete.add(update);
- }
+ }
@Override
public void addLabelUpdateListener(ILabelUpdateListener listener) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
index e3ee51ae1..6368a43df 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
@@ -285,25 +285,28 @@ class ViewerStateTracker {
// Process start of restore in an async cycle because we may still be inside inputChanged()
// call. I.e. the "input.equals(fContentProvider.getViewer().getInput())" test may fail.
- fContentProvider.getViewer().getDisplay().asyncExec(() -> {
- if (!fContentProvider.isDisposed() && input.equals(fContentProvider.getViewer().getInput())) {
- ModelDelta stateDelta2 = fViewerStates.remove(keyMementoString);
- if (stateDelta2 != null) {
- if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
- DebugUIPlugin.trace("STATE RESTORE BEGINS"); //$NON-NLS-1$
- DebugUIPlugin.trace("\tRESTORE: " + stateDelta2.toString()); //$NON-NLS-1$
- notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
- }
- stateDelta2.setElement(input);
- fPendingState = stateDelta2;
- doInitialRestore(fPendingState);
- }
- } else {
- if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
- DebugUIPlugin.trace("STATE RESTORE CANCELED."); //$NON-NLS-1$
- }
- }
- });
+ fContentProvider.getViewer().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!fContentProvider.isDisposed() && input.equals(fContentProvider.getViewer().getInput())) {
+ ModelDelta stateDelta2 = fViewerStates.remove(keyMementoString);
+ if (stateDelta2 != null) {
+ if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
+ DebugUIPlugin.trace("STATE RESTORE BEGINS"); //$NON-NLS-1$
+ DebugUIPlugin.trace("\tRESTORE: " + stateDelta2.toString()); //$NON-NLS-1$
+ notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
+ }
+ stateDelta2.setElement(input);
+ fPendingState = stateDelta2;
+ doInitialRestore(fPendingState);
+ }
+ } else {
+ if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
+ DebugUIPlugin.trace("STATE RESTORE CANCELED."); //$NON-NLS-1$
+ }
+ }
+ }
+ });
} else {
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE INPUT COMARE ENDED : " + fRequest + " - NO MATCHING STATE"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
index 3d2ae3bf2..557eaeb62 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
@@ -526,10 +526,13 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
*/
@Override
public void breakpointManagerEnablementChanged(boolean enabled) {
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> {
- IAction action = getAction(ACTION_SKIP_BREAKPOINTS);
- if (action != null) {
- ((SkipAllBreakpointsAction) action).updateActionCheckedState();
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ IAction action = getAction(ACTION_SKIP_BREAKPOINTS);
+ if (action != null) {
+ ((SkipAllBreakpointsAction) action).updateActionCheckedState();
+ }
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
index 4183b3aad..7bbddae01 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
@@ -456,10 +456,13 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
setWaterMarks(lowWater, highWater);
}
- DebugUIPlugin.getStandardDisplay().asyncExec(() -> {
- setFont(JFaceResources.getFont(IDebugUIConstants.PREF_CONSOLE_FONT));
- setBackground(DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR));
- });
+ DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ setFont(JFaceResources.getFont(IDebugUIConstants.PREF_CONSOLE_FONT));
+ setBackground(DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR));
+ }
+ });
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
index 5b60386b8..9f85f919a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
@@ -14,6 +14,7 @@ import java.io.IOException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
+
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
@@ -24,14 +25,17 @@ import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.debug.core.model.IStreamsProxy2;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
+
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
+
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
@@ -214,26 +218,27 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
return new String[] {IDebugUIConstants.ID_DEBUG_VIEW};
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.
- * eclipse.debug.core.DebugEvent[])
- */
- @Override
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
+ */
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource().equals(getProcess())) {
- Runnable r = () -> {
- if (fTerminate != null) {
- fTerminate.update();
- }
- };
+ for (int i = 0; i < events.length; i++) {
+ DebugEvent event = events[i];
+ if (event.getSource().equals(getProcess())) {
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ if (fTerminate != null) {
+ fTerminate.update();
+ }
+ }
+ };
- DebugUIPlugin.getStandardDisplay().asyncExec(r);
- }
- }
- }
+ DebugUIPlugin.getStandardDisplay().asyncExec(r);
+ }
+ }
+ }
protected IProcess getProcess() {
return fConsole != null ? fConsole.getProcess() : null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
index fb69cda96..53e2351af 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
@@ -269,19 +269,22 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
// tab folders should be removed from our map.
final IMemoryBlockRetrieval ret = (IMemoryBlockRetrieval) source;
if (ret != null) {
- Display.getDefault().asyncExec(() -> {
- if (isDisposed()) {
- return;
- }
-
- Integer key = MemoryViewUtil.getHashCode(ret);
- Object folder = fTabFolderForDebugView.get(key);
-
- if (folder != null && folder != fEmptyTabFolder) {
- // remove the tab folder , and all contained tab
- // items
- disposeOfFolder((CTabFolder) folder);
- fTabFolderForDebugView.remove(key);
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
+ }
+
+ Integer key = MemoryViewUtil.getHashCode(ret);
+ Object folder = fTabFolderForDebugView.get(key);
+
+ if (folder != null && folder != fEmptyTabFolder) {
+ // remove the tab folder , and all contained tab
+ // items
+ disposeOfFolder((CTabFolder) folder);
+ fTabFolderForDebugView.remove(key);
+ }
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
index 5aa2ae025..88e58f65f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
@@ -48,9 +48,12 @@ public class MemoryViewPrefAction implements IViewActionDelegate {
final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), prefManager);
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), () -> {
- dialog.create();
- dialog.open();
+ BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ dialog.create();
+ dialog.open();
+ }
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
index 892f003e1..d4e94933c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
@@ -229,30 +229,33 @@ public class MemoryViewSynchronizationService implements IMemoryRenderingSynchro
// Make sure the synchronizer does not swallow any events
// Values of the properties are updated in the syncrhonizer immediately.
// Change events are queued up on the UI Thread.
- Display.getDefault().syncExec(() -> {
- if (fSynchronizeInfo == null) {
- return;
- }
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (fSynchronizeInfo == null) {
+ return;
+ }
- IMemoryRendering rendering = (IMemoryRendering) evt.getSource();
- String propertyId = evt.getProperty();
+ IMemoryRendering rendering = (IMemoryRendering) evt.getSource();
+ String propertyId = evt.getProperty();
- SynchronizeInfo info = fSynchronizeInfo.get(rendering.getMemoryBlock());
- if (info != null) {
- Object value = info.getProperty(propertyId);
- if (value != null) {
- Enumeration<PropertyListener> enumeration = fPropertyListeners.elements();
+ SynchronizeInfo info = fSynchronizeInfo.get(rendering.getMemoryBlock());
+ if (info != null) {
+ Object value = info.getProperty(propertyId);
+ if (value != null) {
+ Enumeration<PropertyListener> enumeration = fPropertyListeners.elements();
- while (enumeration.hasMoreElements()) {
- PropertyListener listener = enumeration.nextElement();
+ while (enumeration.hasMoreElements()) {
+ PropertyListener listener = enumeration.nextElement();
- IPropertyChangeListener origListener = listener.getListener();
+ IPropertyChangeListener origListener = listener.getListener();
- // if it's a valid property - valid means that it's
- // listed in the property filters
- if (listener.isValidProperty(propertyId)) {
- PropertyChangeNotifier notifier = new PropertyChangeNotifier(origListener, evt);
- SafeRunner.run(notifier);
+ // if it's a valid property - valid means that it's
+ // listed in the property filters
+ if (listener.isValidProperty(propertyId)) {
+ PropertyChangeNotifier notifier = new PropertyChangeNotifier(origListener, evt);
+ SafeRunner.run(notifier);
+ }
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
index 9a87113c9..310738b83 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
@@ -120,25 +120,28 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
*/
@Override
public void memoryBlocksAdded(final IMemoryBlock[] memoryBlocks) {
- Display.getDefault().asyncExec(() -> {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
- if (isDisposed()) {
- return;
- }
+ if (isDisposed()) {
+ return;
+ }
- // check condition before doing anything
- if (memoryBlocks == null || memoryBlocks.length <= 0) {
- return;
- }
+ // check condition before doing anything
+ if (memoryBlocks == null || memoryBlocks.length <= 0) {
+ return;
+ }
- for (int i = 0; i < memoryBlocks.length; i++) {
- IMemoryBlock memory = memoryBlocks[i];
+ for (int i = 0; i < memoryBlocks.length; i++) {
+ IMemoryBlock memory = memoryBlocks[i];
- if (!fTabFolderForMemoryBlock.containsKey(memory)) {
- createFolderForMemoryBlock(memory);
+ if (!fTabFolderForMemoryBlock.containsKey(memory)) {
+ createFolderForMemoryBlock(memory);
+ }
+ fAddedMemoryBlocks.add(memory);
+ updateToolBarActionsEnablement();
}
- fAddedMemoryBlocks.add(memory);
- updateToolBarActionsEnablement();
}
});
}
@@ -150,88 +153,91 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
*/
@Override
public void memoryBlocksRemoved(final IMemoryBlock[] memoryBlocks) {
- Display.getDefault().asyncExec(() -> {
- for (int j = 0; j < memoryBlocks.length; j++) {
- IMemoryBlock mbRemoved = memoryBlocks[j];
- if (fTabFolderForMemoryBlock == null) {
- return;
- }
-
- // get all renderings from this memory block and remove them
- // from the view
- IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(mbRemoved);
-
- for (int k = 0; k < renderings.length; k++) {
- removeMemoryRendering(renderings[k]);
- }
-
- // remove a the tab folder if the memory block is removed
- CTabFolder tabFolder = fTabFolderForMemoryBlock.get(mbRemoved);
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ for (int j = 0; j < memoryBlocks.length; j++) {
+ IMemoryBlock mbRemoved = memoryBlocks[j];
+ if (fTabFolderForMemoryBlock == null) {
+ return;
+ }
- if (tabFolder == null) {
- continue;
- }
+ // get all renderings from this memory block and remove them
+ // from the view
+ IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(mbRemoved);
- fTabFolderForMemoryBlock.remove(mbRemoved);
- fMemoryBlockFromTabFolder.remove(tabFolder);
- IMemoryBlockRetrieval retrieve = MemoryViewUtil.getMemoryBlockRetrieval(mbRemoved);
- if (retrieve != null) {
- if (fTabFolderForDebugView.contains(tabFolder)) {
- fTabFolderForDebugView.remove(MemoryViewUtil.getHashCode(retrieve));
+ for (int k = 0; k < renderings.length; k++) {
+ removeMemoryRendering(renderings[k]);
}
- }
- if (!tabFolder.isDisposed()) {
- // dispose all view tabs belonging to the tab folder
- CTabItem[] items = tabFolder.getItems();
+ // remove a the tab folder if the memory block is removed
+ CTabFolder tabFolder = fTabFolderForMemoryBlock.get(mbRemoved);
- for (int i = 0; i < items.length; i++) {
- disposeTab(items[i]);
+ if (tabFolder == null) {
+ continue;
}
- // dispose the tab folder
- tabFolder.dispose();
-
- // if this is the top control
- if (tabFolder == fStackLayout.topControl) {
+ fTabFolderForMemoryBlock.remove(mbRemoved);
+ fMemoryBlockFromTabFolder.remove(tabFolder);
+ IMemoryBlockRetrieval retrieve = MemoryViewUtil.getMemoryBlockRetrieval(mbRemoved);
+ if (retrieve != null) {
+ if (fTabFolderForDebugView.contains(tabFolder)) {
+ fTabFolderForDebugView.remove(MemoryViewUtil.getHashCode(retrieve));
+ }
+ }
- // if memory view is visible and have a selection
- // follow memory view's selection
+ if (!tabFolder.isDisposed()) {
+ // dispose all view tabs belonging to the tab folder
+ CTabItem[] items = tabFolder.getItems();
- ISelection selection = DebugUIPlugin.getActiveWorkbenchWindow().getSelectionService().getSelection(IDebugUIConstants.ID_MEMORY_VIEW);
- IMemoryBlock mbToSelect = getMemoryBlock(selection);
+ for (int i = 0; i < items.length; i++) {
+ disposeTab(items[i]);
+ }
- if (mbToSelect != null) {
- // memory view may not have got the event and is
- // still displaying
- // the deleted memory block
- if (mbToSelect != mbRemoved) {
- handleMemoryBlockSelection(null, mbToSelect);
- } else if ((MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0)) {
+ // dispose the tab folder
+ tabFolder.dispose();
+
+ // if this is the top control
+ if (tabFolder == fStackLayout.topControl) {
+
+ // if memory view is visible and have a selection
+ // follow memory view's selection
+
+ ISelection selection = DebugUIPlugin.getActiveWorkbenchWindow().getSelectionService().getSelection(IDebugUIConstants.ID_MEMORY_VIEW);
+ IMemoryBlock mbToSelect = getMemoryBlock(selection);
+
+ if (mbToSelect != null) {
+ // memory view may not have got the event and is
+ // still displaying
+ // the deleted memory block
+ if (mbToSelect != mbRemoved) {
+ handleMemoryBlockSelection(null, mbToSelect);
+ } else if ((MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0)) {
+ mbToSelect = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve)[0];
+ handleMemoryBlockSelection(null, mbToSelect);
+ } else {
+ emptyFolder();
+ }
+ } else if (MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0) { // get
+ // to
+ // the
+ // next
+ // folder
mbToSelect = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve)[0];
handleMemoryBlockSelection(null, mbToSelect);
} else {
emptyFolder();
- }
- } else if (MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0) { // get
- // to
- // the
- // next
- // folder
- mbToSelect = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve)[0];
- handleMemoryBlockSelection(null, mbToSelect);
- } else {
- emptyFolder();
+ }
}
+
+ // if not the top control
+ // no need to do anything
}
- // if not the top control
- // no need to do anything
+ fAddedMemoryBlocks.remove(mbRemoved);
+ updateToolBarActionsEnablement();
}
-
- fAddedMemoryBlocks.remove(mbRemoved);
- updateToolBarActionsEnablement();
}
});
@@ -441,56 +447,59 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
public void memoryBlockRenderingAdded(final IMemoryRendering rendering) {
- Display.getDefault().asyncExec(() -> {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
- if (isDisposed()) {
- return;
- }
+ if (isDisposed()) {
+ return;
+ }
- if (fAddedRenderings.contains(rendering)) {
- return;
- }
+ if (fAddedRenderings.contains(rendering)) {
+ return;
+ }
- IMemoryBlock memoryblk = rendering.getMemoryBlock();
+ IMemoryBlock memoryblk = rendering.getMemoryBlock();
- CTabFolder tabFolder = fTabFolderForMemoryBlock.get(memoryblk);
+ CTabFolder tabFolder = fTabFolderForMemoryBlock.get(memoryblk);
- if (tabFolder == null) {
- tabFolder = createFolderForMemoryBlock(memoryblk);
- }
+ if (tabFolder == null) {
+ tabFolder = createFolderForMemoryBlock(memoryblk);
+ }
- if (tabFolder == fStackLayout.topControl) {
- // disable current view tab
- if (getTopMemoryTab() != null) {
- deactivateRendering(getTopMemoryTab());
- getTopMemoryTab().setEnabled(false);
+ if (tabFolder == fStackLayout.topControl) {
+ // disable current view tab
+ if (getTopMemoryTab() != null) {
+ deactivateRendering(getTopMemoryTab());
+ getTopMemoryTab().setEnabled(false);
+ }
}
- }
- fAddedRenderings.add(rendering);
+ fAddedRenderings.add(rendering);
- int index = getIndexOfCreateRenderingTab(tabFolder);
- if (index < 0) {
- index = 0;
- }
- CTabItem tab = createTab(tabFolder, index);
+ int index = getIndexOfCreateRenderingTab(tabFolder);
+ if (index < 0) {
+ index = 0;
+ }
+ CTabItem tab = createTab(tabFolder, index);
- MemoryViewTab viewTab = new MemoryViewTab(tab, rendering, getInstance());
- tabFolder.setSelection(tabFolder.indexOf(tab));
+ MemoryViewTab viewTab = new MemoryViewTab(tab, rendering, getInstance());
+ tabFolder.setSelection(tabFolder.indexOf(tab));
- if (tabFolder == fStackLayout.topControl) {
- setRenderingSelection(viewTab.getRendering());
+ if (tabFolder == fStackLayout.topControl) {
+ setRenderingSelection(viewTab.getRendering());
- // disable top view tab if the view pane is not visible
- IMemoryViewTab top = getTopMemoryTab();
- if (top != null) {
- top.setEnabled(fVisible);
+ // disable top view tab if the view pane is not visible
+ IMemoryViewTab top = getTopMemoryTab();
+ if (top != null) {
+ top.setEnabled(fVisible);
+ }
+ } else {
+ deactivateRendering(viewTab);
+ viewTab.setEnabled(false);
}
- } else {
- deactivateRendering(viewTab);
- viewTab.setEnabled(false);
- }
- updateToolBarActionsEnablement();
+ updateToolBarActionsEnablement();
+ }
});
}
@@ -505,67 +514,70 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// need to run the following code on the UI Thread to avoid invalid
// thread access exception
- Display.getDefault().asyncExec(() -> {
- if (!fAddedRenderings.contains(rendering)) {
- return;
- }
-
- fAddedRenderings.remove(rendering);
-
- CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!fAddedRenderings.contains(rendering)) {
+ return;
+ }
- if (tabFolder.isDisposed()) {
- return;
- }
+ fAddedRenderings.remove(rendering);
- CTabItem[] tabs = tabFolder.getItems();
- boolean foundTab = false;
- for (int i1 = 0; i1 < tabs.length; i1++) {
- IMemoryViewTab viewTab1 = (IMemoryViewTab) tabs[i1].getData();
+ CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
- if (tabs[i1].isDisposed()) {
- continue;
+ if (tabFolder.isDisposed()) {
+ return;
}
- if (viewTab1.getRendering().getMemoryBlock() == memory) {
- if (viewTab1.getRendering() == rendering) {
- foundTab = true;
- disposeTab(tabs[i1]);
- break;
+ CTabItem[] tabs = tabFolder.getItems();
+ boolean foundTab = false;
+ for (int i = 0; i < tabs.length; i++) {
+ IMemoryViewTab viewTab = (IMemoryViewTab) tabs[i].getData();
+
+ if (tabs[i].isDisposed()) {
+ continue;
}
+ if (viewTab.getRendering().getMemoryBlock() == memory) {
+ if (viewTab.getRendering() == rendering) {
+ foundTab = true;
+ disposeTab(tabs[i]);
+ break;
+ }
+
+ }
}
- }
- // if a tab is not found in the current top control
- // this deletion is a result of a debug target termination
- // find memory from other folder and dispose the view tab
- if (!foundTab) {
- Enumeration<CTabFolder> enumeration = fTabFolderForMemoryBlock.elements();
- while (enumeration.hasMoreElements()) {
- CTabFolder otherTabFolder = enumeration.nextElement();
- tabs = otherTabFolder.getItems();
- IMemoryViewTab viewTab2 = null;
- for (int i2 = 0; i2 < tabs.length; i2++) {
- viewTab2 = (IMemoryViewTab) tabs[i2].getData();
- if (viewTab2.getRendering().getMemoryBlock() == memory) {
- if (viewTab2.getRendering() == rendering) {
- foundTab = true;
- disposeTab(tabs[i2]);
- break;
+ // if a tab is not found in the current top control
+ // this deletion is a result of a debug target termination
+ // find memory from other folder and dispose the view tab
+ if (!foundTab) {
+ Enumeration<CTabFolder> enumeration = fTabFolderForMemoryBlock.elements();
+ while (enumeration.hasMoreElements()) {
+ CTabFolder otherTabFolder = enumeration.nextElement();
+ tabs = otherTabFolder.getItems();
+ IMemoryViewTab viewTab = null;
+ for (int i = 0; i < tabs.length; i++) {
+ viewTab = (IMemoryViewTab) tabs[i].getData();
+ if (viewTab.getRendering().getMemoryBlock() == memory) {
+ if (viewTab.getRendering() == rendering) {
+ foundTab = true;
+ disposeTab(tabs[i]);
+ break;
+ }
}
}
}
}
- }
- IMemoryViewTab top = getTopMemoryTab();
+ IMemoryViewTab top = getTopMemoryTab();
- // update selection
- if (top != null) {
- setRenderingSelection(top.getRendering());
- }
+ // update selection
+ if (top != null) {
+ setRenderingSelection(top.getRendering());
+ }
- updateToolBarActionsEnablement();
+ updateToolBarActionsEnablement();
+ }
});
}
@@ -1182,10 +1194,13 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
final CTabFolder tabFolder = fTabFolderForMemoryBlock.get(memoryblk);
if (tabFolder != null) {
- Display.getDefault().asyncExec(() -> {
- int index = getIndexOfCreateRenderingTab(tabFolder);
- if (index >= 0) {
- tabFolder.setSelection(index);
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ int index = getIndexOfCreateRenderingTab(tabFolder);
+ if (index >= 0) {
+ tabFolder.setSelection(index);
+ }
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
index e6a1f884f..8069d259b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
@@ -186,9 +186,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fTableCursor.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
- if (fTableCursor == null) {
+ if (fTableCursor == null)
return;
- }
fTableCursor.removeTraverseListener(fCursorTraverseListener);
fTableCursor.removeKeyListener(fCursorKeyAdapter);
fTableCursor.removeMouseListener(fCursorMouseListener);
@@ -232,16 +231,14 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
if (e.button == 1)
{
int col = fTableCursor.getColumn();
- if (col > 0 && col <= (getNumCol())) {
+ if (col > 0 && col <= (getNumCol()))
activateCellEditor(null);
- }
}
}
private void handleCursorTraverseEvt(TraverseEvent e){
- if (fTableCursor.getRow() == null) {
+ if (fTableCursor.getRow() == null)
return;
- }
Table table = (Table)fTableCursor.getParent();
int row = table.indexOf(fTableCursor.getRow());
@@ -322,9 +319,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
synchronized private Object doAttemptSetKeySelection(final Object key)
{
- if (getBufferTopKey() == null || getBufferEndKey() == null) {
+ if (getBufferTopKey() == null || getBufferEndKey() == null)
return key;
- }
// calculate selected row address
int[] location = getCoordinatesFromKey(key);
@@ -341,13 +337,11 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
DebugUIPlugin.trace(getRendering() + " set cursor selection " + ((BigInteger)key).toString(16)); //$NON-NLS-1$
}
- if (fPendingSelection != null && fPendingSelection != key) {
+ if (fPendingSelection != null && fPendingSelection != key)
return Status.OK_STATUS;
- }
- if (fTableCursor.isDisposed()) {
+ if (fTableCursor.isDisposed())
return Status.OK_STATUS;
- }
// by the time this is called, the location may not be valid anymore
int[] newLocation = getCoordinatesFromKey(key);
@@ -437,9 +431,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
{
AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null) {
+ if (model != null)
return getKey(model.getElements().length-1);
- }
return null;
}
@@ -447,9 +440,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
{
int idx = -1;
AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null) {
+ if (model != null)
idx = model.indexOfKey(key);
- }
return idx;
}
@@ -478,9 +470,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
public Object getKey(int row, int col)
{
AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null) {
+ if (model != null)
return model.getKey(row, col);
- }
return null;
}
@@ -509,11 +500,10 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}
}
- if (fPendingSelection != null) {
+ if (fPendingSelection != null)
oldSelectionKey = fPendingSelection;
- } else {
+ else
oldSelectionKey = getSelectionKey();
- }
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING)
{
@@ -586,9 +576,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
{
if (!fTableCursor.isDisposed())
{
- if (fTableCursor.isVisible() != show) {
+ if (fTableCursor.isVisible() != show)
fTableCursor.setVisible(show);
- }
}
}
else
@@ -599,9 +588,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!fTableCursor.isDisposed())
{
- if (fTableCursor.isVisible() != show) {
+ if (fTableCursor.isVisible() != show)
fTableCursor.setVisible(show);
- }
}
return Status.OK_STATUS;
}};
@@ -634,15 +622,13 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}
}
}
- if (colNum >= 0) {
+ if (colNum >= 0)
break;
- }
}
// if column position cannot be determined, return
- if (colNum < 1) {
+ if (colNum < 1)
return;
- }
// handle user mouse click onto table
// move cursor to new position
@@ -670,9 +656,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
final int col = fTableCursor.getColumn();
final int row = indexOf(fSelectionKey);
- if (row < 0) {
+ if (row < 0)
return;
- }
// do not allow user to edit address column
if (col == 0 || col > getNumCol()) {
@@ -693,9 +678,8 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
boolean canEdit = cellModifier
.canModify(element, (String) property);
- if (!canEdit) {
+ if (!canEdit)
return;
- }
CellEditor editor = getCellEditors()[col];
if (editor != null) {
@@ -770,35 +754,43 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
private void handleKeyEventInEditor(KeyEvent event) {
final KeyEvent e = event;
- Display.getDefault().asyncExec(() -> {
- Object obj = e.getSource();
- if (obj instanceof Control)
+ Display.getDefault().asyncExec(new Runnable()
+ {
+ @Override
+ public void run()
{
- Control control = (Control) obj;
- int row = fCellEditorListener.getRow();
- int col = fCellEditorListener.getCol();
-
- try
+ Object obj = e.getSource();
+ if (obj instanceof Control)
{
- switch (e.keyCode)
+ Control control = (Control)obj;
+ int row = fCellEditorListener.getRow();
+ int col = fCellEditorListener.getCol();
+
+ try
{
- case 0:
- doHandleKeyEvent(row, col);
- break;
- case SWT.ESC:
- cancelEditing(row, col);
- break;
- default:
- doHandleKeyEvent(row, col);
+ switch (e.keyCode)
+ {
+ case 0:
+ doHandleKeyEvent(row, col);
+ break;
+ case SWT.ESC:
+ cancelEditing(row, col);
+ break;
+ default :
+ doHandleKeyEvent(row, col);
break;
+ }
}
- } catch (NumberFormatException e1) {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null);
+ catch (NumberFormatException e1)
+ {
+ MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title,
+ DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null);
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
+ fTableCursor.setSelection(row, col);
+ handleCursorMoved();
- removeListeners(control);
+ removeListeners(control);
+ }
}
}
});
@@ -948,13 +940,12 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
public void formatViewer()
{
- if (getModel() == null || !hasPendingUpdates()) {
+ if (getModel() == null || !hasPendingUpdates())
doFormatViewer();
- } else {
+ else
// do not format in the middle of an update
// set pending update and will format when update is completed
fPendingFormatViewer = true;
- }
}
/**
@@ -962,14 +953,18 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
*/
private void doFormatViewer() {
fPendingFormatViewer = false;
- preservingSelection(() -> {
- // causes the content of the table viewer to be replaced
- // without asking content adapter for content
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null) {
- model.handleViewerChanged();
- }
- });
+ preservingSelection(new Runnable() {
+
+ @Override
+ public void run() {
+ // causes the content of the table viewer to be replaced
+ // without asking content adapter for content
+ AbstractVirtualContentTableModel model = getVirtualContentModel();
+ if (model != null)
+ {
+ model.handleViewerChanged();
+ }
+ }});
}
private void fireSelectionChanged(Object selectionKey)
@@ -989,18 +984,22 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
@Override
public void refresh(boolean getContent)
{
- if (getContent) {
+ if (getContent)
refresh();
- } else
+ else
{
- preservingSelection(() -> {
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null) {
- Object[] elements = model.getElements();
- model.remove(elements);
- model.add(elements);
- }
- });
+ preservingSelection(new Runnable() {
+
+ @Override
+ public void run() {
+ AbstractVirtualContentTableModel model = getVirtualContentModel();
+ if (model != null)
+ {
+ Object[] elements = model.getElements();
+ model.remove(elements);
+ model.add(elements);
+ }
+ }});
}
}
@@ -1012,11 +1011,10 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
// TODO: work around swt bug, must force a table cursor redraw after top index is changed
// BUG 130130
int[] coordinates = getCoordinatesFromKey(getSelectionKey());
- if (coordinates.length > 0) {
+ if (coordinates.length > 0)
fTableCursor.setVisible(true);
- } else {
+ else
fTableCursor.setVisible(false);
- }
}
}
@@ -1047,14 +1045,17 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
// and the cursor should not be redrawn yet.
if (!hasPendingSetTopIndex())
{
- preservingSelection(() -> {
- int[] coordinates = getCoordinatesFromKey(getSelectionKey());
- if (coordinates.length > 0) {
- fTableCursor.setVisible(true);
- } else {
- fTableCursor.setVisible(false);
- }
- });
+ preservingSelection(new Runnable() {
+
+ @Override
+ public void run() {
+
+ int[] coordinates = getCoordinatesFromKey(getSelectionKey());
+ if (coordinates.length > 0)
+ fTableCursor.setVisible(true);
+ else
+ fTableCursor.setVisible(false);
+ }});
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
index dd8a601ac..18b1aa5dd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
@@ -101,9 +101,12 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten
if (element == null) {
return;
}
- Runnable r = () -> {
- if (!isDisposed()) {
- doHandleDebugEvent(event);
+ Runnable r= new Runnable() {
+ @Override
+ public void run() {
+ if (!isDisposed()) {
+ doHandleDebugEvent(event);
+ }
}
};
@@ -115,9 +118,8 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten
*/
@Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i < events.length; i++) {
+ for (int i=0; i < events.length; i++)
handleDebugEvent(events[i]);
- }
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
index c319a1401..6a3000bef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
@@ -50,10 +50,13 @@ public class TableRenderingPrefAction extends ActionDelegate implements IViewAct
manager.addToRoot(targetNode);
final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager);
final boolean [] result = new boolean[] { false };
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), () -> {
- dialog.create();
- dialog.setMessage(targetNode.getLabelText());
- result[0] = (dialog.open() == Window.OK);
+ BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ dialog.create();
+ dialog.setMessage(targetNode.getLabelText());
+ result[0]= (dialog.open() == Window.OK);
+ }
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
index 68d27ba2a..6870e23a4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
@@ -54,19 +54,21 @@ public class SelectLogicalStructureAction extends Action {
if (!getView().isAvailable()) {
return;
}
- BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), () -> {
- // Checking this action sets the type to fType, unchecking it sets
- // the type
- // to null ("none selected")
- ILogicalStructureType type = null;
- IAction action = getView().getAction("ToggleContentProviders"); //$NON-NLS-1$
- if (isChecked()) {
- type = fType;
- action.setChecked(true);
+ BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ // Checking this action sets the type to fType, unchecking it sets the type
+ // to null ("none selected")
+ ILogicalStructureType type= null;
+ IAction action = getView().getAction("ToggleContentProviders"); //$NON-NLS-1$
+ if (isChecked()) {
+ type= fType;
+ action.setChecked(true);
+ }
+ action.run();
+ DebugPlugin.setDefaultStructureType(fAvailableTypes, type);
+ getView().getViewer().refresh();
}
- action.run();
- DebugPlugin.setDefaultStructureType(fAvailableTypes, type);
- getView().getViewer().refresh();
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
index b086c229f..504a1fd53 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
@@ -51,7 +51,12 @@ public class ToggleLogicalStructureAction extends Action {
return;
}
getView().setShowLogicalStructure(isChecked());
- BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), () -> getView().getViewer().refresh());
+ BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ getView().getViewer().refresh();
+ }
+ });
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
index 9c8f34cfa..7294468b0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
@@ -48,7 +48,12 @@ public class ToggleShowColumnsAction extends Action implements IUpdate {
if (fViewer.getControl().isDisposed()) {
return;
}
- BusyIndicator.showWhile(fViewer.getControl().getDisplay(), () -> fViewer.setShowColumns(isChecked()));
+ BusyIndicator.showWhile(fViewer.getControl().getDisplay(), new Runnable() {
+ @Override
+ public void run() {
+ fViewer.setShowColumns(isChecked());
+ }
+ });
}
/* (non-Javadoc)

Back to the top