Author: rob.stryker(a)jboss.com
Date: 2011-07-18 10:33:16 -0400 (Mon, 18 Jul 2011)
New Revision: 33019
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
JBIDE-9349 - ui cleanup to properly show when a new server is created the correct status
of it's jre choice.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2011-07-18
14:15:36 UTC (rev 33018)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2011-07-18
14:33:16 UTC (rev 33019)
@@ -31,6 +31,7 @@
public static String
PROPERTY_CONFIG_LOCATION="org.jboss.ide.eclipse.as.core.runtime.configurationLocation";
//$NON-NLS-1$
public IRuntime getRuntime();
+ public IVMInstall getHardVM();
public IVMInstall getVM();
public void setVM(IVMInstall install);
public IExecutionEnvironment getExecutionEnvironment();
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java 2011-07-18
14:15:36 UTC (rev 33018)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java 2011-07-18
14:33:16 UTC (rev 33019)
@@ -56,7 +56,8 @@
return base + " " + i; //$NON-NLS-1$
}
- public IVMInstall getVM() {
+ /* Return a vm that is hard-coded in the runtime's attributes*/
+ public IVMInstall getHardVM() {
if (getVMInstallTypeId() != null) {
String id = getAttribute(PROPERTY_VM_ID, (String)null);
String type = getAttribute(PROPERTY_VM_TYPE_ID, (String)null);
@@ -69,6 +70,14 @@
return vmInstalls[i];
}
}
+ return null;
+ }
+
+ public IVMInstall getVM() {
+ IVMInstall hard = getHardVM();
+ if( hard != null )
+ return hard;
+
if( getExecutionEnvironment() != null ) {
IVMInstall[] installs = getExecutionEnvironment().getCompatibleVMs();
if( getExecutionEnvironment().getDefaultVM() != null )
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-07-18
14:15:36 UTC (rev 33018)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2011-07-18
14:33:16 UTC (rev 33019)
@@ -38,6 +38,7 @@
public static String wf_HomeDirLabel;
public static String wf_JRELabel;
public static String wf_ConfigLabel;
+ public static String wf_ExecEnvironmentLabel;
public static String J2EEModuleExportOperation_could_not_export_module;
public static String J2EEModuleExportOperation_ErrorExportingArchive;
@@ -63,6 +64,7 @@
public static String rwf_NoVMSelected;
public static String rwf_jre6NotFound;
public static String rwf_noValidJRE;
+ public static String rwf_DefaultJREForExecEnv;
public static String swf_Title;
public static String swf_RuntimeInformation;
public static String swf_AuthorizationDescription;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-07-18
14:15:36 UTC (rev 33018)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2011-07-18
14:33:16 UTC (rev 33019)
@@ -7,6 +7,7 @@
wf_NameLabel=Name
wf_HomeDirLabel=Home Directory
wf_JRELabel=JRE
+wf_ExecEnvironmentLabel=Execution Environment
wf_ConfigLabel=Configuration
rwf_CopyConfigLabel=Copy configuration "{0}" to a new destination from
"{1}".
rwf_DestinationLabel=Destination
@@ -21,6 +22,7 @@
rwf_NoVMSelected=No VM selected
rwf_jre6NotFound=No Java 6 runtime environment found
rwf_noValidJRE=No valid JREs found for execution environment "{0}"
+rwf_DefaultJREForExecEnv=Default JRE for {0}
J2EEModuleExportOperation_could_not_export_module=Could not export module {1} to {0}.
J2EEModuleExportOperation_ErrorExportingArchive=Error Exporting Archive: {0}
JBAS_version=JBoss Application Server {0}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2011-07-18
14:15:36 UTC (rev 33018)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2011-07-18
14:33:16 UTC (rev 33019)
@@ -740,7 +740,7 @@
size = size+1;
int index = 0;
jreNames = new String[size];
- jreNames[index++] = "Default JRE for " +
getRuntime().getExecutionEnvironment().getId(); //$NON-NLS-1$
+ jreNames[index++] = NLS.bind(Messages.rwf_DefaultJREForExecEnv,
getRuntime().getExecutionEnvironment().getId());
for (int i = 0; i < installedJREs.size(); i++) {
IVMInstall vmInstall = installedJREs.get(i);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2011-07-18
14:15:36 UTC (rev 33018)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2011-07-18
14:33:16 UTC (rev 33019)
@@ -1,23 +1,13 @@
-/*
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.ui.wizards;
@@ -26,6 +16,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osgi.util.NLS;
@@ -48,6 +39,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI.IServerModeUICallback;
import org.jboss.ide.eclipse.as.ui.editor.ServerModeSectionComposite;
@@ -60,8 +52,8 @@
private IWizardHandle handle;
private Label serverExplanationLabel,
runtimeExplanationLabel;
- private Label homeDirLabel, installedJRELabel, configLabel;
- private Label homeValLabel, jreValLabel, configValLabel, configLocValLabel;
+ private Label homeDirLabel, execEnvironmentLabel, installedJRELabel, configLabel;
+ private Label homeValLabel, execEnvironmentValLabel, jreValLabel, configValLabel,
configLocValLabel;
private Group runtimeGroup;
@@ -120,10 +112,7 @@
runtimeGroup = new Group(main, SWT.NONE);
runtimeGroup.setText(Messages.swf_RuntimeInformation);
- FormData groupData = new FormData();
- groupData.left = new FormAttachment(0,5);
- groupData.right = new FormAttachment(100, -5);
- groupData.top = new FormAttachment(serverExplanationLabel, 5);
+ FormData groupData = UIUtil.createFormData2(serverExplanationLabel, 5, null, 0,
0,5,100,-5);
runtimeGroup.setLayoutData(groupData);
runtimeGroup.setLayout(new GridLayout(2, false));
@@ -141,6 +130,11 @@
homeDirLabel.setText(Messages.wf_HomeDirLabel);
homeValLabel = new Label(runtimeGroup, SWT.NONE);
homeValLabel.setLayoutData(d);
+ execEnvironmentLabel = new Label(runtimeGroup, SWT.NONE);
+ execEnvironmentLabel.setText(Messages.wf_ExecEnvironmentLabel);
+ execEnvironmentValLabel= new Label(runtimeGroup, SWT.NONE);
+ d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
+ execEnvironmentValLabel.setLayoutData(d);
installedJRELabel = new Label(runtimeGroup, SWT.NONE);
installedJRELabel.setText(Messages.wf_JRELabel);
@@ -208,7 +202,11 @@
IJBossServerRuntime srt = getRuntime();
homeValLabel.setText(srt.getRuntime().getLocation().toOSString());
configValLabel.setText(srt.getJBossConfiguration());
- jreValLabel.setText(srt.getVM().getInstallLocation().getAbsolutePath() + "
(" + srt.getVM().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ execEnvironmentValLabel.setText(srt.getExecutionEnvironment().getDescription());
+ IVMInstall vm = srt.getHardVM();
+ String jreVal = vm == null ? NLS.bind(Messages.rwf_DefaultJREForExecEnv,
getRuntime().getExecutionEnvironment().getId()) :
+ vm.getInstallLocation().getAbsolutePath() + " (" + vm.getName() +
")";//$NON-NLS-1$ //$NON-NLS-2$
+ jreValLabel.setText(jreVal);
configLocValLabel.setText(srt.getConfigLocation());
runtimeGroup.layout();
updateErrorMessage();