Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Piggott2011-04-19 01:26:14 -0400
committerMatthew Piggott2011-04-19 01:27:13 -0400
commit9c4c9e6f0c3b7f1636ba2ca0975d8b2aea7ae613 (patch)
tree4bc9be734dcc0a0aaa3fd85e4c38648cfbf7277b /org.eclipse.m2e.core.ui
parent903e349338bfabcccb07e9916c3e16c8e6909427 (diff)
downloadm2e-core-9c4c9e6f0c3b7f1636ba2ca0975d8b2aea7ae613.tar.gz
m2e-core-9c4c9e6f0c3b7f1636ba2ca0975d8b2aea7ae613.tar.xz
m2e-core-9c4c9e6f0c3b7f1636ba2ca0975d8b2aea7ae613.zip
Code cleanup
Diffstat (limited to 'org.eclipse.m2e.core.ui')
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java13
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java34
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java8
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java35
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java7
5 files changed, 50 insertions, 47 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java
index 4ac39df7..e42e4ba0 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java
@@ -13,17 +13,18 @@ package org.eclipse.m2e.core.ui.internal.console;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
-import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.m2e.core.ui.internal.actions.MavenConsoleRemoveAction;
-import org.eclipse.m2e.core.ui.internal.actions.MavenDebugOutputAction;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.IConsolePageParticipant;
import org.eclipse.ui.part.IPageBookViewPage;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.actions.MavenConsoleRemoveAction;
+import org.eclipse.m2e.core.ui.internal.actions.MavenDebugOutputAction;
+
public class MavenConsolePageParticipant implements IConsolePageParticipant {
@@ -65,7 +66,7 @@ public class MavenConsolePageParticipant implements IConsolePageParticipant {
public void deactivated() {
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
return null;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java
index ded8ef75..f078005a 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java
@@ -15,27 +15,12 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.DependencyManagement;
-import org.apache.maven.model.Parent;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.PluginManagement;
-import org.apache.maven.project.MavenProject;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.index.IIndex;
-import org.eclipse.m2e.core.index.IndexedArtifact;
-import org.eclipse.m2e.core.index.IndexedArtifactFile;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.search.util.Packaging;
-import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
-import org.eclipse.m2e.core.ui.internal.util.ProposalUtil;
-import org.eclipse.m2e.core.ui.internal.wizards.MavenPomSelectionComponent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -48,6 +33,23 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginManagement;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.search.util.Packaging;
+import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
+import org.eclipse.m2e.core.ui.internal.util.ProposalUtil;
+import org.eclipse.m2e.core.ui.internal.wizards.MavenPomSelectionComponent;
+
/**
* Maven POM Search dialog
*
@@ -388,7 +390,7 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
if (!managed.contains(new ArtifactKey(selectedIndexedArtifactFile.group, selectedIndexedArtifactFile.artifact, selectedIndexedArtifactFile.version, selectedIndexedArtifactFile.classifier))) {
txtVersion.setText(selectedIndexedArtifactFile.version);
} else {
- txtVersion.setText("");
+ txtVersion.setText(""); //$NON-NLS-1$
}
} finally {
ignoreTextChange = false;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
index 5c624ac2..09647533 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
@@ -331,7 +331,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
if(f.exists()){
showURL = true;
}
- String openFile = showURL ? Messages.MavenInstallationsPreferencePage_link_open : "";
+ String openFile = showURL ? Messages.MavenInstallationsPreferencePage_link_open : ""; //$NON-NLS-1$
if(runtime instanceof MavenEmbeddedRuntime){
text = NLS.bind(Messages.MavenInstallationsPreferencePage_settings, openFile);
} else {
@@ -539,7 +539,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
browser.openURL(url);
} catch(MalformedURLException ex) {
- log.error("Malformed URL", ex);
+ log.error("Malformed URL", ex); //$NON-NLS-1$
} catch(PartInitException ex) {
log.error(ex.getMessage(), ex);
}
@@ -582,7 +582,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
void openEditor(final String fileName) {
// XXX create new settings.xml if does not exist
@@ -615,7 +615,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
editor.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propId) {
if(!editor.isDirty()) {
- log.info("Refreshing settings " + fileName);
+ log.info("Refreshing settings " + fileName); //$NON-NLS-1$
invalidateMavenSettings(false);
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
index f93359d9..2973915f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
@@ -17,7 +17,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
-import org.apache.lucene.search.BooleanQuery;
+import com.ibm.icu.text.DateFormat;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -35,16 +36,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.index.IIndex;
-import org.eclipse.m2e.core.index.IndexManager;
-import org.eclipse.m2e.core.index.IndexedArtifact;
-import org.eclipse.m2e.core.index.IndexedArtifactFile;
-import org.eclipse.m2e.core.index.UserInputSearchExpression;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.MavenImages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
@@ -64,7 +55,18 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
-import com.ibm.icu.text.DateFormat;
+import org.apache.lucene.search.BooleanQuery;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.index.UserInputSearchExpression;
+import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -218,7 +220,7 @@ public class MavenPomSelectionComponent extends Composite {
}
searchResultViewer.setContentProvider(new SearchResultContentProvider());
- searchResultViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new SearchResultLabelProvider(artifactKeys, managedKeys, queryType)));
+ searchResultViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new SearchResultLabelProvider(artifactKeys, managedKeys)));
searchResultViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
@@ -385,7 +387,7 @@ public class MavenPomSelectionComponent extends Composite {
LinkedHashMap<String, IndexedArtifact> managed = new LinkedHashMap<String, IndexedArtifact>();
LinkedHashMap<String, IndexedArtifact> nonManaged = new LinkedHashMap<String, IndexedArtifact>();
for (Map.Entry<String, IndexedArtifact> art : res.entrySet()) {
- String key = art.getValue().getGroupId() + ":" + art.getValue().getArtifactId();
+ String key = art.getValue().getGroupId() + ":" + art.getValue().getArtifactId(); //$NON-NLS-1$
if (managedKeys.contains(key)) {
managed.put(art.getKey(), art.getValue());
} else {
@@ -431,18 +433,15 @@ public class MavenPomSelectionComponent extends Composite {
public static class SearchResultLabelProvider extends LabelProvider implements IColorProvider, DelegatingStyledCellLabelProvider.IStyledLabelProvider {
private final Set<String> artifactKeys;
- private final String queryType;
private final Set<String> managedKeys;
/**
* both managedkeys and artifctkeys are supposed to hold both gr:art:ver combos and gr:art combos
* @param artifactKeys
* @param managedKeys
- * @param queryType
*/
- public SearchResultLabelProvider(Set<String> artifactKeys, Set<String> managedKeys, String queryType) {
+ public SearchResultLabelProvider(Set<String> artifactKeys, Set<String> managedKeys) {
this.artifactKeys = artifactKeys;
- this.queryType = queryType;
this.managedKeys = managedKeys;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
index c4b6a62b..c501191f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
@@ -186,6 +186,7 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
}
/** Creates the archetype table viewer. */
+ @SuppressWarnings({"unchecked", "rawtypes"})
private void createViewer(Composite parent) {
Label catalogsLabel = new Label(parent, SWT.NONE);
catalogsLabel.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_lblCatalog);
@@ -251,7 +252,6 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
});
final ArchetypeManager archetypeManager = MavenPluginActivator.getDefault().getArchetypeManager();
- Collection<ArchetypeCatalogFactory> archetypeCatalogs = archetypeManager.getArchetypeCatalogs();
ArrayList allCatalogs = new ArrayList(archetypeManager.getArchetypeCatalogs());
allCatalogs.add(0, ALL_CATALOGS);
catalogsComboViewer.setInput(allCatalogs);
@@ -495,6 +495,7 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
}
}
+ @SuppressWarnings("unchecked")
private List<Archetype> getAllArchetypes() {
ArchetypeManager manager = MavenPluginActivator.getDefault().getArchetypeManager();
Collection<ArchetypeCatalogFactory> archetypeCatalogs = manager.getArchetypeCatalogs();
@@ -507,13 +508,13 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
if(catalog.getDescription().startsWith("Test")) { //$NON-NLS-1$
continue;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
List arcs = catalog.getArchetypeCatalog().getArchetypes();
if(arcs != null) {
list.addAll(arcs);
}
} catch(Exception ce) {
- log.error("Unable to read archetype catalog: " + catalog.getId(), ce);
+ log.error("Unable to read archetype catalog: " + catalog.getId(), ce); //$NON-NLS-1$
}
}
return list;

Back to the top