Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-07-31 03:58:16 -0400
committerIgor Fedorenko2011-07-31 03:58:16 -0400
commitc47e215285d7c562d2e8c98c52a80349abe070b6 (patch)
tree7960aca2bfe35fdf5b1745332a7bb24c1b407dfd /org.eclipse.m2e.editor
parente288b8a47e935b50a091b259cb96beebbe5c3ee7 (diff)
parent74e41f5cadf4d515ccb47e38a8656a7b111ef457 (diff)
downloadm2e-core-c47e215285d7c562d2e8c98c52a80349abe070b6.tar.gz
m2e-core-c47e215285d7c562d2e8c98c52a80349abe070b6.tar.xz
m2e-core-c47e215285d7c562d2e8c98c52a80349abe070b6.zip
Merge remote-tracking branch 'origin/master' into m2e-self-hosting
Diffstat (limited to 'org.eclipse.m2e.editor')
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java20
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java31
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java2
3 files changed, 25 insertions, 28 deletions
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
index b6ff0272..d3c23aae 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
@@ -607,26 +607,6 @@ public class DependenciesComposite extends Composite {
}
- /** mkleint: apparently this methods shall find the version in resolved pom for the given dependency
- * not sure if getBaseVersion is the way to go..
- * Note: duplicated in DependencyDetailsComposite
- * @param groupId
- * @param artifactId
- * @param monitor
- * @return
- */
- String getVersion(String groupId, String artifactId, IProgressMonitor monitor) {
- try {
- MavenProject mavenProject = editorPage.getPomEditor().readMavenProject(false, monitor);
- Artifact a = mavenProject.getArtifactMap().get(groupId + ":" + artifactId); //$NON-NLS-1$
- if(a != null) {
- return a.getBaseVersion();
- }
- } catch(CoreException ex) {
- log.error(ex.getMessage(), ex);
- }
- return null;
- }
public static class DependencyFilter extends ViewerFilter {
private SearchMatcher searchMatcher;
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
index ebef4b0f..324f3bdb 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
@@ -139,7 +139,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
StructuredTextEditor effectivePomSourcePage;
- List<MavenPomEditorPage> pages = new ArrayList<MavenPomEditorPage>();
+ private List<MavenPomEditorPage> mavenpomEditorPages = new ArrayList<MavenPomEditorPage>();
private Map<String, org.sonatype.aether.graph.DependencyNode> rootNodes = new HashMap<String, org.sonatype.aether.graph.DependencyNode>();
@@ -300,7 +300,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- for(MavenPomEditorPage page : pages) {
+ for(MavenPomEditorPage page : getMavenPomEditorPages()) {
page.setErrorMessage(msg, msg == null ? IMessageProvider.NONE : severity);
}
}
@@ -322,8 +322,11 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
public void reload() {
int active = getActivePage();
- if (active > -1) {
- MavenPomEditorPage page = getPages().get(active);
+ //this code assumes the MavenPomEditorPages are the first ones in the list..
+ //currenty the case, effective+xml editor are at the end..
+ //if this constraint changes, we need to find the active page in the super.pages list first and check for instanceof
+ if (active > -1 && active < getMavenPomEditorPages().size()) {
+ MavenPomEditorPage page = getMavenPomEditorPages().get(active);
page.loadData();
}
if(isEffectiveActive()){
@@ -666,7 +669,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
private int addPomPage(IFormPage page) {
try {
if(page instanceof MavenPomEditorPage) {
- pages.add((MavenPomEditorPage) page);
+ mavenpomEditorPages.add((MavenPomEditorPage) page);
}
if (page instanceof IPomFileChangedListener) {
fileChangeListeners.add((IPomFileChangedListener) page);
@@ -858,8 +861,22 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
return sourcePage.isDirty();
}
+ /**
+ * returns only the pages that implement MavenPomEditorPage
+ * will not return the effective pom and xml editor page for example..
+ * @return
+ */
+ public List<MavenPomEditorPage> getMavenPomEditorPages() {
+ return mavenpomEditorPages;
+ }
+
+ /**
+ * use the <code>getMavenPomEditorPages()</code> method instead
+ * @return
+ */
+ @Deprecated
public List<MavenPomEditorPage> getPages() {
- return pages;
+ return getMavenPomEditorPages();
}
public void showDependencyHierarchy(ArtifactKey artifactKey) {
@@ -1089,7 +1106,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
if (getContainer() != null && !getContainer().isDisposed())
getContainer().getDisplay().asyncExec(new Runnable() {
public void run() {
- for (MavenPomEditorPage page : getPages()) {
+ for (MavenPomEditorPage page : getMavenPomEditorPages()) {
page.mavenProjectHasChanged();
}
}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
index f5e58998..3ca126af 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
@@ -338,8 +338,8 @@ public abstract class MavenPomEditorPage extends FormPage {
if (getPartControl() != null && !getPartControl().isDisposed()) {
getPartControl().getDisplay().asyncExec(new Runnable() {
public void run() {
- FormHoverProvider.Execute runnable = FormHoverProvider.createHoverRunnable(getManagedForm().getForm().getShell(), markers, getPomEditor().getSourcePage().getTextViewer());
if (!getManagedForm().getForm().isDisposed()) {
+ FormHoverProvider.Execute runnable = FormHoverProvider.createHoverRunnable(getManagedForm().getForm().getShell(), markers, getPomEditor().getSourcePage().getTextViewer());
if (runnable != null) {
FormUtils.setMessageWithPerformer(getManagedForm().getForm(), msg, severity, runnable);
} else {

Back to the top