Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java8
6 files changed, 45 insertions, 123 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
index 9f0710e08..f670a4e67 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
@@ -50,15 +50,11 @@ import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ICheckStateProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
@@ -466,12 +462,7 @@ public class GroupLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
updateLaunchConfigurationDialog();
}
};
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- buts.updateWidgetEnablement();
- }
- });
+ treeViewer.addSelectionChangedListener(event -> buts.updateWidgetEnablement());
treeViewer.getTree().addSelectionListener(new SelectionAdapter(){
@Override
@@ -480,12 +471,9 @@ public class GroupLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
}
});
- treeViewer.addCheckStateListener(new ICheckStateListener(){
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- ((GroupLaunchElement)event.getElement()).enabled = event.getChecked();
- updateLaunchConfigurationDialog();
- }
+ treeViewer.addCheckStateListener(event -> {
+ ((GroupLaunchElement)event.getElement()).enabled = event.getChecked();
+ updateLaunchConfigurationDialog();
});
buts.updateWidgetEnablement();
GridData layoutData = new GridData(GridData.GRAB_VERTICAL);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
index 8e30604a5..e8916726f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
@@ -49,15 +49,11 @@ import org.eclipse.debug.internal.ui.launchConfigurations.LaunchCategoryFilter;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.wizard.WizardPage;
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.Image;
@@ -185,12 +181,9 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
updateCheckedState(element);
}
}
- fViewer.addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateCheckedState(event.getElement());
- setPageComplete(isComplete());
- }
+ fViewer.addCheckStateListener(event -> {
+ updateCheckedState(event.getElement());
+ setPageComplete(isComplete());
});
Composite buttoncomp = SWTFactory.createComposite(parent, parent.getFont(), 2, 2, GridData.FILL_HORIZONTAL, 0, 0);
Button button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_8, null);
@@ -277,12 +270,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
fFilePath = SWTFactory.createText(comp, SWT.SINGLE | SWT.BORDER, 1);
String opath = getDialogSettings().get(OLD_PATH);
fFilePath.setText((opath == null ? IInternalDebugCoreConstants.EMPTY_STRING : opath));
- fFilePath.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- setPageComplete(isComplete());
- }
- });
+ fFilePath.addModifyListener(e -> setPageComplete(isComplete()));
Button button = SWTFactory.createPushButton(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_0, null, GridData.END);
button.addSelectionListener(new SelectionAdapter() {
@Override
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
index d3cc755cf..42eb68019 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
@@ -31,8 +31,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
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;
@@ -85,14 +83,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
label.setLayoutData(gd);
fWorkingSetName= new Text(composite, SWT.SINGLE | SWT.BORDER);
fWorkingSetName.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- fWorkingSetName.addModifyListener(
- new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validateInput();
- }
- }
- );
+ fWorkingSetName.addModifyListener(e -> validateInput());
fWorkingSetName.setFocus();
label= new Label(composite, SWT.WRAP);
label.setText(DebugUIViewsMessages.BreakpointWorkingSetPage_3);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
index cc889805e..12cd30d9a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
@@ -51,7 +51,6 @@ import org.eclipse.debug.ui.IDebugView;
import org.eclipse.debug.ui.IDetailPane2;
import org.eclipse.debug.ui.IValueDetailListener;
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.MenuManager;
@@ -76,14 +75,10 @@ import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyEvent;
@@ -472,14 +467,10 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
private void installWhitespacePreferenceListener() {
IPreferenceStore store = EditorsUI.getPreferenceStore();
- fPreferenceStorePropertyChangeListener = new IPropertyChangeListener() {
-
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (AbstractTextEditor.PREFERENCE_SHOW_WHITESPACE_CHARACTERS.equals(property)) {
- toggleWhitespaceCharacterPainter();
- }
+ fPreferenceStorePropertyChangeListener = event -> {
+ String property = event.getProperty();
+ if (AbstractTextEditor.PREFERENCE_SHOW_WHITESPACE_CHARACTERS.equals(property)) {
+ toggleWhitespaceCharacterPainter();
}
};
store.addPropertyChangeListener(fPreferenceStorePropertyChangeListener);
@@ -535,12 +526,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
});
// Add the selection listener so selection dependent actions get updated.
- fSourceViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- updateSelectionDependentActions();
- }
- });
+ fSourceViewer.getSelectionProvider().addSelectionChangedListener(event -> updateSelectionDependentActions());
// Add a focus listener to update actions when details area gains focus
fSourceViewer.getControl().addFocusListener(new FocusAdapter() {
@@ -579,20 +565,17 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
// disposed controls don't get a FocusOut event, make sure all actions
// have been deactivated
- fSourceViewer.getControl().addDisposeListener(new DisposeListener() {
- @Override
- public void widgetDisposed(DisposeEvent e) {
- if (fHasFocus) {
- setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
- setGlobalAction(IDebugView.CUT_ACTION, null);
- setGlobalAction(IDebugView.COPY_ACTION, null);
- setGlobalAction(IDebugView.PASTE_ACTION, null);
- setGlobalAction(IDebugView.FIND_ACTION, null);
- setGlobalAction(getAction(DETAIL_ASSIGN_VALUE_ACTION)
- .getActionDefinitionId(), null);
- setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION)
- .getActionDefinitionId(), null);
- }
+ fSourceViewer.getControl().addDisposeListener(e -> {
+ if (fHasFocus) {
+ setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
+ setGlobalAction(IDebugView.CUT_ACTION, null);
+ setGlobalAction(IDebugView.COPY_ACTION, null);
+ setGlobalAction(IDebugView.PASTE_ACTION, null);
+ setGlobalAction(IDebugView.FIND_ACTION, null);
+ setGlobalAction(getAction(DETAIL_ASSIGN_VALUE_ACTION)
+ .getActionDefinitionId(), null);
+ setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION)
+ .getActionDefinitionId(), null);
}
});
@@ -681,12 +664,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
protected void createDetailContextMenu(Control menuControl) {
MenuManager menuMgr= new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager mgr) {
- fillDetailContextMenu(mgr);
- }
- });
+ menuMgr.addMenuListener(mgr -> fillDetailContextMenu(mgr));
Menu menu= menuMgr.createContextMenu(menuControl);
menuControl.setMenu(menu);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
index 86449a55d..9b1311656 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
@@ -63,7 +63,6 @@ import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -88,8 +87,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
@@ -314,12 +311,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
environmentTable.setContentProvider(new EnvironmentVariableContentProvider());
environmentTable.setLabelProvider(new EnvironmentVariableLabelProvider());
environmentTable.setColumnProperties(new String[] { P_VARIABLE, P_VALUE });
- environmentTable.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- handleTableSelectionChanged(event);
- }
- });
+ environmentTable.addSelectionChangedListener(event -> handleTableSelectionChanged(event));
// Setup right-click context menu
Menu menuTable = new Menu(table);
@@ -367,29 +359,23 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
}
});
- environmentTable.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = environmentTable.getStructuredSelection();
- if (selection.size() == 1) {
- miRemove.setText(LaunchConfigurationsMessages.EnvironmentTab_Remove_6);
- } else if (selection.size() > 1) {
- miRemove.setText(LaunchConfigurationsMessages.EnvironmentTab_Remove_All);
- }
+ environmentTable.addSelectionChangedListener(event -> {
+ IStructuredSelection selection = environmentTable.getStructuredSelection();
+ if (selection.size() == 1) {
+ miRemove.setText(LaunchConfigurationsMessages.EnvironmentTab_Remove_6);
+ } else if (selection.size() > 1) {
+ miRemove.setText(LaunchConfigurationsMessages.EnvironmentTab_Remove_All);
}
});
// Disable certain context menu item's if no table item is selected
- table.addListener(SWT.MenuDetect, new Listener() {
- @Override
- public void handleEvent(Event event) {
- if (table.getSelectionCount() <= 0) {
- miRemove.setEnabled(false);
- miCopy.setEnabled(false);
- } else {
- miRemove.setEnabled(true);
- miCopy.setEnabled(true);
- }
+ table.addListener(SWT.MenuDetect, event -> {
+ if (table.getSelectionCount() <= 0) {
+ miRemove.setEnabled(false);
+ miCopy.setEnabled(false);
+ } else {
+ miRemove.setEnabled(true);
+ miCopy.setEnabled(true);
}
});
@@ -1028,13 +1014,10 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
public Object[] getElements(Object inputElement) {
EnvironmentVariable[] elements = null;
if (inputElement instanceof HashMap) {
- Comparator<Object> comparator = new Comparator<Object>() {
- @Override
- public int compare(Object o1, Object o2) {
- String s1 = (String) o1;
- String s2 = (String) o2;
- return s1.compareTo(s2);
- }
+ Comparator<Object> comparator = (o1, o2) -> {
+ String s1 = (String) o1;
+ String s2 = (String) o2;
+ return s1.compareTo(s2);
};
TreeMap<Object, Object> envVars = new TreeMap<>(comparator);
envVars.putAll((Map<?, ?>) inputElement);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
index 442bbc396..973128ba6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
@@ -25,7 +25,6 @@ import org.eclipse.core.commands.HandlerEvent;
import org.eclipse.core.expressions.IEvaluationContext;
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;
@@ -228,12 +227,7 @@ public abstract class DebugCommandHandler extends AbstractHandler {
DebugCommandService service = DebugCommandService.getService(window);
return service.executeCommand(
getCommandType(), targets,
- new ICommandParticipant() {
- @Override
- public void requestDone(org.eclipse.debug.core.IRequest request) {
- DebugCommandHandler.this.postExecute(request, targets);
- }
- });
+ request -> DebugCommandHandler.this.postExecute(request, targets));
}
/**

Back to the top