Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/views/properties/org.eclipse.papyrus.views.properties/pom.xml')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/pom.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/pom.xml b/plugins/views/properties/org.eclipse.papyrus.views.properties/pom.xml
index b83663cb6ad..ca94758f463 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/pom.xml
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/pom.xml
@@ -4,11 +4,11 @@
<parent>
<artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
<relativePath>../../../../releng/top-pom-main.xml</relativePath>
</parent>
<artifactId>org.eclipse.papyrus.views.properties</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file

Back to the top

ref='/c/m2e/m2e-core.git/diff/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java'>org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java25
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java77
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java37
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArtifactPage.java25
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardLocationPage.java47
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/ResolverConfigurationComponent.java10
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/preferences/DiscoveryPreferencePage.java11
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerHoverControl.java61
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/dialogs/SelectSPDXLicenseDialog.java22
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java269
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorComposite.java16
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/MavenModuleSelectionDialog.java28
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependenciesPage.java10
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java10
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java124
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertiesSection.java16
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchControl.java9
-rw-r--r--org.eclipse.m2e.jdt.ui/src/org/eclipse/m2e/jdt/ui/internal/MavenClasspathContainerPage.java24
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java34
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenRuntimeSelector.java17
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizardPage.java14
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutLocationPage.java69
-rw-r--r--org.eclipse.m2e.sourcelookup.ui/src/org/eclipse/m2e/sourcelookup/ui/internal/SourceLookupInfoDialog.java28
42 files changed, 769 insertions, 1139 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java
index f126c761..d47d7bb0 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java
@@ -50,7 +50,6 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
@@ -312,53 +311,37 @@ public class NestedProjectsComposite extends Composite implements IMenuListener
Button selectAllBtn = new Button(selectionActionComposite, SWT.NONE);
selectAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
selectAllBtn.setText(Messages.UpdateDepenciesDialog_selectAll);
- selectAllBtn.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- for(IProject project : projects) {
- setSubtreeChecked(project, true);
- }
- updateSelectedProjects();
+ selectAllBtn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ for(IProject project : projects) {
+ setSubtreeChecked(project, true);
}
- });
+ updateSelectedProjects();
+ }));
if(showOutOfDateUI) {
addOutOfDateBtn = new Button(selectionActionComposite, SWT.NONE);
addOutOfDateBtn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
addOutOfDateBtn.setText(Messages.NestedProjectsComposite_Add_OutOfDate);
- addOutOfDateBtn.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- includeOutOfDateProjects();
- }
- });
+ addOutOfDateBtn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> includeOutOfDateProjects()));
}
Button deselectAllBtn = new Button(selectionActionComposite, SWT.NONE);
deselectAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
deselectAllBtn.setText(Messages.UpdateDepenciesDialog_deselectAll);
- deselectAllBtn.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- codebaseViewer.setCheckedElements(new Object[0]);
- updateSelectedProjects();
- }
- });
+ deselectAllBtn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ codebaseViewer.setCheckedElements(new Object[0]);
+ updateSelectedProjects();
+ }));
Button expandAllBtn = new Button(selectionActionComposite, SWT.NONE);
expandAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false, 1, 1));
expandAllBtn.setText(Messages.UpdateDepenciesDialog_expandAll);
- expandAllBtn.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- codebaseViewer.expandAll();
- }
- });
+ expandAllBtn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> codebaseViewer.expandAll()));
Button collapseAllBtn = new Button(selectionActionComposite, SWT.NONE);
collapseAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false, 1, 1));
collapseAllBtn.setText(Messages.UpdateDepenciesDialog_collapseAll);
- collapseAllBtn.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- codebaseViewer.collapseAll();
- }
- });
+ collapseAllBtn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> codebaseViewer.collapseAll()));
}
String getElePath(Object element) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
index 9efa217c..75f9af46 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/WorkingSetGroup.java
@@ -34,8 +34,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
@@ -168,17 +167,15 @@ public class WorkingSetGroup {
newWorkingSetButton.setData("name", "configureButton"); //$NON-NLS-1$ //$NON-NLS-2$
newWorkingSetButton.setText(Messages.WorkingSetGroup_btnMore);
newWorkingSetButton.setEnabled(false);
- newWorkingSetButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(final SelectionEvent e) {
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSetSelectionDialog dialog = workingSetManager.createWorkingSetSelectionDialog(shell, true,
- WORKING_SET_IDS.toArray(new String[0]));
- if(dialog.open() == Window.OK) {
- IWorkingSet[] workingSets = dialog.getSelection();
- selectWorkingSets(Arrays.asList(workingSets));
- }
+ newWorkingSetButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
+ IWorkingSetSelectionDialog dialog = workingSetManager.createWorkingSetSelectionDialog(shell, true,
+ WORKING_SET_IDS.toArray(new String[0]));
+ if(dialog.open() == Window.OK) {
+ IWorkingSet[] workingSets = dialog.getSelection();
+ selectWorkingSets(Arrays.asList(workingSets));
}
- });
+ }));
if(selectWorkingSets(workingSets)) {
addToWorkingSetButton.setSelection(true);
@@ -187,19 +184,17 @@ public class WorkingSetGroup {
newWorkingSetButton.setEnabled(true);
}
- addToWorkingSetButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- boolean addToWorkingingSet = addToWorkingSetButton.getSelection();
- workingsetLabel.setEnabled(addToWorkingingSet);
- workingsetComboViewer.getCombo().setEnabled(addToWorkingingSet);
- newWorkingSetButton.setEnabled(addToWorkingingSet);
- if(addToWorkingingSet) {
- updateConfiguration();
- } else {
- workingSets.clear();
- }
+ addToWorkingSetButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ boolean addToWorkingingSet = addToWorkingSetButton.getSelection();
+ workingsetLabel.setEnabled(addToWorkingingSet);
+ workingsetComboViewer.getCombo().setEnabled(addToWorkingingSet);
+ newWorkingSetButton.setEnabled(addToWorkingingSet);
+ if(addToWorkingingSet) {
+ updateConfiguration();
+ } else {
+ workingSets.clear();
}
- });
+ }));
workingsetComboViewer.addSelectionChangedListener(event -> updateConfiguration());
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AssignWorkingSetDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AssignWorkingSetDialog.java
index 2eb18f0f..4bc53f82 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AssignWorkingSetDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AssignWorkingSetDialog.java
@@ -21,8 +21,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -79,22 +78,14 @@ public class AssignWorkingSetDialog extends TitleAreaDialog {
final Button btnFilterAssignedProjects = new Button(filtersComposite, SWT.CHECK);
btnFilterAssignedProjects.setText(Messages.AssignWorkingSetDialog_btnFilterAssignedProjects_text);
btnFilterAssignedProjects.setSelection(true);
- btnFilterAssignedProjects.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedProjects.refresh();
- }
- });
+ btnFilterAssignedProjects
+ .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> selectedProjects.refresh()));
final Button btnFilterClosedProjects = new Button(filtersComposite, SWT.CHECK);
btnFilterClosedProjects.setText(Messages.AssignWorkingSetDialog_btnFilterClosedProjects_text);
btnFilterClosedProjects.setSelection(true);
- btnFilterClosedProjects.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedProjects.refresh();
- }
- });
+ btnFilterClosedProjects
+ .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> selectedProjects.refresh()));
this.selectedProjects = new NestedProjectsComposite(composite, SWT.NONE, initialSelection, false) {
@Override
@@ -136,12 +127,10 @@ public class AssignWorkingSetDialog extends TitleAreaDialog {
Button btnAssign = new Button(workingSetComposite, SWT.NONE);
btnAssign.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnAssign.setText(Messages.AssignWorkingSetDialog_btnAssign_text);
- btnAssign.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- assignWorkingSets();
- selectedProjects.reset();
- }
- });
+ btnAssign.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ assignWorkingSets();
+ selectedProjects.reset();
+ }));
return area;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPreferencePage.java
index ee0d2430..62441eaf 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPreferencePage.java
@@ -23,8 +23,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
@@ -98,29 +97,23 @@ public class LifecycleMappingPreferencePage extends PreferencePage implements IW
new Label(composite, SWT.WRAP).setText(Messages.LifecycleMappingPreferencePage_WorkspaceMappingsDescription);
Button editLifecyclesButton = new Button(composite, SWT.PUSH);
editLifecyclesButton.setText(Messages.LifecycleMappingPreferencePage_WorkspaceMappingsOpen);
- editLifecyclesButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- try {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchPage workbenchPage = workbench.getActiveWorkbenchWindow().getActivePage();
- IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(
- LifecycleMappingFactory.LIFECYCLE_MAPPING_METADATA_SOURCE_NAME);
- IEditorInput input = new FileStoreEditorInput(EFS.getLocalFileSystem().fromLocalFile(
- new File(mappingFilePath)));
- IDE.openEditor(workbenchPage, input, desc.getId());
- } catch(PartInitException ex) {
- log.error(ex.getMessage(), ex);
- }
+ editLifecyclesButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ try {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchPage workbenchPage = workbench.getActiveWorkbenchWindow().getActivePage();
+ IEditorDescriptor desc = workbench.getEditorRegistry()
+ .getDefaultEditor(LifecycleMappingFactory.LIFECYCLE_MAPPING_METADATA_SOURCE_NAME);
+ IEditorInput input = new FileStoreEditorInput(
+ EFS.getLocalFileSystem().fromLocalFile(new File(mappingFilePath)));
+ IDE.openEditor(workbenchPage, input, desc.getId());
+ } catch(PartInitException ex) {
+ log.error(ex.getMessage(), ex);
}
- });
+ }));
Button refreshLifecyclesButton = new Button(composite, SWT.NONE);
- refreshLifecyclesButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- LifecycleMappingFactory.getWorkspaceMetadata(true);
- }
- });
+ refreshLifecyclesButton.addSelectionListener(
+ SelectionListener.widgetSelectedAdapter(e -> LifecycleMappingFactory.getWorkspaceMetadata(true)));
refreshLifecyclesButton.setText(Messages.LifecycleMappingPreferencePage_btnRefreshLifecycles_text);
new Label(composite, SWT.NONE).setText(Messages.LifecycleMappingPreferencePage_ChangeLocation);
@@ -131,19 +124,17 @@ public class LifecycleMappingPreferencePage extends PreferencePage implements IW
Button newFileButton = new Button(composite, SWT.PUSH);
newFileButton.setText(Messages.LifecycleMappingPreferencePage_Browse);
- newFileButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FileDialog dialog = new FileDialog(LifecycleMappingPreferencePage.this.getShell(), SWT.NONE);
-
- dialog.setText(Messages.LifecycleMappingPreferencePage_ChooseNewLocation);
- dialog.setFilterExtensions(new String[] {"*.xml", "*.*"}); //$NON-NLS-1$ //$NON-NLS-2$
- String res = dialog.open();
- if(res == null) {
- return;
- }
- mappingFileTextBox.setText(dialog.getFilterPath() + "/" + dialog.getFileName()); //$NON-NLS-1$
+ newFileButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ FileDialog dialog = new FileDialog(LifecycleMappingPreferencePage.this.getShell(), SWT.NONE);
+
+ dialog.setText(Messages.LifecycleMappingPreferencePage_ChooseNewLocation);
+ dialog.setFilterExtensions(new String[] {"*.xml", "*.*"}); //$NON-NLS-1$ //$NON-NLS-2$
+ String res = dialog.open();
+ if(res == null) {
+ return;
}
- });
+ mappingFileTextBox.setText(dialog.getFilterPath() + "/" + dialog.getFileName()); //$NON-NLS-1$
+ }));
return composite;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingsViewer.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingsViewer.java
index dd7f9374..30178a82 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingsViewer.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingsViewer.java
@@ -44,8 +44,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -143,13 +142,10 @@ class LifecycleMappingsViewer {
btnShowPhases.setText(Messages.LifecycleMappingPropertyPage_showLIfecyclePhases);
final Button btnShowIgnored = new Button(optionsComposit, SWT.CHECK);
- btnShowIgnored.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- showIgnoredExecutions = btnShowIgnored.getSelection();
- updateMappingsTreeViewer();
- }
- });
+ btnShowIgnored.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ showIgnoredExecutions = btnShowIgnored.getSelection();
+ updateMappingsTreeViewer();
+ }));
btnShowIgnored.setSelection(showIgnoredExecutions);
btnShowIgnored.setText(Messages.LifecycleMappingPropertyPage_mntmShowIgnoredExecutions_text);
final Action actExpandAll = new Action(Messages.LifecycleMappingPropertyPage_mntmExpandAll_text,
@@ -180,15 +176,12 @@ class LifecycleMappingsViewer {
toolBarManager.add(actCollapseAll);
toolBarManager.update(true);
- btnShowPhases.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- showPhases = btnShowPhases.getSelection();
- actExpandAll.setEnabled(showPhases);
- actCollapseAll.setEnabled(showPhases);
- updateMappingsTreeViewer();
- }
- });
+ btnShowPhases.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ showPhases = btnShowPhases.getSelection();
+ actExpandAll.setEnabled(showPhases);
+ actCollapseAll.setEnabled(showPhases);
+ updateMappingsTreeViewer();
+ }));
mappingsTreeViewer = new TreeViewer(container, SWT.BORDER);
Tree tree = mappingsTreeViewer.getTree();
@@ -309,12 +302,7 @@ class LifecycleMappingsViewer {
actionsComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
Button btnCopyToClipboard = new Button(actionsComposite, SWT.NONE);
- btnCopyToClipboard.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- copyToClipboard();
- }
- });
+ btnCopyToClipboard.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> copyToClipboard()));
btnCopyToClipboard.setText(Messages.LifecycleMappingPropertyPage_copyToClipboard);
mappingsTreeViewer.setInput(phases);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
index 79eabaaf..2ff53e7d 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
@@ -27,8 +27,7 @@ import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -119,17 +118,15 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
Button browseButton = new Button(composite, SWT.NONE);
browseButton.setText(Messages.LocalArchetypeCatalogDialog_btnBrowse);
- browseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(Messages.LocalArchetypeCatalogDialog_dialog_title);
- String location = dialog.open();
- if(location != null) {
- catalogLocationCombo.setText(location);
- update();
- }
+ browseButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ FileDialog dialog = new FileDialog(getShell());
+ dialog.setText(Messages.LocalArchetypeCatalogDialog_dialog_title);
+ String location = dialog.open();
+ if(location != null) {
+ catalogLocationCombo.setText(location);
+ update();
}
- });
+ }));
setButtonLayoutData(browseButton);
Label catalogDescriptionLabel = new Label(composite, SWT.NONE);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
index 6a931a00..ec42a777 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
@@ -36,8 +36,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
@@ -136,20 +135,18 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
GridData gd_addRemoveOrLink = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
addRemoveOrLink.setLayoutData(gd_addRemoveOrLink);
addRemoveOrLink.setText(Messages.MavenArchetypesPreferencePage_link);
- addRemoveOrLink.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- try {
- URL url = new URL(
- "http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-catalog.html"); //$NON-NLS-1$
- IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
- browser.openURL(url);
- } catch(MalformedURLException ex) {
- log.error("Malformed URL", ex); //$NON-NLS-1$
- } catch(PartInitException ex) {
- log.error(ex.getMessage(), ex);
- }
+ addRemoveOrLink.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ try {
+ URL url = new URL(
+ "http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-catalog.html"); //$NON-NLS-1$
+ IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
+ browser.openURL(url);
+ } catch(MalformedURLException ex) {
+ log.error("Malformed URL", ex); //$NON-NLS-1$
+ } catch(PartInitException ex) {
+ log.error(ex.getMessage(), ex);
}
- });
+ }));
archetypesViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.FULL_SELECTION);
@@ -184,87 +181,71 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
Button enableAllBtn = new Button(composite, SWT.NONE);
enableAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
enableAllBtn.setText(Messages.MavenArchetypesPreferencePage_btnEnableAll);
- enableAllBtn.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- toggleRepositories(true);
- }
- });
+ enableAllBtn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> toggleRepositories(true)));
Button disableAllBtn = new Button(composite, SWT.NONE);
disableAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
disableAllBtn.setText(Messages.MavenArchetypesPreferencePage_btnDisableAll);
- disableAllBtn.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- toggleRepositories(false);
- }
- });
+ disableAllBtn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> toggleRepositories(false)));
Button addLocalButton = new Button(composite, SWT.NONE);
addLocalButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
addLocalButton.setText(Messages.MavenArchetypesPreferencePage_btnAddLocal);
- addLocalButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), null);
- if(dialog.open() == Window.OK) {
- addCatalogFactory(dialog.getArchetypeCatalogFactory());
- }
+ addLocalButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), null);
+ if(dialog.open() == Window.OK) {
+ addCatalogFactory(dialog.getArchetypeCatalogFactory());
}
- });
+ }));
Button addRemoteButton = new Button(composite, SWT.NONE);
addRemoteButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
addRemoteButton.setText(Messages.MavenArchetypesPreferencePage_btnAddRemote);
- addRemoteButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), null);
- if(dialog.open() == Window.OK) {
- addCatalogFactory(dialog.getArchetypeCatalogFactory());
- }
+ addRemoteButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), null);
+ if(dialog.open() == Window.OK) {
+ addCatalogFactory(dialog.getArchetypeCatalogFactory());
}
- });
+ }));
final Button editButton = new Button(composite, SWT.NONE);
editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
editButton.setEnabled(false);
editButton.setText(Messages.MavenArchetypesPreferencePage_btnEdit);
- editButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory();
- ArchetypeCatalogFactory newFactory = null;
- if(factory instanceof LocalCatalogFactory) {
- LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), factory);
- if(dialog.open() == Window.OK) {
- newFactory = dialog.getArchetypeCatalogFactory();
- }
- } else if(factory instanceof RemoteCatalogFactory) {
- RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), factory);
- if(dialog.open() == Window.OK) {
- newFactory = dialog.getArchetypeCatalogFactory();
- }
+ editButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory();
+ ArchetypeCatalogFactory newFactory = null;
+ if(factory instanceof LocalCatalogFactory) {
+ LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), factory);
+ if(dialog.open() == Window.OK) {
+ newFactory = dialog.getArchetypeCatalogFactory();
}
- if(newFactory != null) {
- int n = archetypeCatalogs.indexOf(factory);
- if(n > -1) {
- archetypeCatalogs.set(n, newFactory);
- archetypesViewer.setInput(archetypeCatalogs);
- archetypesViewer.setSelection(new StructuredSelection(newFactory), true);
- }
+ } else if(factory instanceof RemoteCatalogFactory) {
+ RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), factory);
+ if(dialog.open() == Window.OK) {
+ newFactory = dialog.getArchetypeCatalogFactory();
}
}
- });
+ if(newFactory != null) {
+ int n = archetypeCatalogs.indexOf(factory);
+ if(n > -1) {
+ archetypeCatalogs.set(n, newFactory);
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.setSelection(new StructuredSelection(newFactory), true);
+ }
+ }
+ }));
final Button removeButton = new Button(composite, SWT.NONE);
removeButton.setEnabled(false);
removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
removeButton.setText(Messages.MavenArchetypesPreferencePage_btnRemove);
- removeButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory();
- archetypeCatalogs.remove(factory);
- archetypesViewer.setInput(archetypeCatalogs);
- archetypesViewer.setSelection(null, true);
- }
- });
+ removeButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory();
+ archetypeCatalogs.remove(factory);
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.setSelection(null, true);
+ }));
archetypesViewer.addSelectionChangedListener(event -> {
if(archetypesViewer.getSelection() instanceof IStructuredSelection) {
@@ -279,7 +260,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
archetypesViewer.refresh(event.getElement(), true);
});
- archetypeCatalogs = new ArrayList<ArchetypeCatalogFactory>(archetypeManager.getArchetypeCatalogs());
+ archetypeCatalogs = new ArrayList<>(archetypeManager.getArchetypeCatalogs());
archetypesViewer.setInput(archetypeCatalogs);
archetypeCatalogs.forEach(a -> archetypesViewer.setChecked(a, a.isEnabled()));
archetypesViewer.refresh(); // should listen on property changes instead?
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
index d5ca75d7..68febdae 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
@@ -36,8 +36,7 @@ import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -203,39 +202,33 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
globalSettingsLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
globalSettingsLink.setText(Messages.MavenSettingsPreferencePage_globalSettingslink2);
globalSettingsLink.setToolTipText(Messages.MavenSettingsPreferencePage_globalSettingslink_tooltip);
- globalSettingsLink.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ globalSettingsLink.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
String globalSettings = getGlobalSettings();
if(globalSettings != null) {
openEditor(globalSettings);
}
}
- });
+ ));
globalSettingsText = new Text(composite, SWT.BORDER);
globalSettingsText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Button globalSettingsBrowseButton = new Button(composite, SWT.NONE);
globalSettingsBrowseButton.setText(Messages.MavenSettingsPreferencePage_globalSettingsBrowseButton_text);
- globalSettingsBrowseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- browseSettingsAction(globalSettingsText);
- }
- });
+ globalSettingsBrowseButton
+ .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> browseSettingsAction(globalSettingsText)));
userSettingsLink = new Link(composite, SWT.NONE);
userSettingsLink.setText(Messages.MavenSettingsPreferencePage_userSettingslink2);
userSettingsLink.setToolTipText(Messages.MavenSettingsPreferencePage_userSettingslink_tooltip);
userSettingsLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- userSettingsLink.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String userSettings = getUserSettings();
- if(userSettings == null) {
- userSettings = SettingsXmlConfigurationProcessor.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath();
- }
- openEditor(userSettings);
+ userSettingsLink.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ String userSettings = getUserSettings();
+ if(userSettings == null) {
+ userSettings = SettingsXmlConfigurationProcessor.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath();
}
- });
+ openEditor(userSettings);
+ }));
userSettingsText = new Text(composite, SWT.BORDER);
userSettingsText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
userSettingsText.setMessage(SettingsXmlConfigurationProcessor.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath());
@@ -243,20 +236,13 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
Button userSettingsBrowseButton = new Button(composite, SWT.NONE);
userSettingsBrowseButton.setLayoutData(new GridData(SWT.FILL, SWT.RIGHT, false, false, 1, 1));
userSettingsBrowseButton.setText(Messages.MavenSettingsPreferencePage_userSettingsBrowseButton_text);
- userSettingsBrowseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- browseSettingsAction(userSettingsText);
- }
- });
+ userSettingsBrowseButton
+ .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> browseSettingsAction(userSettingsText)));
Button updateSettings = new Button(composite, SWT.NONE);
updateSettings.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
updateSettings.setText(Messages.MavenSettingsPreferencePage_btnUpdate);
- updateSettings.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateSettings(true);
- }
- });
+ updateSettings.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateSettings(true)));
Label localRepositoryLabel = new Label(composite, SWT.NONE);
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
gd.verticalIndent = 25;
@@ -270,18 +256,15 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
Button reindexButton = new Button(composite, SWT.NONE);
reindexButton.setLayoutData(new GridData(SWT.FILL, SWT.RIGHT, false, false, 1, 1));
reindexButton.setText(Messages.preferencesReindexButton);
- reindexButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- new WorkspaceJob(Messages.MavenSettingsPreferencePage_job_indexing) {
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- IndexManager indexManager = MavenPlugin.getIndexManager();
- indexManager.getWorkspaceIndex().updateIndex(true, monitor);
- return Status.OK_STATUS;
- }
- }.schedule();
- }
- });
+ reindexButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ new WorkspaceJob(Messages.MavenSettingsPreferencePage_job_indexing) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ IndexManager indexManager = MavenPlugin.getIndexManager();
+ indexManager.getWorkspaceIndex().updateIndex(true, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }));
ModifyListener settingsModifyListener = modifyevent -> {
updateLocalRepository();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
index d076159a..eedfbe8d 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
@@ -30,8 +30,7 @@ import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -165,47 +164,44 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
}
verifyButton = createButton(composite, VERIFY_ID, Messages.RemoteArchetypeCatalogDialog_btnVerify, false);
- verifyButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- verifyButton.setEnabled(false);
- String url = catalogUrlCombo.getText();
- final RemoteCatalogFactory factory = new RemoteCatalogFactory(url, null, true);
-
- new Job(Messages.RemoteArchetypeCatalogDialog_job_download) {
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- ArchetypeCatalog catalog = null;
- try {
- catalog = factory.getArchetypeCatalog();
- } finally {
- final IStatus s = status;
- final List<Archetype> archetypes = ((catalog == null) ? Collections.emptyList()
- : catalog.getArchetypes());
- Shell shell = getShell();
- if(shell == null) {
- return status;
- }
- shell.getDisplay().asyncExec(() -> {
- if(verifyButton.isDisposed()) {
- return;
- }
- verifyButton.setEnabled(true);
- if(!s.isOK()) {
- setErrorMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_error_read, s.getMessage()));
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- } else if(archetypes.size() == 0) {
- setMessage(Messages.RemoteArchetypeCatalogDialog_error_empty, IStatus.WARNING);
- } else {
- setMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_message_found, archetypes.size()),
- IStatus.INFO);
- }
- });
+ verifyButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ verifyButton.setEnabled(false);
+ String url = catalogUrlCombo.getText();
+ final RemoteCatalogFactory factory = new RemoteCatalogFactory(url, null, true);
+
+ new Job(Messages.RemoteArchetypeCatalogDialog_job_download) {
+ protected IStatus run(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ ArchetypeCatalog catalog = null;
+ try {
+ catalog = factory.getArchetypeCatalog();
+ } finally {
+ final IStatus s = status;
+ final List<Archetype> archetypes = ((catalog == null) ? Collections.emptyList() : catalog.getArchetypes());
+ Shell shell = getShell();
+ if(shell == null) {
+ return status;
}
- return Status.OK_STATUS;
+ shell.getDisplay().asyncExec(() -> {
+ if(verifyButton.isDisposed()) {
+ return;
+ }
+ verifyButton.setEnabled(true);
+ if(!s.isOK()) {
+ setErrorMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_error_read, s.getMessage()));
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ } else if(archetypes.size() == 0) {
+ setMessage(Messages.RemoteArchetypeCatalogDialog_error_empty, IStatus.WARNING);
+ } else {
+ setMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_message_found, archetypes.size()),
+ IStatus.INFO);
+ }
+ });
}
- }.schedule();
- }
- });
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }));
Label filler = new Label(composite, SWT.NONE);
filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationWizardPage.java
index 656f2138..8c97d9e0 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationWizardPage.java
@@ -30,8 +30,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -163,12 +162,7 @@ public class MavenInstallationWizardPage extends WizardPage {
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
btnExternal = new Button(composite, SWT.RADIO);
- btnExternal.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- changeRuntimeTypeAction();
- }
- });
+ btnExternal.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> changeRuntimeTypeAction()));
btnExternal.setText(Messages.MavenInstallationWizardPage_btnExternal_text_1);
btnWorkspace = new Button(composite, SWT.RADIO);
@@ -182,12 +176,7 @@ public class MavenInstallationWizardPage extends WizardPage {
location.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
btnDirectory = new Button(container, SWT.NONE);
- btnDirectory.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectLocationAction();
- }
- });
+ btnDirectory.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> selectLocationAction()));
btnDirectory.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnDirectory.setText(Messages.ExternalInstallPage_btnDirectory_text);
@@ -211,52 +200,27 @@ public class MavenInstallationWizardPage extends WizardPage {
treeLibraries.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 5));
btnAddProject = new Button(container, SWT.NONE);
- btnAddProject.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- addProjectExtensionAction();
- }
- });
+ btnAddProject.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> addProjectExtensionAction()));
btnAddProject.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnAddProject.setText(Messages.ExternalInstallPage_btnAddProject_text);
btnRemove = new Button(container, SWT.NONE);
- btnRemove.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- removeExtensionAction();
- }
- });
+ btnRemove.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> removeExtensionAction()));
btnRemove.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnRemove.setText(Messages.ExternalInstallPage_btnRemove_text);
btnUp = new Button(container, SWT.NONE);
- btnUp.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- moveExtensionAction(-1);
- }
- });
+ btnUp.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> moveExtensionAction(-1)));
btnUp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnUp.setText(Messages.ExternalInstallPage_btnUp_text);
btnDown = new Button(container, SWT.NONE);
- btnDown.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- moveExtensionAction(1);
- }
- });
+ btnDown.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> moveExtensionAction(1)));
btnDown.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnDown.setText(Messages.ExternalInstallPage_btnDown_text);
Button btnRestoreDefault = new Button(container, SWT.NONE);
- btnRestoreDefault.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- resetExtensionsAction();
- }
- });
+ btnRestoreDefault.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> resetExtensionsAction()));
btnRestoreDefault.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false, 1, 1));
btnRestoreDefault.setText(Messages.ExternalInstallPage_btnRestoreDefault_text);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationsPreferencePage.java
index 59812d43..15f05550 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/launch/MavenInstallationsPreferencePage.java
@@ -28,8 +28,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
@@ -207,50 +206,44 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
Button addButton = new Button(composite, SWT.NONE);
addButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
addButton.setText(Messages.MavenInstallationsPreferencePage_btnAdd);
- addButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MavenInstallationWizard wizard = new MavenInstallationWizard(getForbiddenNames(null));
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- if(dialog.open() == Window.OK) {
- runtimes.add(wizard.getResult());
- refreshRuntimesViewer();
- }
+ addButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ MavenInstallationWizard wizard = new MavenInstallationWizard(getForbiddenNames(null));
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ if(dialog.open() == Window.OK) {
+ runtimes.add(wizard.getResult());
+ refreshRuntimesViewer();
}
- });
+ }));
final Button editButton = new Button(composite, SWT.NONE);
editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
editButton.setEnabled(false);
editButton.setText(Messages.MavenInstallationsPreferencePage_btnEdit);
- editButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- AbstractMavenRuntime runtime = getSelectedMavenRuntime();
- MavenInstallationWizard wizard = new MavenInstallationWizard(runtime, getForbiddenNames(runtime));
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- if(dialog.open() == Window.OK) {
- AbstractMavenRuntime updatedRuntime = wizard.getResult();
- for(int i = 0; i < runtimes.size(); i++ ) {
- if(runtime == runtimes.get(i)) {
- runtimes.set(i, updatedRuntime);
- break;
- }
+ editButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ AbstractMavenRuntime runtime = getSelectedMavenRuntime();
+ MavenInstallationWizard wizard = new MavenInstallationWizard(runtime, getForbiddenNames(runtime));
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ if(dialog.open() == Window.OK) {
+ AbstractMavenRuntime updatedRuntime = wizard.getResult();
+ for(int i = 0; i < runtimes.size(); i++ ) {
+ if(runtime == runtimes.get(i)) {
+ runtimes.set(i, updatedRuntime);
+ break;
}
- refreshRuntimesViewer();
}
+ refreshRuntimesViewer();
}
- });
+ }));
final Button removeButton = new Button(composite, SWT.NONE);
removeButton.setEnabled(false);
removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
removeButton.setText(Messages.MavenInstallationsPreferencePage_btnRemove);
- removeButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- AbstractMavenRuntime runtime = getSelectedMavenRuntime();
- runtimes.remove(runtime);
- refreshRuntimesViewer();
- }
- });
+ removeButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ AbstractMavenRuntime runtime = getSelectedMavenRuntime();
+ runtimes.remove(runtime);
+ refreshRuntimesViewer();
+ }));
runtimesViewer.addSelectionChangedListener(event -> {
if(runtimesViewer.getSelection() instanceof IStructuredSelection) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
index 82cae48f..6eb7235c 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
@@ -51,8 +51,7 @@ import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -493,33 +492,25 @@ public class LifecycleMappingPage extends WizardPage {
errorCountLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Button btnNewButton_1 = new Button(composite, SWT.NONE);
- btnNewButton_1.addSelectionListener(new SelectionAdapter() {
- @Override
- @SuppressWarnings("synthetic-access")
- public void widgetSelected(SelectionEvent e) {
- mappingConfiguration.clearSelectedProposals();
- ignore.clear();
- ignoreAtDefinition.clear();
- ignoreWorkspace.clear();
- treeViewer.refresh();
- getWizard().getContainer().updateButtons(); // needed to enable/disable Finish button
- updateErrorCount();
- }
- });
+ btnNewButton_1.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ mappingConfiguration.clearSelectedProposals();
+ ignore.clear();
+ ignoreAtDefinition.clear();
+ ignoreWorkspace.clear();
+ treeViewer.refresh();
+ getWizard().getContainer().updateButtons(); // needed to enable/disable Finish button
+ updateErrorCount();
+ }));
btnNewButton_1.setText(Messages.LifecycleMappingPage_deselectAllButton);
autoSelectButton = new Button(composite, SWT.NONE);
- autoSelectButton.addSelectionListener(new SelectionAdapter() {
- @Override
- @SuppressWarnings("synthetic-access")
- public void widgetSelected(SelectionEvent e) {
- resetDetails();
- ignore.clear();
- ignoreAtDefinition.clear();
- ignoreWorkspace.clear();
- discoverProposals();
- }
- });
+ autoSelectButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ resetDetails();
+ ignore.clear();
+ ignoreAtDefinition.clear();
+ ignoreWorkspace.clear();
+ discoverProposals();
+ }));
autoSelectButton.setText(Messages.LifecycleMappingPage_autoSelectButton);
// Provide a reasonable height for the details box
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java
index fba8293a..b0bd58cf 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java
@@ -27,8 +27,7 @@ import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -122,47 +121,40 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
addDependencyButton.setLayoutData(gd_addDependencyButton);
addDependencyButton.setText(Messages.wizardProjectPageDependenciesAdd);
- addDependencyButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog
- .createSearchDependencyDialog(
- getShell(), //
- org.eclipse.m2e.core.ui.internal.Messages.MavenDependenciesWizardPage_searchDialog_title, null, null,
- false);
- if(dialog.open() == Window.OK) {
- Object result = dialog.getFirstResult();
- if(result instanceof IndexedArtifactFile) {
- Dependency dependency = ((IndexedArtifactFile) result).getDependency();
- dependency.setScope(dialog.getSelectedScope());
- dependencyViewer.add(dependency);
+ addDependencyButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog.createSearchDependencyDialog(getShell(), //
+ org.eclipse.m2e.core.ui.internal.Messages.MavenDependenciesWizardPage_searchDialog_title, null, null, false);
+ if(dialog.open() == Window.OK) {
+ Object result = dialog.getFirstResult();
+ if(result instanceof IndexedArtifactFile) {
+ Dependency dependency = ((IndexedArtifactFile) result).getDependency();
+ dependency.setScope(dialog.getSelectedScope());
+ dependencyViewer.add(dependency);
+ notifyListeners();
+ } else if(result instanceof IndexedArtifact) {
+ // If we have an ArtifactInfo, we add the first FileInfo it contains
+ // which corresponds to the latest version of the artifact.
+ Set<IndexedArtifactFile> files = ((IndexedArtifact) result).getFiles();
+ if(files != null && !files.isEmpty()) {
+ dependencyViewer.add(files.iterator().next().getDependency());
notifyListeners();
- } else if(result instanceof IndexedArtifact) {
- // If we have an ArtifactInfo, we add the first FileInfo it contains
- // which corresponds to the latest version of the artifact.
- Set<IndexedArtifactFile> files = ((IndexedArtifact) result).getFiles();
- if(files != null && !files.isEmpty()) {
- dependencyViewer.add(files.iterator().next().getDependency());
- notifyListeners();
- }
}
}
}
- });
+ }));
final Button removeDependencyButton = new Button(composite, SWT.PUSH);
removeDependencyButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
removeDependencyButton.setText(Messages.wizardProjectPageDependenciesRemove);
removeDependencyButton.setEnabled(false);
- removeDependencyButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) dependencyViewer.getSelection();
- if(selection != null) {
- dependencyViewer.remove(selection.toArray());
- notifyListeners();
- }
+ removeDependencyButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ IStructuredSelection selection = (IStructuredSelection) dependencyViewer.getSelection();
+ if(selection != null) {
+ dependencyViewer.remove(selection.toArray());
+ notifyListeners();
}
- });
+ }));
dependencyViewer.addSelectionChangedListener(event -> {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
index ab5d06a8..4cdea81a 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
@@ -55,6 +55,7 @@ import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -160,25 +161,23 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
final Button browseButton = new Button(composite, SWT.NONE);
browseButton.setText(Messages.wizardImportPageBrowse);
browseButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
- browseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
- dialog.setText(Messages.wizardImportPageSelectRootFolder);
- String path = rootDirectoryCombo.getText();
- if(path.length() == 0) {
- path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
- }
- dialog.setFilterPath(path);
-
- String result = dialog.open();
- if(result != null) {
- rootDirectoryCombo.setText(result);
- if(rootDirectoryChanged()) {
- scanProjects();
- }
+ browseButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
+ dialog.setText(Messages.wizardImportPageSelectRootFolder);
+ String path = rootDirectoryCombo.getText();
+ if(path.length() == 0) {
+ path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
+ }
+ dialog.setFilterPath(path);
+
+ String result = dialog.open();
+ if(result != null) {
+ rootDirectoryCombo.setText(result);
+ if(rootDirectoryChanged()) {
+ scanProjects();
}
}
- });
+ }));
rootDirectoryCombo.addListener(SWT.Traverse, e -> {
if(e.keyCode == SWT.CR && rootDirectoryChanged()) {
@@ -300,90 +299,61 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
projectTree.setMenu(menu);
MenuItem mntmSelectTree = new MenuItem(menu, SWT.NONE);
- mntmSelectTree.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- setProjectSubtreeChecked(true);
- }
- });
+ mntmSelectTree.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> setProjectSubtreeChecked(true)));
mntmSelectTree.setText(Messages.MavenImportWizardPage_mntmSelectTree_text);
MenuItem mntmDeselectTree = new MenuItem(menu, SWT.NONE);
- mntmDeselectTree.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- setProjectSubtreeChecked(false);
- }
- });
+ mntmDeselectTree
+ .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> setProjectSubtreeChecked(false)));
mntmDeselectTree.setText(Messages.MavenImportWizardPage_mntmDeselectTree_text);
final Button selectAllButton = new Button(composite, SWT.NONE);
selectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
selectAllButton.setText(Messages.wizardImportPageSelectAll);
- selectAllButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- projectTreeViewer.expandAll();
- setAllChecked(true);
- // projectTreeViewer.setSubtreeChecked(projectTreeViewer.getInput(), true);
- validate();
- }
- });
+ selectAllButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ projectTreeViewer.expandAll();
+ setAllChecked(true);
+ // projectTreeViewer.setSubtreeChecked(projectTreeViewer.getInput(), true);
+ validate();
+ }));
final Button deselectAllButton = new Button(composite, SWT.NONE);
deselectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
deselectAllButton.setText(Messages.wizardImportPageDeselectAll);
- deselectAllButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- setAllChecked(false);
- // projectTreeViewer.setSubtreeChecked(projectTreeViewer.getInput(), false);
- setPageComplete(false);
- }
- });
+ deselectAllButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ setAllChecked(false);
+ // projectTreeViewer.setSubtreeChecked(projectTreeViewer.getInput(), false);
+ setPageComplete(false);
+ }));
btnSelectTree = new Button(composite, SWT.NONE);
btnSelectTree.setEnabled(false);
- btnSelectTree.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- setProjectSubtreeChecked(true);
- }
- });
+ btnSelectTree.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> setProjectSubtreeChecked(true)));
btnSelectTree.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnSelectTree.setText(Messages.MavenImportWizardPage_btnSelectTree_text);
btnDeselectTree = new Button(composite, SWT.NONE);
btnDeselectTree.setEnabled(false);
- btnDeselectTree.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- setProjectSubtreeChecked(false);
- }
- });
+ btnDeselectTree.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> setProjectSubtreeChecked(false)));
btnDeselectTree.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnDeselectTree.setText(Messages.MavenImportWizardPage_btnDeselectTree_text);
final Button refreshButton = new Button(composite, SWT.NONE);
refreshButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
refreshButton.setText(Messages.wizardImportPageRefresh);
- refreshButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- scanProjects();
- }
- });
+ refreshButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> scanProjects()));
createWorkingSet = new Button(composite, SWT.CHECK);
createWorkingSet.setText(Messages.MavenImportWizardPage_createWorkingSet);
createWorkingSet.setSelection(true);
createWorkingSet.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
- createWorkingSet.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- boolean enabled = createWorkingSet.getSelection();
- workingSetName.setEnabled(enabled);
- if(enabled) {
- workingSetName.setFocus();
- }
+ createWorkingSet.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ boolean enabled = createWorkingSet.getSelection();
+ workingSetName.setEnabled(enabled);
+ if(enabled) {
+ workingSetName.setFocus();
}
- });
+ }));
workingSetName = new Combo(composite, SWT.BORDER);
GridData gd_workingSet = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
index 2a55c8a3..dcf1f95c 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
@@ -24,8 +24,7 @@ import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -104,17 +103,15 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
artifactFileNameButton.setLayoutData(new GridData());
artifactFileNameButton.setData("name", "externalPomFileButton"); //$NON-NLS-1$ //$NON-NLS-2$
artifactFileNameButton.setText(Messages.MavenInstallFileArtifactWizardPage_btnFilename);
- artifactFileNameButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FileDialog fileDialog = new FileDialog(artifactFileNameButton.getShell());
- fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
- fileDialog.setFileName(artifactFileNameText.getText());
- String name = fileDialog.open();
- if(name != null) {
- updateFileName(name);
- }
+ artifactFileNameButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ FileDialog fileDialog = new FileDialog(artifactFileNameButton.getShell());
+ fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
+ fileDialog.setFileName(artifactFileNameText.getText());
+ String name = fileDialog.open();
+ if(name != null) {
+ updateFileName(name);
}
- });
+ }));
Label pomFileNameLabel = new Label(container, SWT.NONE);
pomFileNameLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblPom);
@@ -131,17 +128,15 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
pomFileNameButton.setLayoutData(new GridData());
pomFileNameButton.setData("name", "externalPomFileButton"); //$NON-NLS-1$ //$NON-NLS-2$
pomFileNameButton.setText(Messages.MavenInstallFileArtifactWizardPage_btnPom);
- pomFileNameButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- FileDialog fileDialog = new FileDialog(pomFileNameButton.getShell());
- fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
- fileDialog.setFileName(pomFileNameText.getText());
- String res = fileDialog.open();
- if(res != null) {
- updatePOMFileName(res);
- }
+ pomFileNameButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ FileDialog fileDialog = new FileDialog(pomFileNameButton.getShell());
+ fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
+ fileDialog.setFileName(pomFileNameText.getText());
+ String res = fileDialog.open();
+ if(res != null) {
+ updatePOMFileName(res);
}
- });
+ }));
new Label(container, SWT.NONE);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java
index 9940f4de..006c7686 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java
@@ -19,8 +19,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -86,8 +85,7 @@ public class MavenLocationComponent extends Composite {
inWorkspaceButton = new Button(locationGroup, SWT.RADIO);
inWorkspaceButton.setText(Messages.locationComponentInWorkspace);
inWorkspaceButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
- inWorkspaceButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ inWorkspaceButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
boolean isEnabled = !inWorkspaceButton.getSelection();
locationLabel.setEnabled(isEnabled);
locationCombo.setEnabled(isEnabled);
@@ -96,7 +94,7 @@ public class MavenLocationComponent extends Composite {
modifyingListener.modifyText(null);
}
}
- });
+ ));
// second radio button
inExternalLocationButton = new Button(locationGroup, SWT.RADIO);
@@ -119,23 +117,21 @@ public class MavenLocationComponent extends Composite {
gridData = new GridData(SWT.FILL, SWT.DEFAULT, false, false);
locationBrowseButton.setLayoutData(gridData);
- locationBrowseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setText(Messages.locationComponentSelectLocation);
+ locationBrowseButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ DirectoryDialog dialog = new DirectoryDialog(getShell());
+ dialog.setText(Messages.locationComponentSelectLocation);
- String path = locationCombo.getText();
- if(path.length() == 0) {
- path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
- }
- dialog.setFilterPath(path);
+ String path = locationCombo.getText();
+ if(path.length() == 0) {
+ path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
+ }
+ dialog.setFilterPath(path);
- String selectedDir = dialog.open();
- if(selectedDir != null) {
- locationCombo.setText(selectedDir.trim());
- }
+ String selectedDir = dialog.open();
+ if(selectedDir != null) {
+ locationCombo.setText(selectedDir.trim());
}
- });
+ }));
inWorkspaceButton.setSelection(true);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java