Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2014-08-11 08:54:53 -0400
committerIgor Fedorenko2014-08-14 13:50:09 -0400
commit88b5d399020465ddd9e0a633f70410ff0c2222f5 (patch)
tree368b79d614ddfa8249fb4f193d453e445b01b6ec /org.eclipse.m2e.launching
parent7d834955b05db2177fed5c394cbb970ac07985c1 (diff)
downloadm2e-core-88b5d399020465ddd9e0a633f70410ff0c2222f5.tar.gz
m2e-core-88b5d399020465ddd9e0a633f70410ff0c2222f5.tar.xz
m2e-core-88b5d399020465ddd9e0a633f70410ff0c2222f5.zip
344997 Fixed select goals dialog always shows no entries
Removed Select goals button from maven launch configuration UI. This opened a dialog which never showed any entries, which was confusing to the users" Change-Id: If04de1b1dea3fbafffdfeb3afe71dbd029994fc9 Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
Diffstat (limited to 'org.eclipse.m2e.launching')
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java65
1 files changed, 3 insertions, 62 deletions
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
index 495d607d..a121e719 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
+ * Copyright (c) 2008-2014 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Sonatype, Inc. - initial API and implementation
+ * Lars Vogel <Lars.Vogel@gmail.com> - Bug 344997, remove goal selection button
*******************************************************************************/
package org.eclipse.m2e.ui.internal.launch;
@@ -62,7 +63,6 @@ import org.eclipse.m2e.actions.MavenLaunchConstants;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.m2e.core.ui.internal.dialogs.MavenGoalSelectionDialog;
import org.eclipse.m2e.core.ui.internal.dialogs.MavenPropertyDialog;
import org.eclipse.m2e.internal.launch.LaunchingUtils;
import org.eclipse.m2e.internal.launch.Messages;
@@ -229,19 +229,12 @@ public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implement
goalsLabel.setText(Messages.launchGoalsLabel); //$NON-NLS-1$
goalsText = new Text(mainComposite, SWT.BORDER);
goalsText.setData("name", "goalsText"); //$NON-NLS-1$ //$NON-NLS-2$
- GridData gd_goalsText = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
+ GridData gd_goalsText = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
gd_goalsText.verticalIndent = 7;
goalsText.setLayoutData(gd_goalsText);
goalsText.addModifyListener(modyfyingListener);
goalsText.addFocusListener(new GoalsFocusListener(goalsText));
- Button selectGoalsButton = new Button(mainComposite, SWT.NONE);
- GridData gd_selectGoalsButton = new GridData(SWT.FILL, SWT.CENTER, false, false);
- gd_selectGoalsButton.verticalIndent = 7;
- selectGoalsButton.setLayoutData(gd_selectGoalsButton);
- selectGoalsButton.setText(Messages.launchGoals); //$NON-NLS-1$
- selectGoalsButton.addSelectionListener(new GoalSelectionAdapter(goalsText));
-
Label profilesLabel = new Label(mainComposite, SWT.NONE);
profilesLabel.setText(Messages.launchProfilesLabel); //$NON-NLS-1$
// profilesLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
@@ -655,56 +648,4 @@ public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implement
}
}
- private final class GoalSelectionAdapter extends SelectionAdapter {
- private Text text;
-
- public GoalSelectionAdapter(Text text) {
- this.text = text;
- }
-
- public void widgetSelected(SelectionEvent e) {
-// String fileName = Util.substituteVar(fPomDirName.getText());
-// if(!isDirectoryExist(fileName)) {
-// MessageDialog.openError(getShell(), Messages.getString("launch.errorPomMissing"),
-// Messages.getString("launch.errorSelectPom")); //$NON-NLS-1$ //$NON-NLS-2$
-// return;
-// }
- MavenGoalSelectionDialog dialog = new MavenGoalSelectionDialog(getShell());
- int rc = dialog.open();
- if(rc == IDialogConstants.OK_ID) {
- text.insert(""); // clear selected text //$NON-NLS-1$
-
- String txt = text.getText();
- int len = txt.length();
- int pos = text.getCaretPosition();
-
- StringBuffer sb = new StringBuffer();
- if((pos > 0 && txt.charAt(pos - 1) != ' ')) {
- sb.append(' ');
- }
-
- String sep = ""; //$NON-NLS-1$
- Object[] o = dialog.getResult();
- for(int i = 0; i < o.length; i++ ) {
- if(o[i] instanceof MavenGoalSelectionDialog.Entry) {
- if(dialog.isQualifiedName()) {
- sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getQualifiedName());
- } else {
- sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getName());
- }
- }
- sep = " "; //$NON-NLS-1$
- }
-
- if(pos < len && txt.charAt(pos) != ' ') {
- sb.append(' ');
- }
-
- text.insert(sb.toString());
- text.setFocus();
- entriesChanged();
- }
- }
- }
-
}

Back to the top