Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-06-15 08:24:34 +0000
committerLars Vogel2020-06-18 08:43:31 +0000
commitadb58cb98c446f4861a183cb5c45a2f3cc6d6bfe (patch)
tree7a4a9c40a62a8c925e4cd053ba48864a92b35994 /org.eclipse.debug.ui/ui/org/eclipse
parentb5d058af7ceaaeb734476b48058581d7ad315b4b (diff)
downloadeclipse.platform.debug-adb58cb98c446f4861a183cb5c45a2f3cc6d6bfe.tar.gz
eclipse.platform.debug-adb58cb98c446f4861a183cb5c45a2f3cc6d6bfe.tar.xz
eclipse.platform.debug-adb58cb98c446f4861a183cb5c45a2f3cc6d6bfe.zip
Bug 564330 - Lambda and method cleanup on o.e.debug.ui plug-inY20200620-1200I20200621-1800I20200620-1800I20200619-1800I20200618-1800
Running the JDT batch cleanup for lambdas and method reference showed still some places where they can be used. As we received lots of cleanups in this area, I think it is good to finish this. Change-Id: I560d28b914c67387a83f600bba12a920f7d69dc7 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java145
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java91
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java96
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java8
50 files changed, 530 insertions, 992 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
index 7f234f4e6..084aa4863 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
@@ -14,12 +14,8 @@
package org.eclipse.debug.internal.ui;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
@@ -57,18 +53,10 @@ public abstract class AbstractDebugListSelectionDialog extends AbstractDebugSele
@Override
protected void addViewerListeners(StructuredViewer viewer) {
- viewer.addSelectionChangedListener(new ISelectionChangedListener(){
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- getButton(IDialogConstants.OK_ID).setEnabled(isValid());
- }
- });
- viewer.addDoubleClickListener(new IDoubleClickListener(){
- @Override
- public void doubleClick(DoubleClickEvent event) {
- if (isValid()){
- okPressed();
- }
+ viewer.addSelectionChangedListener(event -> getButton(IDialogConstants.OK_ID).setEnabled(isValid()));
+ viewer.addDoubleClickListener(event -> {
+ if (isValid()){
+ okPressed();
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
index c9e2932f4..5e3092622 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
@@ -25,12 +25,8 @@ import org.eclipse.debug.ui.StringVariableSelectionDialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -151,12 +147,7 @@ public class MultipleInputDialog extends Dialog {
return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
}
});
- text.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validateFields();
- }
- });
+ text.addModifyListener(e -> validateFields());
}
controlList.add(text);
@@ -195,12 +186,7 @@ public class MultipleInputDialog extends Dialog {
}
});
- text.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validateFields();
- }
- });
+ text.addModifyListener(e -> validateFields());
}
Button button = createButton(comp, IDialogConstants.IGNORE_ID, DebugUIMessages.MultipleInputDialog_6, false);
@@ -262,12 +248,7 @@ public class MultipleInputDialog extends Dialog {
}
});
- text.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validateFields();
- }
- });
+ text.addModifyListener(e -> validateFields());
}
Button button = createButton(comp, IDialogConstants.IGNORE_ID, DebugUIMessages.MultipleInputDialog_8, false);
@@ -304,12 +285,9 @@ public class MultipleInputDialog extends Dialog {
text.setLayoutData(gd);
text.setData(FIELD_NAME, labelText);
- text.addTraverseListener(new TraverseListener () {
- @Override
- public void keyTraversed(TraverseEvent e) {
- if(e.detail == SWT.TRAVERSE_RETURN && e.stateMask == SWT.SHIFT) {
- e.doit = true;
- }
+ text.addTraverseListener(e -> {
+ if(e.detail == SWT.TRAVERSE_RETURN && e.stateMask == SWT.SHIFT) {
+ e.doit = true;
}
});
@@ -328,12 +306,7 @@ public class MultipleInputDialog extends Dialog {
}
});
- text.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validateFields();
- }
- });
+ text.addModifyListener(e -> validateFields());
}
Composite comp = SWTFactory.createComposite(panel, panel.getFont(), 1, 2, GridData.HORIZONTAL_ALIGN_END);
GridLayout ld = (GridLayout)comp.getLayout();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
index 26a3730e9..49df424dc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
@@ -27,15 +27,11 @@ import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
@@ -186,18 +182,8 @@ public class GroupBreakpointsByDialog extends TrayDialog {
Table table = fAvailableViewer.getTable();
table.setLayoutData(new GridData(GridData.FILL_BOTH));
table.setFont(parent.getFont());
- fAvailableViewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- handleAddPressed();
- }
- });
- fAvailableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- updateAddButton();
- }
- });
+ fAvailableViewer.addDoubleClickListener(event -> handleAddPressed());
+ fAvailableViewer.addSelectionChangedListener(event -> updateAddButton());
}
/**
@@ -229,18 +215,8 @@ public class GroupBreakpointsByDialog extends TrayDialog {
Tree tree = fSelectedViewer.getTree();
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
tree.setFont(parent.getFont());
- fSelectedViewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- handleRemovePressed();
- }
- });
- fSelectedViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- updateSelectedButtons();
- }
- });
+ fSelectedViewer.addDoubleClickListener(event -> handleRemovePressed());
+ fSelectedViewer.addSelectionChangedListener(event -> updateSelectedButtons());
}
public void createButtons(Composite parent) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
index 41505f3ff..a573edaf4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
@@ -20,9 +20,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkingSet;
@@ -52,12 +50,9 @@ public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelec
protected void addViewerListeners(StructuredViewer viewer) {
CheckboxTableViewer checkViewer = getCheckBoxTableViewer();
if (checkViewer != null){
- checkViewer.addCheckStateListener(new ICheckStateListener(){
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- getCheckBoxTableViewer().setCheckedElements(new Object[] {event.getElement()});
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
+ checkViewer.addCheckStateListener(event -> {
+ getCheckBoxTableViewer().setCheckedElements(new Object[] {event.getElement()});
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
});
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
index e2aeb3b70..f75ee9379 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
@@ -60,92 +60,89 @@ public class RemoveBreakpointAction extends AbstractSelectionActionDelegate {
}
final Iterator<?> itr = selection.iterator();
final CoreException[] exception= new CoreException[1];
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- @Override
- public void run(IProgressMonitor monitor) {
- Set<IBreakpoint> breakpointsToDelete = new LinkedHashSet<>();
- ArrayList<IWorkingSet> groupsToDelete = new ArrayList<>();
- boolean deleteAll = false;
- boolean deleteContainer = false;
- boolean prompted = false;
- while (itr.hasNext()) {
- Object next= itr.next();
- IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(next, IBreakpoint.class);
- if (breakpoint != null) {
- breakpointsToDelete.add(breakpoint);
- } else if (next instanceof IBreakpointContainer) {
- //the the container is a workingset, ask if they want to delete it as well
- IBreakpointContainer bpc = (IBreakpointContainer) next;
- if(bpc.getCategory() instanceof WorkingSetCategory) {
- IWorkingSet set = ((WorkingSetCategory)bpc.getCategory()).getWorkingSet();
- if(!prompted) {
- prompted = true;
- DeleteWorkingsetsMessageDialog dialog = new DeleteWorkingsetsMessageDialog(getView().getSite().getShell(),
- ActionMessages.RemoveBreakpointAction_3,
- null,
- ActionMessages.RemoveBreakpointAction_4,
- MessageDialog.QUESTION,
- new String[] {ActionMessages.RemoveBreakpointAction_5, ActionMessages.RemoveBreakpointAction_6},
- 0);
- if (dialog.open() == Window.CANCEL) {
- return;
- }
- deleteAll = dialog.deleteAllBreakpoints();
- deleteContainer = dialog.deleteWorkingset();
- }
- if(deleteContainer) {
- groupsToDelete.add(set);
+ IWorkspaceRunnable runnable= monitor -> {
+ Set<IBreakpoint> breakpointsToDelete = new LinkedHashSet<>();
+ ArrayList<IWorkingSet> groupsToDelete = new ArrayList<>();
+ boolean deleteAll = false;
+ boolean deleteContainer = false;
+ boolean prompted = false;
+ while (itr.hasNext()) {
+ Object next= itr.next();
+ IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(next, IBreakpoint.class);
+ if (breakpoint != null) {
+ breakpointsToDelete.add(breakpoint);
+ } else if (next instanceof IBreakpointContainer) {
+ //the the container is a workingset, ask if they want to delete it as well
+ IBreakpointContainer bpc = (IBreakpointContainer) next;
+ if(bpc.getCategory() instanceof WorkingSetCategory) {
+ IWorkingSet set = ((WorkingSetCategory)bpc.getCategory()).getWorkingSet();
+ if(!prompted) {
+ prompted = true;
+ DeleteWorkingsetsMessageDialog dialog = new DeleteWorkingsetsMessageDialog(getView().getSite().getShell(),
+ ActionMessages.RemoveBreakpointAction_3,
+ null,
+ ActionMessages.RemoveBreakpointAction_4,
+ MessageDialog.QUESTION,
+ new String[] {ActionMessages.RemoveBreakpointAction_5, ActionMessages.RemoveBreakpointAction_6},
+ 0);
+ if (dialog.open() == Window.CANCEL) {
+ return;
}
+ deleteAll = dialog.deleteAllBreakpoints();
+ deleteContainer = dialog.deleteWorkingset();
}
- else {
- if(!prompted) {
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- prompted = store.getBoolean(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER);
- if(prompted) {
- MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(getView().getSite().getShell(), ActionMessages.RemoveBreakpointAction_0,
- ActionMessages.RemoveBreakpointAction_1, ActionMessages.RemoveAllBreakpointsAction_3, !prompted, null, null);
- if(mdwt.getReturnCode() == IDialogConstants.NO_ID) {
- deleteAll = false;
- }
- else {
- store.setValue(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER, !mdwt.getToggleState());
- deleteAll = true;
- }
+ if(deleteContainer) {
+ groupsToDelete.add(set);
+ }
+ }
+ else {
+ if(!prompted) {
+ IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
+ prompted = store.getBoolean(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER);
+ if(prompted) {
+ MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(getView().getSite().getShell(), ActionMessages.RemoveBreakpointAction_0,
+ ActionMessages.RemoveBreakpointAction_1, ActionMessages.RemoveAllBreakpointsAction_3, !prompted, null, null);
+ if(mdwt.getReturnCode() == IDialogConstants.NO_ID) {
+ deleteAll = false;
}
else {
- deleteAll = !prompted;
+ store.setValue(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER, !mdwt.getToggleState());
+ deleteAll = true;
}
}
- }
- if(deleteAll) {
- IBreakpoint[] breakpoints = bpc.getBreakpoints();
- Collections.addAll(breakpointsToDelete, breakpoints);
+ else {
+ deleteAll = !prompted;
+ }
}
}
+ if(deleteAll) {
+ IBreakpoint[] breakpoints1 = bpc.getBreakpoints();
+ Collections.addAll(breakpointsToDelete, breakpoints1);
+ }
}
- final IBreakpoint[] breakpoints = breakpointsToDelete.toArray(new IBreakpoint[0]);
- final IWorkingSet[] sets = groupsToDelete.toArray(new IWorkingSet[groupsToDelete.size()]);
- if(breakpoints.length > 0) {
- ((BreakpointsView)getView()).preserveSelection(getSelection());
- }
- new Job(ActionMessages.RemoveBreakpointAction_2) {
- @Override
- protected IStatus run(IProgressMonitor pmonitor) {
- try {
- Shell shell= getView() != null ? getView().getSite().getShell() : null;
- DebugUITools.deleteBreakpoints(breakpoints, shell, pmonitor);
+ }
+ final IBreakpoint[] breakpoints2 = breakpointsToDelete.toArray(new IBreakpoint[0]);
+ final IWorkingSet[] sets = groupsToDelete.toArray(new IWorkingSet[groupsToDelete.size()]);
+ if(breakpoints2.length > 0) {
+ ((BreakpointsView)getView()).preserveSelection(getSelection());
+ }
+ new Job(ActionMessages.RemoveBreakpointAction_2) {
+ @Override
+ protected IStatus run(IProgressMonitor pmonitor) {
+ try {
+ Shell shell= getView() != null ? getView().getSite().getShell() : null;
+ DebugUITools.deleteBreakpoints(breakpoints2, shell, pmonitor);
- for (IWorkingSet set : sets) {
- PlatformUI.getWorkbench().getWorkingSetManager().removeWorkingSet(set);
- }
- return Status.OK_STATUS;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
+ for (IWorkingSet set : sets) {
+ PlatformUI.getWorkbench().getWorkingSetManager().removeWorkingSet(set);
}
- return Status.CANCEL_STATUS;
+ return Status.OK_STATUS;
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
}
- }.schedule();
- }
+ return Status.CANCEL_STATUS;
+ }
+ }.schedule();
};
try {
ResourcesPlugin.getWorkspace().run(runnable, null, 0, null);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
index a23e15e3c..548245b87 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
@@ -21,8 +21,6 @@ import org.eclipse.debug.core.model.IWatchExpression;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.actions.StatusInfo;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.bindings.keys.IKeyLookup;
import org.eclipse.jface.bindings.keys.KeyLookupFactory;
@@ -149,13 +147,10 @@ public class WatchExpressionDialog extends StatusDialog {
menuManager.add(cutAction);
menuManager.add(copyAction);
menuManager.add(pasteAction);
- menuManager.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- cutAction.update();
- copyAction.update();
- pasteAction.update();
- }
+ menuManager.addMenuListener(manager -> {
+ cutAction.update();
+ copyAction.update();
+ pasteAction.update();
});
Menu menu = menuManager.createContextMenu(fSnippetViewer.getTextWidget());
fSnippetViewer.getTextWidget().setMenu(menu);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
index 89c697c28..4aa3b7e61 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
@@ -31,7 +31,6 @@ import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.views.variables.VariablesView;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.actions.IVariableValueEditor;
-import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
@@ -126,21 +125,15 @@ public class ChangeVariableValueAction extends SelectionProviderAction {
DebugUIPlugin.errorDialog(shell, ActionMessages.ChangeVariableValue_errorDialogTitle,ActionMessages.ChangeVariableValue_errorDialogMessage, exception); //
return;
}
- ChangeVariableValueInputDialog inputDialog = new ChangeVariableValueInputDialog(shell, ActionMessages.ChangeVariableValue_1, MessageFormat.format(ActionMessages.ChangeVariableValue_2, new Object[] { name }), value, new IInputValidator() { //
- /**
- * Returns an error string if the input is invalid
- */
- @Override
- public String isValid(String input) {
- try {
- if (fVariable.verifyValue(input)) {
- return null; // null means valid
- }
- } catch (DebugException exception) {
- return ActionMessages.ChangeVariableValue_3;
+ ChangeVariableValueInputDialog inputDialog = new ChangeVariableValueInputDialog(shell, ActionMessages.ChangeVariableValue_1, MessageFormat.format(ActionMessages.ChangeVariableValue_2, new Object[] { name }), value, input -> {
+ try {
+ if (fVariable.verifyValue(input)) {
+ return null; // null means valid
}
- return ActionMessages.ChangeVariableValue_4;
+ } catch (DebugException exception) {
+ return ActionMessages.ChangeVariableValue_3;
}
+ return ActionMessages.ChangeVariableValue_4;
});
inputDialog.open();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
index 081a4a43a..fdd3f2fea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
@@ -21,8 +21,6 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
@@ -161,16 +159,13 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
text.setLayoutData(gridData);
text.setFont(font);
text.addModifyListener(
- new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- if (okButton.isEnabled()) {
- return;
- }
- errorMessageLabel.setText(IInternalDebugCoreConstants.EMPTY_STRING);
- errorMessageLabel.getParent().update();
- okButton.setEnabled(true);
+ e -> {
+ if (okButton.isEnabled()) {
+ return;
}
+ errorMessageLabel.setText(IInternalDebugCoreConstants.EMPTY_STRING);
+ errorMessageLabel.getParent().update();
+ okButton.setEnabled(true);
}
);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
index 7778425fe..bcf843595 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
@@ -23,8 +23,6 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -57,21 +55,17 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
super(parent);
setShellStyle(getShellStyle() | SWT.RESIZE);
fValue = Integer.toString(DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH));
- fValidator = new IInputValidator() {
- @Override
- public String isValid(String newText) {
- try {
- int num = Integer.parseInt(newText);
- if (num < 0) {
- return VariablesViewMessages.DetailPaneMaxLengthDialog_2;
- }
- } catch (NumberFormatException e) {
- return VariablesViewMessages.DetailPaneMaxLengthDialog_3;
- }
- return null;
- }
-
- };
+ fValidator = newText -> {
+ try {
+ int num = Integer.parseInt(newText);
+ if (num < 0) {
+ return VariablesViewMessages.DetailPaneMaxLengthDialog_2;
+ }
+ } catch (NumberFormatException e) {
+ return VariablesViewMessages.DetailPaneMaxLengthDialog_3;
+ }
+ return null;
+ };
}
@Override
@@ -104,12 +98,9 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
fTextWidget = new Text(composite, SWT.SINGLE | SWT.BORDER);
fTextWidget.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
fTextWidget.setText(fValue);
- fTextWidget.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validateInput();
- fValue = fTextWidget.getText();
- }
+ fTextWidget.addModifyListener(e -> {
+ validateInput();
+ fValue = fTextWidget.getText();
});
fErrorTextWidget = new Text(composite, SWT.READ_ONLY);
fErrorTextWidget.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
index 8a4d9b698..730c7f8fd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
@@ -48,9 +48,7 @@ import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -58,7 +56,6 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -111,12 +108,7 @@ class CommonTabLite extends AbstractLaunchConfigurationTab {
/**
* Modify listener that simply updates the owning launch configuration dialog.
*/
- private ModifyListener fBasicModifyListener = new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- };
+ private ModifyListener fBasicModifyListener = evt -> updateLaunchConfigurationDialog();
@Override
public void createControl(Composite parent) {
@@ -144,12 +136,7 @@ class CommonTabLite extends AbstractLaunchConfigurationTab {
table.setFont(parent.getFont());
fFavoritesTable.setContentProvider(new FavoritesContentProvider());
fFavoritesTable.setLabelProvider(new FavoritesLabelProvider());
- fFavoritesTable.addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateLaunchConfigurationDialog();
- }
- });
+ fFavoritesTable.addCheckStateListener(event -> updateLaunchConfigurationDialog());
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
index 4a55978f0..0ff1d19cf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
@@ -50,8 +50,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
@@ -257,21 +255,18 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
fActionParamLabel = new Label(comp, SWT.NONE);
fActionParamWidget = new Text(comp, SWT.SINGLE | SWT.BORDER);
GridDataFactory.fillDefaults().applyTo(fActionParamWidget);
- fActionParamWidget.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- String text = ((Text) e.widget).getText();
- if (action == GroupElementPostLaunchAction.DELAY) {
- try {
- actionParam = Integer.valueOf(text);
- } catch (NumberFormatException exc) {
- actionParam = null;
- }
- } else if (action == GroupElementPostLaunchAction.OUTPUT_REGEXP) {
- actionParam = text;
+ fActionParamWidget.addModifyListener(e -> {
+ String text = ((Text) e.widget).getText();
+ if (action == GroupElementPostLaunchAction.DELAY) {
+ try {
+ actionParam = Integer.valueOf(text);
+ } catch (NumberFormatException exc) {
+ actionParam = null;
}
- validate();
+ } else if (action == GroupElementPostLaunchAction.OUTPUT_REGEXP) {
+ actionParam = text;
}
+ validate();
});
if (actionParam instanceof Integer) {
fActionParamWidget.setText(((Integer) actionParam).toString());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
index 4e21e8115..137c02397 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
@@ -35,7 +35,6 @@ import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -62,12 +61,7 @@ public class EmbeddedBreakpointsViewer {
private BreakpointsContentProvider fProvider = null;
private Tree fTree = null;
private BreakpointsViewer fViewer = null;
- private ICheckStateListener fCheckListener = new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateCheckedState(event.getElement(), event.getChecked());
- }
- };
+ private ICheckStateListener fCheckListener = event -> updateCheckedState(event.getElement(), event.getChecked());
/**
* This constructor allows a specific selection to be used in stead of the default
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
index 57e7c6a7d..2b9d737ad 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
@@ -34,8 +34,6 @@ import org.eclipse.debug.ui.actions.ExportBreakpointsOperation;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -173,12 +171,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
SWTFactory.createLabel(composite, ImportExportMessages.WizardExportBreakpointsPage_2, 1);
fTView = new EmbeddedBreakpointsViewer(composite, DebugPlugin.getDefault().getBreakpointManager(), fSelection);
- fTView.getViewer().addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- setPageComplete(detectPageComplete());
- }
- });
+ fTView.getViewer().addCheckStateListener(event -> setPageComplete(detectPageComplete()));
fTView.getViewer().setSelection(fSelection);
//ensure we can see the beginning check-boxes etc. (bug 180971)
//this will not work in Windows Vista as there is no way to over-ride the default viewer item showing policy
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
index fba1257bb..b63dd4248 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
@@ -29,7 +29,6 @@ import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.actions.ImportBreakpointsOperation;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -54,12 +53,7 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage implements
private Button fSelectAll = null;
private Button fDeselectAll = null;
- private ICheckStateListener fImportCheckListener = new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateCheckedState(event.getChecked());
- }
- };
+ private ICheckStateListener fImportCheckListener = event -> updateCheckedState(event.getChecked());
protected WizardImportBreakpointsSelectionPage(String pageName) {
super(pageName, ImportExportMessages.WizardImportBreakpointsSelectionPage_2, null);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
index a4ca54ce5..5f66d2719 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
@@ -37,7 +37,6 @@ import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
@@ -99,12 +98,7 @@ public class FavoritesDialog extends TrayDialog {
/**
* Listener that delegates when the selection changes in a table
*/
- private ISelectionChangedListener fSelectionChangedListener= new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- handleFavoriteSelectionChanged();
- }
- };
+ private ISelectionChangedListener fSelectionChangedListener= event -> handleFavoriteSelectionChanged();
/**
* Listener that delegates when a key is pressed in a table
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
index 3a80b7724..f064ec2af 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
@@ -15,7 +15,6 @@ package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.Arrays;
import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -66,14 +65,10 @@ public class LaunchConfigurationComparator extends WorkbenchViewerComparator {
if (fgCategories == null) {
fgCategories = new HashMap<>();
List<ILaunchConfigurationType> types = Arrays.asList(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
- Collections.sort(types, new Comparator<ILaunchConfigurationType>() {
- @Override
- public int compare(ILaunchConfigurationType o1, ILaunchConfigurationType o2) {
- ILaunchConfigurationType t1 = o1;
- ILaunchConfigurationType t2 = o2;
- return t1.getName().compareTo(t2.getName());
- }
-
+ Collections.sort(types, (o1, o2) -> {
+ ILaunchConfigurationType t1 = o1;
+ ILaunchConfigurationType t2 = o2;
+ return t1.getName().compareTo(t2.getName());
});
Iterator<ILaunchConfigurationType> iterator = types.iterator();
int i = 0;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
index f916fef0d..be4735795 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
@@ -32,7 +32,6 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.HelpEvent;
-import org.eclipse.swt.events.HelpListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.FilteredTree;
@@ -87,12 +86,7 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
treeViewer.addFilter(filter);
}
}
- treeViewer.getControl().addHelpListener(new HelpListener() {
- @Override
- public void helpRequested(HelpEvent evt) {
- handleHelpRequest(evt);
- }
- });
+ treeViewer.getControl().addHelpListener(this::handleHelpRequest);
return treeViewer;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index a9b491ca1..58a92a2a4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -61,7 +61,6 @@ import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -588,20 +587,17 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
GridData gd = new GridData(GridData.FILL_BOTH);
control.setLayoutData(gd);
viewForm.setContent(viewFormContents);
- AbstractLaunchConfigurationAction.IConfirmationRequestor requestor = new AbstractLaunchConfigurationAction.IConfirmationRequestor() {
- @Override
- public boolean getConfirmation() {
- int status = shouldSaveCurrentConfig();
- if(status == IDialogConstants.YES_ID) {
- fTabViewer.handleApplyPressed();
- return true;
- }
- else if(status == IDialogConstants.NO_ID) {
- fTabViewer.handleRevertPressed();
- return true;
- }
- return false;
+ AbstractLaunchConfigurationAction.IConfirmationRequestor requestor = () -> {
+ int status = shouldSaveCurrentConfig();
+ if(status == IDialogConstants.YES_ID) {
+ fTabViewer.handleApplyPressed();
+ return true;
}
+ else if(status == IDialogConstants.NO_ID) {
+ fTabViewer.handleRevertPressed();
+ return true;
+ }
+ return false;
};
getDuplicateAction().setConfirmationRequestor(requestor);
getExportAction().setConfirmationRequestor(requestor);
@@ -610,19 +606,16 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
getLinkPrototypeAction().setConfirmationRequestor(requestor);
getUnlinkPrototypeAction().setConfirmationRequestor(requestor);
getResetWithPrototypeValuesAction().setConfirmationRequestor(requestor);
- ((StructuredViewer) viewer).addPostSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- handleLaunchConfigurationSelectionChanged(event);
- getNewAction().setEnabled(getNewAction().isEnabled());
- getNewPrototypeAction().setEnabled(getNewPrototypeAction().isEnabled());
- getDeleteAction().setEnabled(getDeleteAction().isEnabled());
- getExportAction().setEnabled(getExportAction().isEnabled());
- getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
- getLinkPrototypeAction().setEnabled(getLinkPrototypeAction().isEnabled());
- getUnlinkPrototypeAction().setEnabled(getUnlinkPrototypeAction().isEnabled());
- getResetWithPrototypeValuesAction().setEnabled(getResetWithPrototypeValuesAction().isEnabled());
- }
+ ((StructuredViewer) viewer).addPostSelectionChangedListener(event -> {
+ handleLaunchConfigurationSelectionChanged(event);
+ getNewAction().setEnabled(getNewAction().isEnabled());
+ getNewPrototypeAction().setEnabled(getNewPrototypeAction().isEnabled());
+ getDeleteAction().setEnabled(getDeleteAction().isEnabled());
+ getExportAction().setEnabled(getExportAction().isEnabled());
+ getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
+ getLinkPrototypeAction().setEnabled(getLinkPrototypeAction().isEnabled());
+ getUnlinkPrototypeAction().setEnabled(getUnlinkPrototypeAction().isEnabled());
+ getResetWithPrototypeValuesAction().setEnabled(getResetWithPrototypeValuesAction().isEnabled());
});
return comp;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
index bce24bd6a..8b4e3705e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
@@ -25,9 +25,7 @@ import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -89,15 +87,12 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
@Override
protected void addViewerListeners(StructuredViewer viewer) {
super.addViewerListeners(viewer);
- viewer.addSelectionChangedListener(new ISelectionChangedListener(){
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = event.getStructuredSelection();
- if (!selection.isEmpty()) {
- LaunchShortcutExtension shortcutSource = (LaunchShortcutExtension) selection.getFirstElement();
- String description = shortcutSource.getShortcutDescription(fMode);
- fDescriptionText.setText((description == null ? LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_3 : description));
- }
+ viewer.addSelectionChangedListener(event -> {
+ IStructuredSelection selection = event.getStructuredSelection();
+ if (!selection.isEmpty()) {
+ LaunchShortcutExtension shortcutSource = (LaunchShortcutExtension) selection.getFirstElement();
+ String description = shortcutSource.getShortcutDescription(fMode);
+ fDescriptionText.setText((description == null ? LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_3 : description));
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
index 8f65c3997..66749e8c1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
@@ -31,9 +31,7 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.Viewer;
@@ -245,16 +243,13 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
@Override
protected void addViewerListeners(StructuredViewer viewer) {
// Override super to use custom listeners
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection ss = event.getStructuredSelection();
- if(ss != null && !ss.isEmpty()) {
- SelectLaunchersDialog.this.description.setText(((ILaunchDelegate)ss.getFirstElement()).getDescription());
- }
- else {
- SelectLaunchersDialog.this.description.setText(IInternalDebugCoreConstants.EMPTY_STRING);
- }
+ viewer.addSelectionChangedListener(event -> {
+ IStructuredSelection ss = event.getStructuredSelection();
+ if(ss != null && !ss.isEmpty()) {
+ SelectLaunchersDialog.this.description.setText(((ILaunchDelegate)ss.getFirstElement()).getDescription());
+ }
+ else {
+ SelectLaunchersDialog.this.description.setText(IInternalDebugCoreConstants.EMPTY_STRING);
}
});
super.addViewerListeners(viewer);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index e64b805db..89e241016 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -112,20 +112,9 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
private IStructuredSelection fDebugContext = StructuredSelection.EMPTY;
- private IPropertyChangeListener fOrganizersListener = new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- // For any property changes in breakpoint organizers, refresh the containers.
- updateContainers();
- }
- };
+ private IPropertyChangeListener fOrganizersListener = event -> updateContainers();
- private IPropertyChangeListener fPresentationContextListener = new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- presentationPropertyChanged(event);
- }
- };
+ private IPropertyChangeListener fPresentationContextListener = this::presentationPropertyChanged;
private IDebugContextListener fDebugContextListener = InputData.this::debugContextChanged;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
index ab8f4dca0..fbdf847e6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
@@ -20,7 +20,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILogicalStructureType;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IIndexedValue;
@@ -233,23 +232,20 @@ public class VariableContentProvider extends ElementContentProvider {
if (fgLogicalCache == null){
fgLogicalCache = new LogicalStructureCache();
// Add a listener to clear the cache when resuming, terminating, or suspending
- DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener(){
- @Override
- public void handleDebugEvents(DebugEvent[] events) {
- for (DebugEvent event : events) {
- if (event.getKind() == DebugEvent.TERMINATE) {
- fgLogicalCache.clear();
- break;
- } else if (event.getKind() == DebugEvent.RESUME && event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
- fgLogicalCache.clear();
- break;
- } else if (event.getKind() == DebugEvent.SUSPEND && event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
- fgLogicalCache.clear();
- break;
- } else if (event.getKind() == DebugEvent.CHANGE && event.getDetail() == DebugEvent.CONTENT) {
- fgLogicalCache.clear();
- break;
- }
+ DebugPlugin.getDefault().addDebugEventListener(events -> {
+ for (DebugEvent event : events) {
+ if (event.getKind() == DebugEvent.TERMINATE) {
+ fgLogicalCache.clear();
+ break;
+ } else if (event.getKind() == DebugEvent.RESUME && event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
+ fgLogicalCache.clear();
+ break;
+ } else if (event.getKind() == DebugEvent.SUSPEND && event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
+ fgLogicalCache.clear();
+ break;
+ } else if (event.getKind() == DebugEvent.CHANGE && event.getDetail() == DebugEvent.CONTENT) {
+ fgLogicalCache.clear();
+ break;
}
}
});
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
index bed606c1b..d51ed864c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
@@ -37,8 +37,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
@@ -228,22 +226,19 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
private Composite createTypeFiltering(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
BooleanFieldEditor2 editor = new BooleanFieldEditor2(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES, DebugPreferencesMessages.LaunchConfigurationsPreferencePage_0, SWT.NONE, comp);
- editor.setPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- boolean newvalue = false;
- if(event.getNewValue() instanceof Boolean) {
- newvalue = ((Boolean)event.getNewValue()).booleanValue();
- }
- else {
- newvalue = Boolean.valueOf(event.getNewValue().toString()).booleanValue();
- }
- if(newvalue) {
- fTable.setEnabled(true);
- }
- else {
- fTable.setEnabled(false);
- }
+ editor.setPropertyChangeListener(event -> {
+ boolean newvalue = false;
+ if(event.getNewValue() instanceof Boolean) {
+ newvalue = ((Boolean)event.getNewValue()).booleanValue();
+ }
+ else {
+ newvalue = Boolean.valueOf(event.getNewValue().toString()).booleanValue();
+ }
+ if(newvalue) {
+ fTable.setEnabled(true);
+ }
+ else {
+ fTable.setEnabled(false);
}
});
fFieldEditors.add(editor);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
index 2295df9b9..c6055fad0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
@@ -42,12 +42,8 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
@@ -328,20 +324,12 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
gd.heightHint = 250;
fTree.setLayoutData(gd);
fTreeViewer = new PerspectivesTreeViewer(fTree);
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- fPerspectivesPanel.refreshPanel(event.getStructuredSelection());
- }
- });
- fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- IStructuredSelection ss = (IStructuredSelection) event.getSelection();
- if(!ss.isEmpty()) {
- Object obj = ss.getFirstElement();
- fTreeViewer.setExpandedState(obj, !fTreeViewer.getExpandedState(obj));
- }
+ fTreeViewer.addSelectionChangedListener(event -> fPerspectivesPanel.refreshPanel(event.getStructuredSelection()));
+ fTreeViewer.addDoubleClickListener(event -> {
+ IStructuredSelection ss = (IStructuredSelection) event.getSelection();
+ if(!ss.isEmpty()) {
+ Object obj = ss.getFirstElement();
+ fTreeViewer.setExpandedState(obj, !fTreeViewer.getExpandedState(obj));
}
});
fTreeViewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
index fb67ff250..a76918943 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
@@ -33,13 +33,9 @@ import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
@@ -190,25 +186,22 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
fTreeViewer.setLabelProvider(new LabelProvider());
fTreeViewer.setInput(fDuplicates);
fTreeViewer.expandToLevel(2);
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- Object obj = event.getStructuredSelection().getFirstElement();
- if(obj instanceof DuplicateDelegate) {
- fTableViewer.setAllChecked(false);
- DuplicateDelegate dd = (DuplicateDelegate) obj;
- fTableViewer.setInput(dd.getDelegates());
- fTableViewer.setSelection(null);
- obj = fDupeSelections.get(dd);
- if(obj != null) {
- fTableViewer.setChecked(obj, true);
- fTableViewer.setSelection(new StructuredSelection(obj));
- }
- }
- else {
- fTableViewer.setInput(null);
+ fTreeViewer.addSelectionChangedListener(event -> {
+ Object obj = event.getStructuredSelection().getFirstElement();
+ if(obj instanceof DuplicateDelegate) {
+ fTableViewer.setAllChecked(false);
+ DuplicateDelegate dd = (DuplicateDelegate) obj;
+ fTableViewer.setInput(dd.getDelegates());
+ fTableViewer.setSelection(null);
+ obj = fDupeSelections.get(dd);
+ if(obj != null) {
+ fTableViewer.setChecked(obj, true);
+ fTableViewer.setSelection(new StructuredSelection(obj));
}
}
+ else {
+ fTableViewer.setInput(null);
+ }
});
//table
@@ -222,39 +215,33 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
fTableViewer.setComparator(new WorkbenchViewerComparator());
fTableViewer.setLabelProvider(new LabelProvider());
fTableViewer.setContentProvider(ArrayContentProvider.getInstance());
- fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection ss = event.getStructuredSelection();
- if(ss != null && !ss.isEmpty()) {
- ILaunchDelegate delegate = (ILaunchDelegate)ss.getFirstElement();
- fDescription.setText(delegate.getDescription());
- }
- else {
- fDescription.setText(IInternalDebugCoreConstants.EMPTY_STRING);
- }
+ fTableViewer.addSelectionChangedListener(event -> {
+ IStructuredSelection ss = event.getStructuredSelection();
+ if(ss != null && !ss.isEmpty()) {
+ ILaunchDelegate delegate = (ILaunchDelegate)ss.getFirstElement();
+ fDescription.setText(delegate.getDescription());
+ }
+ else {
+ fDescription.setText(IInternalDebugCoreConstants.EMPTY_STRING);
}
});
- fTableViewer.addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- fDirty = true;
- Object element = event.getElement();
- boolean checked = event.getChecked();
- //always set checked, this way users cannot 'undo' a change to selecting a preferred delegate
- //The story for this is that on startup if there are dupes, the user is prompted to pick a delegate, after that they cannot
- //return to a state of not being able to launch something, but can pick a different delegate
- fTableViewer.setCheckedElements(new Object[] {element});
- //set the selection to be the checked element
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=233233
- fTableViewer.setSelection(new StructuredSelection(element));
- //persist the selection
- Object obj = fTreeViewer.getStructuredSelection().getFirstElement();
- if(obj instanceof DuplicateDelegate) {
- fDupeSelections.remove(obj);
- if(checked) {
- fDupeSelections.put((DuplicateDelegate) obj, (ILaunchDelegate) element);
- }
+ fTableViewer.addCheckStateListener(event -> {
+ fDirty = true;
+ Object element = event.getElement();
+ boolean checked = event.getChecked();
+ //always set checked, this way users cannot 'undo' a change to selecting a preferred delegate
+ //The story for this is that on startup if there are dupes, the user is prompted to pick a delegate, after that they cannot
+ //return to a state of not being able to launch something, but can pick a different delegate
+ fTableViewer.setCheckedElements(new Object[] {element});
+ //set the selection to be the checked element
+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=233233
+ fTableViewer.setSelection(new StructuredSelection(element));
+ //persist the selection
+ Object obj = fTreeViewer.getStructuredSelection().getFirstElement();
+ if(obj instanceof DuplicateDelegate) {
+ fDupeSelections.remove(obj);
+ if(checked) {
+ fDupeSelections.put((DuplicateDelegate) obj, (ILaunchDelegate) element);
}
}
});
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
index 85c87b027..f07909873 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
@@ -29,8 +29,6 @@ import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BidiSegmentEvent;
-import org.eclipse.swt.custom.BidiSegmentListener;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
@@ -112,34 +110,31 @@ public class ProcessPropertyPage extends PropertyPage {
final int[] segments = new int[count - 1];
commandLineText = DebugPlugin.renderArguments(arguments, segments);
- styledText.addBidiSegmentListener(new BidiSegmentListener() {
- @Override
- public void lineGetSegments(BidiSegmentEvent event) {
- int offset = event.lineOffset;
- int end = offset + event.lineText.length();
+ styledText.addBidiSegmentListener(event -> {
+ int offset = event.lineOffset;
+ int end = offset + event.lineText.length();
- // extract segments for the current line:
- int iStart = Arrays.binarySearch(segments, offset);
- if (iStart < 0) {
- iStart = -iStart - 1;
- }
- int i = iStart;
- while (i < segments.length && segments[i] < end) {
- i++;
- }
- int n = i - iStart;
- if (n > 0) {
- if (n == segments.length) {
- event.segments = segments;
- } else {
- int[] lineSegments = new int[n];
- System.arraycopy(segments, iStart, lineSegments, 0, n);
- event.segments = lineSegments;
- }
- final char[] chars = new char[n];
- Arrays.fill(chars, '\n');
- event.segmentsChars = chars;
+ // extract segments for the current line:
+ int iStart = Arrays.binarySearch(segments, offset);
+ if (iStart < 0) {
+ iStart = -iStart - 1;
+ }
+ int i = iStart;
+ while (i < segments.length && segments[i] < end) {
+ i++;
+ }
+ int n = i - iStart;
+ if (n > 0) {
+ if (n == segments.length) {
+ event.segments = segments;
+ } else {
+ int[] lineSegments = new int[n];
+ System.arraycopy(segments, iStart, lineSegments, 0, n);
+ event.segments = lineSegments;
}
+ final char[] chars = new char[n];
+ Arrays.fill(chars, '\n');
+ event.segmentsChars = chars;
}
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
index e730eeb71..7c7f7aaaa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
@@ -17,7 +17,6 @@ import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
-import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -42,12 +41,8 @@ import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDi
import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.window.Window;
@@ -186,27 +181,19 @@ public class RunDebugPropertiesPage extends PropertyPage {
builderTable.setLayoutData(tableGridData);
IResource resource = getResource();
viewer.setInput(collectConfigCandidates(resource));
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection sel = event.getSelection();
- if(sel instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) sel;
- boolean empty = ss.isEmpty();
- int size = ss.size();
- fEditButton.setEnabled(!empty && size == 1);
- fDuplicateButton.setEnabled(!empty && size == 1);
- fDeleteButton.setEnabled(!empty);
- setErrorMessage(null);
- }
- }
- });
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent arg0) {
- handleEdit();
+ viewer.addSelectionChangedListener(event -> {
+ ISelection sel = event.getSelection();
+ if(sel instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) sel;
+ boolean empty = ss.isEmpty();
+ int size = ss.size();
+ fEditButton.setEnabled(!empty && size == 1);
+ fDuplicateButton.setEnabled(!empty && size == 1);
+ fDeleteButton.setEnabled(!empty);
+ setErrorMessage(null);
}
});
+ viewer.addDoubleClickListener(arg0 -> handleEdit());
return viewer;
}
@@ -254,13 +241,10 @@ public class RunDebugPropertiesPage extends PropertyPage {
fTypeCandidates.add(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(type));
}
- Collections.sort(fTypeCandidates, new Comparator<ILaunchConfigurationType>() {
- @Override
- public int compare(ILaunchConfigurationType o1, ILaunchConfigurationType o2) {
- ILaunchConfigurationType t1 = o1;
- ILaunchConfigurationType t2 = o2;
- return t1.getName().compareTo(t2.getName());
- }
+ Collections.sort(fTypeCandidates, (o1, o2) -> {
+ ILaunchConfigurationType t1 = o1;
+ ILaunchConfigurationType t2 = o2;
+ return t1.getName().compareTo(t2.getName());
});
}
return fTypeCandidates.toArray(new ILaunchConfigurationType[fTypeCandidates.size()]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
index 6b2a90085..b03ab1e77 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
@@ -32,10 +32,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ColumnLayoutData;
import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -178,19 +175,11 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
});
- variableTable.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- handleTableSelectionChanged(event);
- }
- });
+ variableTable.addSelectionChangedListener(this::handleTableSelectionChanged);
- variableTable.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- if (!variableTable.getSelection().isEmpty()) {
- handleEditButtonPressed();
- }
+ variableTable.addDoubleClickListener(event -> {
+ if (!variableTable.getSelection().isEmpty()) {
+ handleEditButtonPressed();
}
});
variableTable.getTable().addKeyListener(new KeyAdapter() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
index 9bd1776c2..59c8333b0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
@@ -28,11 +28,7 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.ViewerComparator;
@@ -92,29 +88,21 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
gd = new GridData(GridData.FILL_BOTH);
table.setLayoutData(gd);
- fViewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- okPressed();
- }
- });
+ fViewer.addDoubleClickListener(event -> okPressed());
fViewer.setLabelProvider(new SourceContainerLabelProvider());
fViewer.setContentProvider(ArrayContentProvider.getInstance());
fViewer.setComparator(new ViewerComparator());
- fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = event.getStructuredSelection();
- if (!selection.isEmpty()) {
- ISourceContainerType type = (ISourceContainerType) selection.getFirstElement();
- setMessage(type.getDescription());
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
- else {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- setMessage(SourceLookupUIMessages.AddSourceContainerDialog_select_source_container);
- }
+ fViewer.addSelectionChangedListener(event -> {
+ IStructuredSelection selection = event.getStructuredSelection();
+ if (!selection.isEmpty()) {
+ ISourceContainerType type = (ISourceContainerType) selection.getFirstElement();
+ setMessage(type.getDescription());
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
+ }
+ else {
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ setMessage(SourceLookupUIMessages.AddSourceContainerDialog_select_source_container);
}
});
if(types.length != 0) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
index 9bf4a23f9..75d6421f6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
@@ -44,19 +44,16 @@ import org.eclipse.ui.views.navigator.ResourceComparator;
*/
public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowser {
- private ISelectionStatusValidator validator= new ISelectionStatusValidator() {
- @Override
- public IStatus validate(Object[] selection) {
- if (selection.length == 0) {
+ private ISelectionStatusValidator validator= selection -> {
+ if (selection.length == 0) {
+ return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
+ }
+ for (Object f : selection) {
+ if (!(f instanceof IFile)) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
- for (Object f : selection) {
- if (!(f instanceof IFile)) {
- return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
- }
- }
- return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
+ return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
};
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
index 24b6e283c..2c714d80b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
@@ -26,8 +26,6 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
@@ -142,12 +140,7 @@ public class DirectorySourceContainerDialog extends TitleAreaDialog {
data.horizontalSpan = 1;
fDirText.setLayoutData(data);
fDirText.setFont(font);
- fDirText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText( ModifyEvent e ) {
- validate();
- }
- });
+ fDirText.addModifyListener(e -> validate());
Button button = new Button(dirComposite, SWT.PUSH);
button.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_5);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
index f23ae3eff..4a2b07e79 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
@@ -89,16 +89,13 @@ public class FolderSourceContainerDialog extends ElementTreeSelectionDialog {
setTitle(SourceLookupUIMessages.folderSelection_title); //
setInput(ResourcesPlugin.getWorkspace().getRoot());
setComparator(new ResourceComparator(ResourceComparator.NAME));
- ISelectionStatusValidator validator= new ISelectionStatusValidator() {
- @Override
- public IStatus validate(Object[] selection) {
- for (Object f : selection) {
- if (!(f instanceof IFolder)) {
- return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), -1, SourceLookupUIMessages.sourceSearch_folderSelectionError, null); //
- }
+ ISelectionStatusValidator validator= selection -> {
+ for (Object f : selection) {
+ if (!(f instanceof IFolder)) {
+ return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), -1, SourceLookupUIMessages.sourceSearch_folderSelectionError, null); //
}
- return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
+ return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
};
setValidator(validator);
setDoubleClickSelects(true);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
index 0a0641f9b..b7fa1d626 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
@@ -15,13 +15,9 @@
package org.eclipse.debug.internal.ui.viewers.breadcrumb;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -169,48 +165,37 @@ public abstract class AbstractBreadcrumb {
gridLayout.horizontalSpacing= 0;
fComposite.setLayout(gridLayout);
- fDisplayFocusListener= new Listener() {
- @Override
- public void handleEvent(Event event) {
- if (fComposite.isDisposed()) return;
+ fDisplayFocusListener= event -> {
+ if (fComposite.isDisposed()) return;
- if (isBreadcrumbEvent(event)) {
- if (fHasFocus)
- return;
+ if (isBreadcrumbEvent(event)) {
+ if (fHasFocus)
+ return;
- focusGained();
- } else {
- if (!fHasFocus)
- return;
+ focusGained();
+ } else {
+ if (!fHasFocus)
+ return;
- focusLost();
- }
+ focusLost();
}
};
Display.getCurrent().addFilter(SWT.FocusIn, fDisplayFocusListener);
fBreadcrumbViewer= createViewer(fComposite);
- fBreadcrumbViewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- Object element= ((IStructuredSelection) event.getSelection()).getFirstElement();
- if (element == null)
- return;
+ fBreadcrumbViewer.addDoubleClickListener(event -> {
+ Object element= ((IStructuredSelection) event.getSelection()).getFirstElement();
+ if (element == null)
+ return;
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbViewer.doFindItem(element);
- if (item == null)
- return;
- item.openDropDownMenu();
- }
+ BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbViewer.doFindItem(element);
+ if (item == null)
+ return;
+ item.openDropDownMenu();
});
- fBreadcrumbViewer.addOpenListener(new IOpenListener() {
- @Override
- public void open(OpenEvent event) {
- doOpen(event.getSelection());
- }
- });
+ fBreadcrumbViewer.addOpenListener(event -> doOpen(event.getSelection()));
return fComposite;
}
@@ -269,15 +254,12 @@ public abstract class AbstractBreadcrumb {
//Sanity check
deinstallDisplayListeners();
- fDisplayKeyListener= new Listener() {
- @Override
- public void handleEvent(Event event) {
- if (event.keyCode != SWT.ESC)
- return;
+ fDisplayKeyListener= event -> {
+ if (event.keyCode != SWT.ESC)
+ return;
- if (!isBreadcrumbEvent(event))
- return;
- }
+ if (!isBreadcrumbEvent(event))
+ return;
};
Display.getDefault().addFilter(SWT.KeyDown, fDisplayKeyListener);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
index aa98d175f..14effd1e5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
@@ -21,14 +21,8 @@ import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -76,12 +70,9 @@ class BreadcrumbItemDetails {
layout.marginHeight= 1;
layout.marginWidth= 2;
fImageComposite.setLayout(layout);
- fImageComposite.addPaintListener(new PaintListener() {
- @Override
- public void paintControl(PaintEvent e) {
- if (fHasFocus && !isTextVisible()) {
- e.gc.drawFocus(e.x, e.y, e.width, e.height);
- }
+ fImageComposite.addPaintListener(e -> {
+ if (fHasFocus && !isTextVisible()) {
+ e.gc.drawFocus(e.x, e.y, e.width, e.height);
}
});
installFocusComposite(fImageComposite);
@@ -99,12 +90,9 @@ class BreadcrumbItemDetails {
layout.marginWidth= 2;
fTextComposite.setLayout(layout);
addElementListener(fTextComposite);
- fTextComposite.addPaintListener(new PaintListener() {
- @Override
- public void paintControl(PaintEvent e) {
- if (fHasFocus && isTextVisible()) {
- e.gc.drawFocus(e.x, e.y, e.width, e.height);
- }
+ fTextComposite.addPaintListener(e -> {
+ if (fHasFocus && isTextVisible()) {
+ e.gc.drawFocus(e.x, e.y, e.width, e.height);
}
});
installFocusComposite(fTextComposite);
@@ -276,23 +264,20 @@ class BreadcrumbItemDetails {
* @param composite the composite which may get focus
*/
private void installFocusComposite(Composite composite) {
- composite.addTraverseListener(new TraverseListener() {
- @Override
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
- int index= fParent.getViewer().getIndexOfItem(fParent);
- if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
- index++;
- } else {
- index--;
- }
-
- if (index > 0 && index < fParent.getViewer().getItemCount()) {
- fParent.getViewer().selectItem(fParent.getViewer().getItem(index));
- }
-
- e.doit= true;
+ composite.addTraverseListener(e -> {
+ if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
+ int index= fParent.getViewer().getIndexOfItem(fParent);
+ if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
+ index++;
+ } else {
+ index--;
+ }
+
+ if (index > 0 && index < fParent.getViewer().getItemCount()) {
+ fParent.getViewer().selectItem(fParent.getViewer().getItem(index));
}
+
+ e.doit= true;
}
});
composite.addKeyListener(new KeyListener() {
@@ -400,13 +385,10 @@ class BreadcrumbItemDetails {
public void mouseUp(MouseEvent e) {
}
});
- control.addMenuDetectListener(new MenuDetectListener() {
- @Override
- public void menuDetected(MenuDetectEvent e) {
- BreadcrumbViewer viewer= fParent.getViewer();
- viewer.selectItem(fParent);
- fParent.getViewer().fireMenuDetect(e);
- }
+ control.addMenuDetectListener(e -> {
+ BreadcrumbViewer viewer= fParent.getViewer();
+ viewer.selectItem(fParent);
+ fParent.getViewer().fireMenuDetect(e);
});
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
index 3f75d9191..8d29b3187 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
@@ -29,8 +29,6 @@ import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.ShellEvent;
@@ -48,7 +46,6 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
@@ -330,42 +327,39 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
* @param shell the shell to install the closer to
*/
private void installCloser(final Shell shell) {
- final Listener focusListener= new Listener() {
- @Override
- public void handleEvent(Event event) {
- Widget focusElement= event.widget;
- boolean isFocusBreadcrumbTreeFocusWidget= focusElement == shell || focusElement instanceof Control && ((Control)focusElement).getShell() == shell;
- boolean isFocusWidgetParentShell= focusElement instanceof Control && ((Control)focusElement).getShell().getParent() == shell;
+ final Listener focusListener= event -> {
+ Widget focusElement= event.widget;
+ boolean isFocusBreadcrumbTreeFocusWidget= focusElement == shell || focusElement instanceof Control && ((Control)focusElement).getShell() == shell;
+ boolean isFocusWidgetParentShell= focusElement instanceof Control && ((Control)focusElement).getShell().getParent() == shell;
+
+ switch (event.type) {
+ case SWT.FocusIn:
+ if (DebugUIPlugin.DEBUG_BREADCRUMB) {
+ DebugUIPlugin.trace("focusIn - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$
+ }
- switch (event.type) {
- case SWT.FocusIn:
+ if (!isFocusBreadcrumbTreeFocusWidget && !isFocusWidgetParentShell) {
if (DebugUIPlugin.DEBUG_BREADCRUMB) {
- DebugUIPlugin.trace("focusIn - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$
- }
-
- if (!isFocusBreadcrumbTreeFocusWidget && !isFocusWidgetParentShell) {
- if (DebugUIPlugin.DEBUG_BREADCRUMB) {
- DebugUIPlugin.trace("==> closing shell since focus in other widget"); //$NON-NLS-1$
- }
- shell.close();
+ DebugUIPlugin.trace("==> closing shell since focus in other widget"); //$NON-NLS-1$
}
- break;
+ shell.close();
+ }
+ break;
- case SWT.FocusOut:
+ case SWT.FocusOut:
+ if (DebugUIPlugin.DEBUG_BREADCRUMB) {
+ DebugUIPlugin.trace("focusOut - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$
+ }
+ if (event.display.getActiveShell() == null) {
if (DebugUIPlugin.DEBUG_BREADCRUMB) {
- DebugUIPlugin.trace("focusOut - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$
- }
- if (event.display.getActiveShell() == null) {
- if (DebugUIPlugin.DEBUG_BREADCRUMB) {
- DebugUIPlugin.trace("==> closing shell since event.display.getActiveShell() != shell"); //$NON-NLS-1$
- }
- shell.close();
+ DebugUIPlugin.trace("==> closing shell since event.display.getActiveShell() != shell"); //$NON-NLS-1$
}
- break;
+ shell.close();
+ }
+ break;
- default:
- Assert.isTrue(false);
- }
+ default:
+ Assert.isTrue(false);
}
};
@@ -390,19 +384,16 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
};
fToolBar.getShell().addControlListener(controlListener);
- shell.addDisposeListener(new DisposeListener() {
- @Override
- public void widgetDisposed(DisposeEvent e) {
- if (DebugUIPlugin.DEBUG_BREADCRUMB) {
- DebugUIPlugin.trace("==> shell disposed"); //$NON-NLS-1$
- }
+ shell.addDisposeListener(e -> {
+ if (DebugUIPlugin.DEBUG_BREADCRUMB) {
+ DebugUIPlugin.trace("==> shell disposed"); //$NON-NLS-1$
+ }
- display.removeFilter(SWT.FocusIn, focusListener);
- display.removeFilter(SWT.FocusOut, focusListener);
+ display.removeFilter(SWT.FocusIn, focusListener);
+ display.removeFilter(SWT.FocusOut, focusListener);
- if (!fToolBar.isDisposed()) {
- fToolBar.getShell().removeControlListener(controlListener);
- }
+ if (!fToolBar.isDisposed()) {
+ fToolBar.getShell().removeControlListener(controlListener);
}
});
shell.addShellListener(new ShellListener() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
index 3bdec56c0..839493033 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
@@ -23,11 +23,9 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.jface.util.OpenStrategy;
-import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.TreeExpansionEvent;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
@@ -86,14 +84,11 @@ public abstract class TreeViewerDropDown {
fDropDownSite = site;
fDropDownViewer= createTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL, path);
- fDropDownViewer.addOpenListener(new IOpenListener() {
- @Override
- public void open(OpenEvent event) {
- if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) {
- DebugUIPlugin.trace("BreadcrumbItemDropDown.showMenu()$treeViewer>open"); //$NON-NLS-1$
- }
- openElement(event.getSelection());
+ fDropDownViewer.addOpenListener(event -> {
+ if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) {
+ DebugUIPlugin.trace("BreadcrumbItemDropDown.showMenu()$treeViewer>open"); //$NON-NLS-1$
}
+ openElement(event.getSelection());
});
final Tree tree = fDropDownViewer.getTree();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
index d8b901e93..462a60831 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
@@ -267,20 +267,17 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
final IProgressMonitor monitor = dialog.getProgressMonitor();
dialog.setCancelable(true);
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- @Override
- public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
- synchronized(listener) {
- listener.fProgressMonitor = m;
- listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getAction().getText()), listener.fItemsToUpdate.size());
- }
+ IRunnableWithProgress runnable = m -> {
+ synchronized(listener) {
+ listener.fProgressMonitor = m;
+ listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getAction().getText()), listener.fItemsToUpdate.size());
+ }
- while (!listener.fItemsToUpdate.isEmpty() && !listener.fProgressMonitor.isCanceled()) {
- Thread.sleep(1);
- }
- synchronized(listener) {
- listener.fProgressMonitor = null;
- }
+ while (!listener.fItemsToUpdate.isEmpty() && !listener.fProgressMonitor.isCanceled()) {
+ Thread.sleep(1);
+ }
+ synchronized(listener) {
+ listener.fProgressMonitor = null;
}
};
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
index 7a0f95ac4..f427d443a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
@@ -32,7 +32,6 @@ import org.eclipse.debug.internal.ui.viewers.FindElementDialog;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
@@ -41,7 +40,6 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualItem;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -193,20 +191,17 @@ public class VirtualFindAction extends Action implements IUpdate {
try {
dialog.run(
true, true,
- new IRunnableWithProgress() {
- @Override
- public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
- synchronized(listener) {
- listener.fProgressMonitor = m;
- listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getText()), listener.fRemainingUpdatesCount);
- }
-
- while ((!listener.fLabelUpdatesComplete || !listener.fViewerUpdatesComplete) && !listener.fProgressMonitor.isCanceled()) {
- Thread.sleep(1);
- }
- synchronized(listener) {
- listener.fProgressMonitor = null;
- }
+ m -> {
+ synchronized(listener) {
+ listener.fProgressMonitor = m;
+ listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getText()), listener.fRemainingUpdatesCount);
+ }
+
+ while ((!listener.fLabelUpdatesComplete || !listener.fViewerUpdatesComplete) && !listener.fProgressMonitor.isCanceled()) {
+ Thread.sleep(1);
+ }
+ synchronized(listener) {
+ listener.fProgressMonitor = null;
}
});
} catch (InvocationTargetException e) {
@@ -234,15 +229,12 @@ public class VirtualFindAction extends Action implements IUpdate {
private int calcUpdatesCount(IModelDelta stateDelta) {
final int[] count = new int[] {0};
- stateDelta.accept( new IModelDeltaVisitor() {
- @Override
- public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
- count[0] += delta.getChildCount();
- return true;
- }
- return false;
+ stateDelta.accept( (delta, depth) -> {
+ if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
+ count[0] += delta.getChildCount();
+ return true;
}
+ return false;
});
// Double it to account for separate element and label update ticks.
@@ -282,14 +274,11 @@ public class VirtualFindAction extends Action implements IUpdate {
ModelDelta stateDelta = new ModelDelta(virtualViewer.getInput(), IModelDelta.NO_CHANGE);
virtualViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.SELECT);
// Set the force flag to all select delta in order to override model's selection policy.
- stateDelta.accept(new IModelDeltaVisitor() {
- @Override
- public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & IModelDelta.SELECT) != 0) {
- ((ModelDelta)delta).setFlags(delta.getFlags() | IModelDelta.FORCE);
- }
- return true;
+ stateDelta.accept((delta, depth) -> {
+ if ((delta.getFlags() & IModelDelta.SELECT) != 0) {
+ ((ModelDelta)delta).setFlags(delta.getFlags() | IModelDelta.FORCE);
}
+ return true;
});
fClientViewer.updateViewer(stateDelta);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
index a52928877..77be30fb8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
@@ -33,12 +33,9 @@ public class ViewerInputService {
*
* @since 3.6
*/
- public final static Object NULL_INPUT = new IViewerInputProvider() {
- @Override
- public void update(IViewerInputUpdate update) {
- update.setInputElement(null);
- update.done();
- }
+ public final static Object NULL_INPUT = (IViewerInputProvider) update -> {
+ update.setInputElement(null);
+ update.done();
};
// previous update request, cancelled when a new request comes in
@@ -48,16 +45,13 @@ public class ViewerInputService {
private ITreeModelViewer fViewer;
- private IViewerInputRequestor fProxyRequest = new IViewerInputRequestor() {
- @Override
- public void viewerInputComplete(final IViewerInputUpdate update) {
- synchronized (ViewerInputService.this) {
- if (fPendingUpdate == update) {
- fPendingUpdate = null;
- }
+ private IViewerInputRequestor fProxyRequest = update -> {
+ synchronized (ViewerInputService.this) {
+ if (fPendingUpdate == update) {
+ fPendingUpdate = null;
}
- fRequestor.viewerInputComplete(update);
}
+ fRequestor.viewerInputComplete(update);
};
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
index 87333a254..c1eab4725 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
@@ -117,9 +117,7 @@ public class BreakpointOrganizerManager {
Collection<IBreakpointOrganizer> collection = fOrganizers.values();
fSorted = new ArrayList<>();
fSorted.addAll(collection);
- Collections.sort(fSorted, (o1, o2) -> {
- return o1.getLabel().compareTo(o2.getLabel());
- });
+ Collections.sort(fSorted, (o1, o2) -> o1.getLabel().compareTo(o2.getLabel()));
}
return fSorted.toArray(new IBreakpointOrganizer[fSorted.size()]);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index f17597ee6..d8bae0c13 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -87,7 +87,6 @@ import org.eclipse.debug.ui.contexts.IDebugContextProvider;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
@@ -469,12 +468,7 @@ public class LaunchView extends AbstractDebugView
*/
private PageRec fDefaultPageRec = null;
- private ISelectionChangedListener fTreeViewerSelectionChangedListener = new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- fTreeViewerDebugContextProvider.activate(event.getSelection());
- }
- };
+ private ISelectionChangedListener fTreeViewerSelectionChangedListener = event -> fTreeViewerDebugContextProvider.activate(event.getSelection());
private class ContextProviderProxy extends AbstractDebugContextProvider implements IDebugContextListener {
private IDebugContextProvider fActiveProvider;
@@ -750,15 +744,12 @@ public class LaunchView extends AbstractDebugView
modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction);
viewMenu.add(modeSubmenu);
- modeSubmenu.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- modeSubmenu.add(fDebugViewModeActions[0]);
- modeSubmenu.add(fDebugViewModeActions[1]);
- modeSubmenu.add(fDebugViewModeActions[2]);
- modeSubmenu.add(new Separator());
- modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction);
- }
+ modeSubmenu.addMenuListener(manager -> {
+ modeSubmenu.add(fDebugViewModeActions[0]);
+ modeSubmenu.add(fDebugViewModeActions[1]);
+ modeSubmenu.add(fDebugViewModeActions[2]);
+ modeSubmenu.add(new Separator());
+ modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction);
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
index ccb12f2c1..9df8a069e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
@@ -35,8 +35,6 @@ import org.eclipse.debug.ui.contexts.AbstractDebugContextProvider;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.contexts.IDebugContextProvider;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.BaseLabelProvider;
@@ -53,8 +51,6 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
@@ -282,12 +278,7 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
protected void createMenuManager() {
MenuManager menuMgr = new MenuManager("#PopUp"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager mgr) {
- fView.fillContextMenu(mgr);
- }
- });
+ menuMgr.addMenuListener(mgr -> fView.fillContextMenu(mgr));
final Menu menu= menuMgr.createContextMenu(fViewer.getControl());
// register the context menu such that other plug-ins may contribute to it
@@ -296,15 +287,12 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
}
fView.addContextMenuManager(menuMgr);
- fViewer.addMenuDetectListener(new MenuDetectListener() {
- @Override
- public void menuDetected(MenuDetectEvent event) {
- menu.setLocation(event.x + 10, event.y + 10);
- menu.setVisible(true);
- while (!menu.isDisposed() && menu.isVisible()) {
- if (!menu.getDisplay().readAndDispatch()) {
- menu.getDisplay().sleep();
- }
+ fViewer.addMenuDetectListener(event -> {
+ menu.setLocation(event.x + 10, event.y + 10);
+ menu.setVisible(true);
+ while (!menu.isDisposed() && menu.isVisible()) {
+ if (!menu.getDisplay().readAndDispatch()) {
+ menu.getDisplay().sleep();
}
}
});
@@ -529,14 +517,11 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
fDropDownViewer.saveElementState(TreePath.EMPTY, delta, IModelDelta.EXPAND | IModelDelta.SELECT);
// Add the IModelDelta.FORCE flag to override the current selection in view.
- rootDelta.accept(new IModelDeltaVisitor(){
- @Override
- public boolean visit(IModelDelta paramDelta, int depth) {
- if ((paramDelta.getFlags() & IModelDelta.SELECT) != 0) {
- ((ModelDelta)paramDelta).setFlags(paramDelta.getFlags() | IModelDelta.FORCE);
- }
- return true;
+ rootDelta.accept((paramDelta, depth) -> {
+ if ((paramDelta.getFlags() & IModelDelta.SELECT) != 0) {
+ ((ModelDelta)paramDelta).setFlags(paramDelta.getFlags() | IModelDelta.FORCE);
}
+ return true;
});
// If elements in the drop-down were auto-expanded, then collapse the drop-down's sub tree in the
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
index c54bc43c3..427955ba0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
@@ -36,8 +36,6 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.debug.ui.memory.IMemoryRenderingType;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
@@ -47,7 +45,6 @@ import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -102,21 +99,17 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
}
};
- private IMemoryRenderingBindingsListener fBindingListener = new IMemoryRenderingBindingsListener() {
- @Override
- public void memoryRenderingBindingsChanged() {
- UIJob job = new UIJob("refresh") { //$NON-NLS-1$
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- fViewer.refresh();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
+ private IMemoryRenderingBindingsListener fBindingListener = () -> {
+ UIJob job = new UIJob("refresh") { //$NON-NLS-1$
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ fViewer.refresh();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.schedule();
};
class MemoryRenderingLabelProvider implements ILabelProvider {
@@ -319,13 +312,7 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
listLayout.heightHint = 140;
fViewer.getControl().setLayoutData(listLayout);
- fViewer.addDoubleClickListener(new IDoubleClickListener() {
-
- @Override
- public void doubleClick(DoubleClickEvent event) {
- okPressed();
- }
- });
+ fViewer.addDoubleClickListener(event -> okPressed());
IMemoryBlock currentBlock = getMemoryBlockToSelect(null);
if (currentBlock == null) {
@@ -334,17 +321,13 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
populateDialog(currentBlock);
}
- fSelectionChangedListener = new ISelectionChangedListener() {
+ fSelectionChangedListener = event -> {
+ ISelection selection = fViewer.getSelection();
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = fViewer.getSelection();
-
- if (selection.isEmpty()) {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- } else {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
+ if (selection.isEmpty()) {
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ } else {
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
}
};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
index 2ca3ac384..18a72a1b2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
@@ -45,8 +45,6 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -295,13 +293,9 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
fDebugContextListener = new TreeViewPaneContextListener();
DebugUITools.addPartDebugContextListener(fParent.getSite(), fDebugContextListener);
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection treeSelected = event.getSelection();
- fSelectionProvider.setSelection(treeSelected);
- }
+ fTreeViewer.addSelectionChangedListener(event -> {
+ ISelection treeSelected = event.getSelection();
+ fSelectionProvider.setSelection(treeSelected);
});
updateRetrieval();
@@ -336,13 +330,10 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
protected MenuManager createContextMenuManager() {
MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- manager.add(fAddMemoryBlockAction);
- manager.add(fRemoveMemoryBlockAction);
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
+ menuMgr.addMenuListener(manager -> {
+ manager.add(fAddMemoryBlockAction);
+ manager.add(fRemoveMemoryBlockAction);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
});
// register a context menu manager, use its pane id as the menu id
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
index 999904591..134deea5f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
@@ -26,7 +26,6 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Control;
@@ -72,13 +71,9 @@ public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, L
fTabItem.setText(getLabel());
fTabItem.setImage(getImage());
- fTabItem.addDisposeListener(fDisposeListener = new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- fTabItem.removeDisposeListener(fDisposeListener);
- dispose();
- }
+ fTabItem.addDisposeListener(fDisposeListener = e -> {
+ fTabItem.removeDisposeListener(fDisposeListener);
+ dispose();
});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
index 1d99b6bfe..1b741465b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
@@ -31,7 +31,6 @@ import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.jface.action.Action;
@@ -127,12 +126,9 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
/**
* Listens for debug context changes and updates action delegate enablement
*/
- private IDebugContextListener fDebugContextListener = new IDebugContextListener() {
- @Override
- public void debugContextChanged(DebugContextEvent event) {
- if (fAction != null) {
- fUpdateJob.schedule();
- }
+ private IDebugContextListener fDebugContextListener = event -> {
+ if (fAction != null) {
+ fUpdateJob.schedule();
}
};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
index c09a32c98..5c2d85ba3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
@@ -36,9 +36,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener;
import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingType;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelection;
@@ -186,12 +184,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
listLayout.horizontalSpan = 1;
fViewer.getControl().setLayoutData(listLayout);
- fViewer.addDoubleClickListener(new IDoubleClickListener (){
-
- @Override
- public void doubleClick(DoubleClickEvent event) {
- addRenderings();
- }});
+ fViewer.addDoubleClickListener(event -> addRenderings());
// listen for enter being pressed
fViewer.getList().addKeyListener(new KeyAdapter() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index e13e758b9..fc5a907ac 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -78,7 +78,6 @@ import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.contexts.IDebugContextService;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
@@ -114,7 +113,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.TreeItem;
@@ -123,7 +121,6 @@ import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IPerspectiveListener;
-import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.ISaveablePart2;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -156,12 +153,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*/
private static class SelectionProviderWrapper implements ISelectionProvider {
private final ListenerList<ISelectionChangedListener> fListenerList = new ListenerList<>(ListenerList.IDENTITY);
- private final ISelectionChangedListener fListener = new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- fireSelectionChanged(event);
- }
- };
+ private final ISelectionChangedListener fListener = this::fireSelectionChanged;
private ISelectionProvider fActiveProvider;
private SelectionProviderWrapper(ISelectionProvider provider) {
@@ -293,12 +285,9 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
* Viewer input requester used to update the viewer once the viewer input has been
* resolved.
*/
- private IViewerInputRequestor fRequester = new IViewerInputRequestor() {
- @Override
- public void viewerInputComplete(IViewerInputUpdate update) {
- if (!update.isCanceled()) {
- viewerInputUpdateComplete(update);
- }
+ private IViewerInputRequestor fRequester = update -> {
+ if (!update.isCanceled()) {
+ viewerInputUpdateComplete(update);
}
};
@@ -505,12 +494,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
}
fDetailPane = new DetailPaneProxy(this);
- fDetailPane.addProperyListener(new IPropertyListener() {
- @Override
- public void propertyChanged(Object source, int propId) {
- firePropertyChange(propId);
- }
- });
+ fDetailPane.addProperyListener((source, propId) -> firePropertyChange(propId));
setDetailPaneOrientation(orientation);
IMemento memento = getMemento();
@@ -652,14 +636,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
}
});
variablesViewer.getPresentationContext().addPropertyChangeListener(
- new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (IPresentationContext.PROPERTY_COLUMNS.equals(event.getProperty())) {
- IAction action = getAction("ShowTypeNames"); //$NON-NLS-1$
- if (action != null) {
- action.setEnabled(event.getNewValue() == null);
- }
+ event -> {
+ if (IPresentationContext.PROPERTY_COLUMNS.equals(event.getProperty())) {
+ IAction action = getAction("ShowTypeNames"); //$NON-NLS-1$
+ if (action != null) {
+ action.setEnabled(event.getNewValue() == null);
}
}
});
@@ -1017,23 +998,20 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
fConfigureColumnsAction = new ConfigureColumnsAction(viewer);
setAction("ToggleColmns", new ToggleShowColumnsAction(viewer)); //$NON-NLS-1$
- layoutSubMenu.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- layoutSubMenu.add(fToggleDetailPaneActions[0]);
- layoutSubMenu.add(fToggleDetailPaneActions[1]);
- layoutSubMenu.add(fToggleDetailPaneActions[2]);
- layoutSubMenu.add(fToggleDetailPaneActions[3]);
- layoutSubMenu.add(new Separator());
- IAction action = getAction("ToggleColmns"); //$NON-NLS-1$
- ((IUpdate)action).update();
- if (action.isEnabled()) {
- layoutSubMenu.add(action);
- }
- fConfigureColumnsAction.update();
- if (fConfigureColumnsAction.isEnabled()) {
- layoutSubMenu.add(fConfigureColumnsAction);
- }
+ layoutSubMenu.addMenuListener(manager -> {
+ layoutSubMenu.add(fToggleDetailPaneActions[0]);
+ layoutSubMenu.add(fToggleDetailPaneActions[1]);
+ layoutSubMenu.add(fToggleDetailPaneActions[2]);
+ layoutSubMenu.add(fToggleDetailPaneActions[3]);
+ layoutSubMenu.add(new Separator());
+ IAction action = getAction("ToggleColmns"); //$NON-NLS-1$
+ ((IUpdate)action).update();
+ if (action.isEnabled()) {
+ layoutSubMenu.add(action);
+ }
+ fConfigureColumnsAction.update();
+ if (fConfigureColumnsAction.isEnabled()) {
+ layoutSubMenu.add(fConfigureColumnsAction);
}
});
}
@@ -1099,18 +1077,15 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*/
protected ISelectionChangedListener getTreeSelectionChangedListener() {
if (fTreeSelectionChangedListener == null) {
- fTreeSelectionChangedListener = new ISelectionChangedListener() {
- @Override
- public void selectionChanged(final SelectionChangedEvent event) {
- if (event.getSelectionProvider().equals(getViewer())) {
- clearStatusLine();
- // if the detail pane is not visible, don't waste time retrieving details
- if (fSashForm.getMaximizedControl() == getViewer().getControl()) {
- return;
- }
- refreshDetailPaneContents();
- treeSelectionChanged(event);
+ fTreeSelectionChangedListener = event -> {
+ if (event.getSelectionProvider().equals(getViewer())) {
+ clearStatusLine();
+ // if the detail pane is not visible, don't waste time retrieving details
+ if (fSashForm.getMaximizedControl() == getViewer().getControl()) {
+ return;
}
+ refreshDetailPaneContents();
+ treeSelectionChanged(event);
}
};
}
@@ -1173,12 +1148,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
@Override
public void paneChanged(String newPaneID) {
if (fDetailPaneActivatedListener == null){
- fDetailPaneActivatedListener = new Listener() {
- @Override
- public void handleEvent(Event event) {
- fTreeHasFocus = false;
- }
- };
+ fDetailPaneActivatedListener = event -> fTreeHasFocus = false;
}
fDetailPane.getCurrentControl().addListener(SWT.Activate, fDetailPaneActivatedListener);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
index d7b3780ec..0356a558d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
@@ -52,9 +52,7 @@ import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -64,7 +62,6 @@ import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -82,7 +79,6 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
import org.eclipse.ui.ide.IDEEncoding;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -154,12 +150,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/**
* Modify listener that simply updates the owning launch configuration dialog.
*/
- private ModifyListener fBasicModifyListener = new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent evt) {
- scheduleUpdateJob();
- }
- };
+ private ModifyListener fBasicModifyListener = evt -> scheduleUpdateJob();
/**
* Constructs a new tab with default context help.
@@ -214,12 +205,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
table.setFont(parent.getFont());
fFavoritesTable.setContentProvider(new FavoritesContentProvider());
fFavoritesTable.setLabelProvider(new FavoritesLabelProvider());
- fFavoritesTable.addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateLaunchConfigurationDialog();
- }
- });
+ fFavoritesTable.addCheckStateListener(event -> updateLaunchConfigurationDialog());
}
/**
@@ -393,20 +379,16 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
dialog.setTitle(LaunchConfigurationsMessages.CommonTab_13);
- dialog.setValidator(new ISelectionStatusValidator() {
-
- @Override
- public IStatus validate(Object[] selection) {
- if (selection.length == 0) {
+ dialog.setValidator(selection -> {
+ if (selection.length == 0) {
+ return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
+ }
+ for (Object f : selection) {
+ if (!(f instanceof IFile)) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
- for (Object f : selection) {
- if (!(f instanceof IFile)) {
- return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
- }
- }
- return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
+ return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
});
dialog.setMessage(LaunchConfigurationsMessages.CommonTab_18);
dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
index a649bda36..528fe429e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
@@ -16,7 +16,6 @@ package org.eclipse.debug.ui.actions;
import org.eclipse.debug.core.IRequest;
import org.eclipse.debug.internal.ui.commands.actions.DebugCommandService;
-import org.eclipse.debug.internal.ui.commands.actions.ICommandParticipant;
import org.eclipse.debug.internal.ui.commands.actions.IEnabledTarget;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
@@ -117,12 +116,7 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
private boolean execute(final Object[] targets) {
return fUpdateService.executeCommand(
getCommandType(), targets,
- new ICommandParticipant() {
- @Override
- public void requestDone(org.eclipse.debug.core.IRequest request) {
- DebugCommandAction.this.postExecute(request, targets);
- }
- });
+ request -> DebugCommandAction.this.postExecute(request, targets));
}
/**

Back to the top