summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorFred Bricon2011-08-10 07:54:12 (EDT)
committer Igor Fedorenko2011-09-29 20:36:41 (EDT)
commite2b586dc3d6628d408052e1f400d456322eed2f9 (patch)
treefe215b043a1345464a9fd23affb860160b5c4d06
parentdd52dc2fcec95f9a14e6f0c418cf5e2f9dcb0d55 (diff)
downloadm2e-core-e2b586dc3d6628d408052e1f400d456322eed2f9.zip
m2e-core-e2b586dc3d6628d408052e1f400d456322eed2f9.tar.gz
m2e-core-e2b586dc3d6628d408052e1f400d456322eed2f9.tar.bz2
345746 : fixed confusing title and message in Update Configuration dialog
Signed-off-by: Fred Bricon <fbricon@gmail.com>
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateDependenciesAction.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/SelectMavenProjectsDialog.java (renamed from org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateDepenciesDialog.java)55
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateConfigurationDialog.java33
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateDependenciesDialog.java33
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties2
7 files changed, 123 insertions, 12 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
index e7501e8..98d7289 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
@@ -629,6 +629,10 @@ public class Messages extends NLS {
public static String UpdateDepenciesDialog_selectTree;
public static String UpdateDepenciesDialog_title;
+
+ public static String UpdateConfigurationDialog_title;
+
+ public static String UpdateConfigurationDialog_dialogMessage;
public static String UpdateSourcesAction_error_cannot_update;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java
index 2372d1f..21cbe72 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateConfigurationAction.java
@@ -15,7 +15,7 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.window.Window;
import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
-import org.eclipse.m2e.core.ui.internal.dialogs.UpdateDepenciesDialog;
+import org.eclipse.m2e.core.ui.internal.dialogs.UpdateConfigurationDialog;
public class UpdateConfigurationAction extends MavenProjectActionSupport {
@@ -26,7 +26,7 @@ public class UpdateConfigurationAction extends MavenProjectActionSupport {
}
public void run(IAction action) {
- UpdateDepenciesDialog dialog = new UpdateDepenciesDialog(getShell(), getProjects());
+ UpdateConfigurationDialog dialog = new UpdateConfigurationDialog(getShell(), getProjects());
if(dialog.open() == Window.OK) {
new UpdateConfigurationJob(dialog.getSelectedProjects(), dialog.isOffline(), dialog.isForceUpdate()).schedule();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateDependenciesAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateDependenciesAction.java
index f4bb83c..9199c78 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateDependenciesAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/UpdateDependenciesAction.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.window.Window;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IMavenProjectRegistry;
import org.eclipse.m2e.core.project.MavenUpdateRequest;
-import org.eclipse.m2e.core.ui.internal.dialogs.UpdateDepenciesDialog;
+import org.eclipse.m2e.core.ui.internal.dialogs.UpdateDependenciesDialog;
public class UpdateDependenciesAction extends MavenProjectActionSupport {
@@ -28,7 +28,7 @@ public class UpdateDependenciesAction extends MavenProjectActionSupport {
}
public void run(IAction action) {
- UpdateDepenciesDialog dialog = new UpdateDepenciesDialog(getShell(), getProjects());
+ UpdateDependenciesDialog dialog = new UpdateDependenciesDialog(getShell(), getProjects());
if(dialog.open() == Window.OK) {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
projectManager.refresh(new MavenUpdateRequest(dialog.getSelectedProjects(), //
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateDepenciesDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/SelectMavenProjectsDialog.java
index 5a62763..f8a6c84 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateDepenciesDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/SelectMavenProjectsDialog.java
@@ -60,9 +60,9 @@ import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.ui.internal.MavenImages;
import org.eclipse.m2e.core.ui.internal.Messages;
-public class UpdateDepenciesDialog extends TitleAreaDialog implements IMenuListener {
+public class SelectMavenProjectsDialog extends TitleAreaDialog implements IMenuListener {
- private static final Logger log = LoggerFactory.getLogger(UpdateDepenciesDialog.class);
+ private static final Logger log = LoggerFactory.getLogger(SelectMavenProjectsDialog.class);
private static final String SEPARATOR = System.getProperty("file.separator"); //$NON-NLS-1$
@@ -83,11 +83,16 @@ public class UpdateDepenciesDialog extends TitleAreaDialog implements IMenuListe
private boolean offlineMode;
private boolean forceUpdate;
-
- public UpdateDepenciesDialog(Shell parentShell, IProject[] initialSelection) {
+
+ protected String dialogTitle;
+
+ protected String dialogMessage;
+
+ public SelectMavenProjectsDialog(Shell parentShell, IProject[] initialSelection, String title, String dialogMessage) {
super(parentShell);
this.initialSelection = initialSelection;
-
+ this.dialogTitle = title;
+ this.dialogMessage = dialogMessage;
offlineMode = MavenPlugin.getMavenConfiguration().isOffline();
forceUpdate = false;
}
@@ -95,7 +100,7 @@ public class UpdateDepenciesDialog extends TitleAreaDialog implements IMenuListe
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
- shell.setText(Messages.UpdateDepenciesDialog_title);
+ shell.setText(getDialogTitle());
}
/**
@@ -271,8 +276,8 @@ public class UpdateDepenciesDialog extends TitleAreaDialog implements IMenuListe
forceUpdateBtn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
forceUpdateBtn.setSelection(forceUpdate);
- setTitle(Messages.UpdateDepenciesDialog_title);
- setMessage(Messages.UpdateDepenciesDialog_dialogMessage);
+ setTitle(getDialogTitle());
+ setMessage(getDialogMessage());
createMenu();
return area;
}
@@ -406,4 +411,38 @@ public class UpdateDepenciesDialog extends TitleAreaDialog implements IMenuListe
codebaseViewer.setSubtreeChecked(getSelection(), false);
}
};
+
+ /**
+ * @return Returns the dialogTitle or an empty String if the value is null.
+ */
+ public String getDialogTitle() {
+ if (dialogTitle == null) {
+ dialogTitle = ""; //$NON-NLS-1$
+ }
+ return dialogTitle;
+ }
+
+ /**
+ * @return Returns the dialogMessage or an empty String if the value is null.
+ */
+ public String getDialogMessage() {
+ if (dialogMessage == null) {
+ dialogMessage = ""; //$NON-NLS-1$
+ }
+ return dialogMessage;
+ }
+
+ /**
+ * @param dialogTitle The dialogTitle to set.
+ */
+ public void setDialogTitle(String dialogTitle) {
+ this.dialogTitle = dialogTitle;
+ }
+
+ /**
+ * @param dialogMessage The dialogMessage to set.
+ */
+ public void setDialogMessage(String dialogMessage) {
+ this.dialogMessage = dialogMessage;
+ }
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateConfigurationDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateConfigurationDialog.java
new file mode 100644
index 0000000..a6cc257
--- /dev/null
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateConfigurationDialog.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.m2e.core.ui.internal.dialogs;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.m2e.core.ui.internal.Messages;
+
+/**
+ * Update Maven Project Configuration Dialog
+ *
+ * @author Fred Bricon
+ */
+public class UpdateConfigurationDialog extends SelectMavenProjectsDialog {
+
+ /**
+ * @param parentShell
+ * @param initialSelection
+ */
+ public UpdateConfigurationDialog(Shell parentShell, IProject[] initialSelection) {
+ super(parentShell, initialSelection, Messages.UpdateConfigurationDialog_title, Messages.UpdateConfigurationDialog_dialogMessage);
+ }
+
+}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateDependenciesDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateDependenciesDialog.java
new file mode 100644
index 0000000..489035c
--- /dev/null
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateDependenciesDialog.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.m2e.core.ui.internal.dialogs;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.m2e.core.ui.internal.Messages;
+
+/**
+ * Update Maven Project Dependencies Dialog
+ *
+ * @author Fred Bricon
+ */
+public class UpdateDependenciesDialog extends SelectMavenProjectsDialog {
+
+ /**
+ * @param parentShell
+ * @param initialSelection
+ */
+ public UpdateDependenciesDialog(Shell parentShell, IProject[] initialSelection) {
+ super(parentShell, initialSelection, Messages.UpdateDepenciesDialog_title, Messages.UpdateDepenciesDialog_dialogMessage);
+ }
+
+}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
index 8879791..3f29214 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
@@ -304,6 +304,8 @@ UpdateDepenciesDialog_offline=&Offline
UpdateDepenciesDialog_selectAll=&Select All
UpdateDepenciesDialog_selectTree=Select Tree
UpdateDepenciesDialog_title=Update Maven Dependencies
+UpdateConfigurationDialog_dialogMessage=Select Maven codebases to update project configuration
+UpdateConfigurationDialog_title=Update Maven Project Configuration
UpdateSourcesAction_error_cannot_update=Unable to update Maven configuration
UpdateSourcesAction_error_message=Unable to update maven configuration for the following projects\:
UpdateSourcesAction_error_title=Error Updating Maven Configuration