Author: rob.stryker(a)jboss.com
Date: 2007-08-21 20:21:20 -0400 (Tue, 21 Aug 2007)
New Revision: 3266
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.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/editor/StrippedServerDeploySection.java
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
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java
Log:
UI cleanup. Every Label uses Messages class now.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java 2007-08-21
21:05:27 UTC (rev 3265)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java 2007-08-22
00:21:20 UTC (rev 3266)
@@ -56,6 +56,8 @@
public class JBossServer extends ServerDelegate
implements IServerStartupParameters, IDeployableServer, IURLProvider {
+ public static final String SERVER_USERNAME =
"org.jboss.ide.eclipse.as.core.server.userName";
+ public static final String SERVER_PASSWORD =
"org.jboss.ide.eclipse.as.core.server.password";
public JBossServer() {
}
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 2007-08-21
21:05:27 UTC (rev 3265)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2007-08-22
00:21:20 UTC (rev 3266)
@@ -24,63 +24,73 @@
import org.eclipse.osgi.util.NLS;
public class Messages {
- public static String createWizardTitle;
- public static String runtimeInformation;
- public static String createRuntimeWizardTitle;
- public static String createWizardDescription;
- public static String wizardFragmentNameLabel;
- public static String wizardFragmentHomeDirLabel;
- public static String wizardFragmentJRELabel;
- public static String installedJREs;
- public static String wizardFragmentConfigLabel;
- public static String runtimeWizardFragmentExplanation;
- public static String serverWizardFragmentExplanation;
- public static String serverWizardFragmentExplanation2;
- public static String serverNameInUse;
- public static String runtimeNameInUse;
- public static String invalidDirectory;
- public static String nameTextBlank;
- public static String homeDirBlank;
+ /* Standard and re-usable */
public static String browse;
- public static String deployDirectory;
+ public static String serverName;
+
+ /* Server and Runtime Wizard Fragments */
+ public static String wf_BaseNameVersionReplacement;
+ public static String wf_NameLabel;
+ public static String wf_HomeDirLabel;
+ public static String wf_JRELabel;
+ public static String wf_ConfigLabel;
+ public static String rwf_Title;
+ public static String rwf_Explanation;
+ public static String rwf_BaseName;
+ public static String rwf_NameInUse;
+ public static String rwf_invalidDirectory;
+ public static String rwf_nameTextBlank;
+ public static String rwf_homeDirBlank;
+ public static String swf_Title;
+ public static String swf_Description;
+ public static String swf_RuntimeInformation;
+ public static String swf_AuthorizationDescription;
+ public static String swf_Explanation;
+ public static String swf_Explanation2;
+ public static String swf_AuthenticationGroup;
+ public static String swf_Username;
+ public static String swf_Password;
+ public static String swf_BaseName;
+ public static String swf_NameInUse;
+ public static String sswf_DeployDirectory;
+ public static String sswf_Title;
+ public static String sswf_BaseName;
+
public static String ServerDialogHeading;
-
+
/* Module extension properties */
public static String ModulePropertyType;
public static String ModulePropertyProject;
public static String ModulePropertyModuleFactory;
-
+
public static String RefreshViewerAction;
public static String DisableCategoryAction;
public static String EditLaunchConfigurationAction;
public static String TwiddleServerAction;
public static String CloneServerAction;
-
+
/* Properties of view extenders (categories) */
public static String ExtensionID;
public static String ExtensionName;
public static String ExtensionDescription;
public static String ExtensionProviderClass;
-
-
+
/* Properties of JBoss Servers in the view Properties */
public static String ServerRuntimeVersion;
public static String ServerHome;
public static String ServerConfigurationName;
public static String ServerDeployDir;
-
+
public static String property;
public static String value;
-
-
+
public static String DeleteModuleText;
public static String PublishModuleText;
public static String DeleteModuleDescription;
public static String PublishModuleDescription;
-
+
public static String DeleteModuleConfirm;
-
-
+
/* Action Delegate */
public static String ActionDelegateStartServer;
@@ -89,21 +99,20 @@
public static String ActionDelegateNew;
public static String ActionDelegateNewMBeanStubs;
public static String ActionDelegateNewServer;
-
+
/* Launch Group */
public static String LaunchGroupStartArgs;
public static String LaunchGroupStopArgs;
public static String LaunchGroupTwiddleArgs;
public static String LaunchGroupConfigChanged;
-
+
/* Twiddle Dialog */
public static String TwiddleDialog;
public static String TwiddleDialogExecute;
public static String TwiddleDialogDone;
public static String TwiddleDialogArguments;
public static String TwiddleDialogTutorial;
-
-
+
/* XPath Dialog */
public static String XPathNewCategory;
public static String XPathNewCategoryNameInUse;
@@ -118,9 +127,7 @@
public static String XPathName;
public static String XPathPattern;
public static String XPathAttribute;
-
-
/* Preference Page */
public static String PreferencePageServerTimeouts;
public static String PreferencePageStartTimeouts;
@@ -128,8 +135,7 @@
public static String PreferencePageUponTimeout;
public static String PreferencePageUponTimeoutAbort;
public static String PreferencePageUponTimeoutIgnore;
-
-
+
/* View Preference Page */
public static String ViewPreferencePageName;
public static String ViewPreferencePageEnabled;
@@ -137,7 +143,7 @@
public static String ViewPreferencePageDescription;
public static String ViewExtensionEnablementDescription;
public static String ViewExtensionPreferenceDescription;
-
+
/* Upgrade Wizard to 2.0.0 */
public static String UpgradeWizardTitle;
public static String UpgradeWizardDescription;
@@ -157,12 +163,10 @@
public static String UpgradeWizardLaunchMonitorConverting;
public static String UpgradeWizardLaunchRuntimeNamesInUse;
public static String UpgradeWizardLaunchServerNamesInUse;
-
-
+
/* Inactive Categories */
public static String InactiveCategoriesReEnable;
-
-
+
public static String DescriptorXPathRemoveCategory;
public static String DescriptorXPathRemoveCategoryDesc;
public static String DescriptorXPathNewXPath;
@@ -173,14 +177,14 @@
public static String DescriptorXPathAttributeKeyValue;
public static String DescriptorXPathDescriptorValues;
public static String DescriptorXPathNameLocation;
- public static String DescriptorXPathServerName;
- public static String DescriptorXPathPortCategory;
+ public static String DescriptorXPathServerName;
+ public static String DescriptorXPathPortCategory;
public static String DescriptorXPathSimple;
public static String DescriptorXPathComplex;
public static String DescriptorXPathMatch;
-
-
+
static {
- NLS.initializeMessages(JBossServerUIPlugin.PLUGIN_ID + ".Messages",
Messages.class);
+ NLS.initializeMessages(JBossServerUIPlugin.PLUGIN_ID + ".Messages",
+ Messages.class);
}
}
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 2007-08-21
21:05:27 UTC (rev 3265)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2007-08-22
00:21:20 UTC (rev 3266)
@@ -1,23 +1,33 @@
-createWizardTitle=Create a new JBoss Server
-runtimeInformation=Runtime Information
-createRuntimeWizardTitle=Create a new JBoss Server Runtime
-createWizardDescription=Add a JBoss Server and have great fun
-wizardFragmentNameLabel=Name (unique identifier)
-wizardFragmentHomeDirLabel=Home Directory
-wizardFragmentJRELabel=JRE
-wizardFragmentConfigLabel=Configuration
-installedJREs=Installed JREs
-serverNameInUse=Server name is in use.
-runtimeNameInUse=Runtime name is in use.
-invalidDirectory=Invalid Directory
-nameTextBlank=The name field cannot be blank.
-homeDirBlank=The home directory field cannot be blank.
browse=Browse...
-deployDirectory=Deploy Directory
-runtimeWizardFragmentExplanation=A JBoss Server runtime references a JBoss installation
directory.\nIt can be used to set up classpaths for projects which depend on this
runtime,\nas well as by a "server" which will be able to start and stop
instances of JBoss.
-serverWizardFragmentExplanation=A JBoss Server manages starting and stopping instances of
JBoss. \nIt manages command line arguments and keeps track of which modules have been
deployed.
-serverWizardFragmentExplanation2=If the runtime information below is incorrect, please
press back, Installed Runtimes..., \nand then Add to create a new runtime from a different
location.
+serverName=Server Name
+wf_BaseNameVersionReplacement=_VERSION_
+wf_NameLabel=Name
+wf_HomeDirLabel=Home Directory
+wf_JRELabel=JRE
+wf_ConfigLabel=Configuration
+rwf_Title=JBoss Runtime Wizard
+rwf_Explanation=A JBoss Server runtime references a JBoss installation directory.\nIt can
be used to set up classpaths for projects which depend on this runtime,\nas well as by a
"server" which will be able to start and stop instances of JBoss.
+rwf_BaseName=JBoss _VERSION_ Runtime
+rwf_NameInUse=Runtime name already in use
+rwf_invalidDirectory=Invalid Directory
+rwf_nameTextBlank=The name field must not be blank
+rwf_homeDirBlank=The directory field must not be blank
+swf_Title=Create a new JBoss Server
+swf_Description=
+swf_RuntimeInformation=Runtime Information
+swf_AuthorizationDescription=Authorization Details
+swf_Explanation=A JBoss Server manages starting and stopping instances of JBoss. \nIt
manages command line arguments and keeps track of which modules have been deployed.
+swf_Explanation2=If the runtime information below is incorrect, please press back,
Installed Runtimes..., \nand then Add to create a new runtime from a different location.
+swf_AuthenticationGroup=Set the login and password for your server
+swf_Username=User Name
+swf_Password=Password
+swf_BaseName=JBoss _VERSION_ Server
+swf_NameInUse=Server name already in use
+sswf_DeployDirectory=Deploy Directory
+sswf_Title=Create a new System Copy Server
+sswf_BaseName=Local Deployer
+
#Server View (server and categories, properties)
property=Property
value=Value
@@ -101,11 +111,11 @@
ViewPreferencePageEnabled=Enabled
ViewPreferencePageWeight=Weight
ViewPreferencePageDescription=Description
+
ViewExtensionEnablementDescription=Below is a list of extensions that may be enabled for
the\
+JBoss Servers View. \n The enablement box designates whether the extension should be
present.\
+The weight field \ndesignates how "heavy" each extension is. (Heavier elements
fall towards the bottom.)
- JBoss Servers View. \n The enablement box designates whether the extension should be
present.\
-
-The weight field \ndesignates how "heavy" each extension is. (Heavier elements
fall towards the bottom.)
ViewExtensionPreferenceDescription=Below, you may set or clear any preferences specific
to each view extension above. \nSome extensions may have no preferences to set.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/StrippedServerDeploySection.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/StrippedServerDeploySection.java 2007-08-21
21:05:27 UTC (rev 3265)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/StrippedServerDeploySection.java 2007-08-22
00:21:20 UTC (rev 3266)
@@ -45,14 +45,14 @@
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
Section section = toolkit.createSection(parent,
ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED|ExpandableComposite.TITLE_BAR);
- section.setText(Messages.deployDirectory);
+ section.setText(Messages.sswf_DeployDirectory);
section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
GridData.VERTICAL_ALIGN_FILL));
Composite composite = toolkit.createComposite(section);
composite.setLayout(new FormLayout());
- Label label = toolkit.createLabel(composite, Messages.deployDirectory);
+ Label label = toolkit.createLabel(composite, Messages.sswf_DeployDirectory);
final Text text = toolkit.createText(composite, getDeployDir(), SWT.BORDER);
text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
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 2007-08-21
21:05:27 UTC (rev 3265)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2007-08-22
00:21:20 UTC (rev 3266)
@@ -80,6 +80,10 @@
private final static int SEVERITY_ALL = 1;
private final static int SEVERITY_MAJOR = 2;
+ public static final String LOCATION_TEXT = Platform.getOS().equals(Platform.WS_WIN32)
+ ? "c:/program files/jboss-" : "/usr/bin/jboss-";
+
+
private IWizardHandle handle;
private Label nameLabel, homeDirLabel, installedJRELabel, configLabel,
explanationLabel;
@@ -125,7 +129,7 @@
// initTaskModel();
// make modifications to parent
- handle.setTitle(Messages.createRuntimeWizardTitle);
+ handle.setTitle(Messages.rwf_Title);
handle.setImageDescriptor(getImageDescriptor());
return main;
}
@@ -156,37 +160,29 @@
configurations.setDefaultConfiguration(configSelected);
configurations.getTable().setVisible(false);
- configLabel.setText(Messages.wizardFragmentConfigLabel + ": "
+ configLabel.setText(Messages.wf_ConfigLabel + ": "
+ configSelected);
homeDirText.setEditable(false);
homeDirButton.setEnabled(false);
- try {
- Object o = rwc.loadAdapter(IJBossServerRuntime.class,
- new NullProgressMonitor());
- if (o != null) {
- IJBossServerRuntime jbsr = (IJBossServerRuntime) o;
- IVMInstall install = jbsr.getVM();
- String vmName = install.getName();
- String[] jres = jreCombo.getItems();
- for (int i = 0; i < jres.length; i++) {
- if (vmName.equals(jres[i]))
- jreCombo.select(i);
- }
+ Object o = rwc.loadAdapter(IJBossServerRuntime.class,
+ new NullProgressMonitor());
+ if (o != null) {
+ IJBossServerRuntime jbsr = (IJBossServerRuntime) o;
+ IVMInstall install = jbsr.getVM();
+ String vmName = install.getName();
+ String[] jres = jreCombo.getItems();
+ for (int i = 0; i < jres.length; i++) {
+ if (vmName.equals(jres[i]))
+ jreCombo.select(i);
}
- } catch (Exception e) {
-
}
-
}
}
private void setWidgetDefaults() {
nameText.setText(generateNewRuntimeName());
- homeDirText
- .setText(Platform.getOS().equals(Platform.WS_WIN32) ? "c:/program
files/jboss-"
- + getRuntimeVersionId() + ".x"
- : "/usr/bin/jboss-" + getRuntimeVersionId() + ".x");
+ homeDirText.setText(LOCATION_TEXT + getRuntimeVersionId() + ".x");
}
public String getVersion() {
@@ -203,7 +199,7 @@
}
private String generateNewRuntimeName() {
- String base = "JBoss " + getVersion() + " runtime";
+ String base = Messages.rwf_BaseName.replace(Messages.wf_BaseNameVersionReplacement,
getVersion());
IRuntime rt = ServerCore.findRuntime(base);
if (rt == null)
return base;
@@ -266,7 +262,7 @@
data.right = new FormAttachment(100, -5);
explanationLabel.setLayoutData(data);
- explanationLabel.setText(Messages.runtimeWizardFragmentExplanation);
+ explanationLabel.setText(Messages.rwf_Explanation);
}
private void createNameComposite(Composite main) {
@@ -283,7 +279,7 @@
// create internal widgets
nameLabel = new Label(nameComposite, SWT.NONE);
- nameLabel.setText(Messages.wizardFragmentNameLabel);
+ nameLabel.setText(Messages.wf_NameLabel);
nameText = new Text(nameComposite, SWT.BORDER);
nameText.addModifyListener(new ModifyListener() {
@@ -320,7 +316,7 @@
// Create Internal Widgets
homeDirLabel = new Label(homeDirComposite, SWT.NONE);
- homeDirLabel.setText(Messages.wizardFragmentHomeDirLabel);
+ homeDirLabel.setText(Messages.wf_HomeDirLabel);
homeDirText = new Text(homeDirComposite, SWT.BORDER);
@@ -377,14 +373,14 @@
// Create Internal Widgets
installedJRELabel = new Label(jreComposite, SWT.NONE);
- installedJRELabel.setText(Messages.wizardFragmentJRELabel);
+ installedJRELabel.setText(Messages.wf_JRELabel);
jreCombo = new Combo(jreComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
jreCombo.setItems(jreNames);
jreCombo.select(defaultVMIndex);
jreButton = new Button(jreComposite, SWT.NONE);
- jreButton.setText(Messages.installedJREs);
+ jreButton.setText(Messages.wf_JRELabel);
// Add action listeners
jreButton.addSelectionListener(new SelectionAdapter() {
@@ -474,21 +470,21 @@
private String getErrorString(int severity) {
if (getRuntime(nameText.getText()) != null) {
- return Messages.runtimeNameInUse;
+ return Messages.rwf_NameInUse;
}
if (!isHomeValid())
- return Messages.invalidDirectory;
+ return Messages.rwf_invalidDirectory;
if (severity == SEVERITY_MAJOR)
return null;
// now give minor warnings
if (nameText.getText().equals(""))
- return Messages.nameTextBlank;
+ return Messages.rwf_nameTextBlank;
if (homeDirText.getText().equals(""))
- return Messages.homeDirBlank;
+ return Messages.rwf_homeDirBlank;
return null;
}
@@ -621,7 +617,7 @@
configComposite.setLayout(new FormLayout());
configLabel = new Label(configComposite, SWT.NONE);
- configLabel.setText(Messages.wizardFragmentConfigLabel);
+ configLabel.setText(Messages.wf_ConfigLabel);
configurations = new JBossConfigurationTableViewer(configComposite,
SWT.BORDER | SWT.SINGLE);
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 2007-08-21
21:05:27 UTC (rev 3265)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2007-08-22
00:21:20 UTC (rev 3266)
@@ -1,5 +1,4 @@
/*
- * JBoss, Home of Professional Open Source
* 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.
@@ -49,6 +48,7 @@
import org.eclipse.wst.server.core.TaskModel;
import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.core.model.descriptor.XPathModel;
@@ -60,15 +60,17 @@
public class JBossServerWizardFragment extends WizardFragment {
private IWizardHandle handle;
- private Label nameLabel, explanationLabel, explanationLabel2;
+ private Label nameLabel, serverExplanationLabel,
+ runtimeExplanationLabel, authenticationExplanationLabel;
private Label homeDirLabel, installedJRELabel, configLabel;
private Label homeValLabel, jreValLabel, configValLabel;
- private String runtimeLoc, configName;
+ private Label usernameLabel, passLabel;
+ private String runtimeLoc, configName, authUser, authPass;
private Composite nameComposite;
- private Group g;
+ private Group runtimeGroup, authenticationGroup;
private String name;
- private Text nameText;
+ private Text nameText, userText, passText;
public Composite createComposite(Composite parent, IWizardHandle handle) {
this.handle = handle;
@@ -79,10 +81,11 @@
createExplanationLabel(main);
createNameComposite(main);
createRuntimeGroup(main);
+ createAuthenticationGroup(main);
// make modifications to parent
- handle.setTitle(Messages.createWizardTitle);
- handle.setDescription(Messages.createWizardDescription);
+ handle.setTitle(Messages.swf_Title);
+ handle.setDescription(Messages.swf_Description);
handle.setImageDescriptor (getImageDescriptor());
return main;
@@ -108,13 +111,13 @@
}
private void createExplanationLabel(Composite main) {
- explanationLabel = new Label(main, SWT.NONE);
+ serverExplanationLabel = new Label(main, SWT.NONE);
FormData data = new FormData();
data.top = new FormAttachment(0,5);
data.left = new FormAttachment(0,5);
data.right = new FormAttachment(100,-5);
- explanationLabel.setLayoutData(data);
- explanationLabel.setText(Messages.serverWizardFragmentExplanation);
+ serverExplanationLabel.setLayoutData(data);
+ serverExplanationLabel.setText(Messages.swf_Explanation);
}
private void createNameComposite(Composite main) {
@@ -124,7 +127,7 @@
FormData cData = new FormData();
cData.left = new FormAttachment(0,5);
cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(explanationLabel, 10);
+ cData.top = new FormAttachment(serverExplanationLabel, 10);
nameComposite.setLayoutData(cData);
nameComposite.setLayout(new FormLayout());
@@ -132,7 +135,7 @@
// create internal widgets
nameLabel = new Label(nameComposite, SWT.None);
- nameLabel.setText(Messages.wizardFragmentNameLabel);
+ nameLabel.setText(Messages.wf_NameLabel);
nameText = new Text(nameComposite, SWT.BORDER);
name = getDefaultNameText();
@@ -157,7 +160,7 @@
}
private String getDefaultNameText() {
- String base = "JBoss " + getVersion() + " server";
+ String base = Messages.swf_BaseName.replace(Messages.wf_BaseNameVersionReplacement,
getVersion());
if( findServer(base) == null ) return base;
int i = 1;
while( ServerCore.findServer(base + " (" + i + ")") != null )
@@ -175,47 +178,89 @@
}
private void createRuntimeGroup(Composite main) {
- // explanation 2
- explanationLabel2 = new Label(main, SWT.NONE);
- explanationLabel2.setText(Messages.serverWizardFragmentExplanation2);
- FormData labelData = new FormData();
- labelData.left = new FormAttachment(0,5);
- labelData.right = new FormAttachment(100, -5);
- labelData.top = new FormAttachment(nameComposite, 15);
- explanationLabel2.setLayoutData(labelData);
-
-
- g = new Group(main, SWT.NONE);
- g.setText(Messages.runtimeInformation);
+ 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(explanationLabel2, 5);
- g.setLayoutData(groupData);
+ groupData.top = new FormAttachment(nameComposite, 5);
+ runtimeGroup.setLayoutData(groupData);
- g.setLayout(new GridLayout(2, false));
+ runtimeGroup.setLayout(new GridLayout(2, false));
GridData d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
+ // explanation 2
+ runtimeExplanationLabel = new Label(runtimeGroup, SWT.NONE);
+ runtimeExplanationLabel.setText(Messages.swf_Explanation2);
+ GridData explanationData = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
+ explanationData.horizontalSpan = 2;
+ runtimeExplanationLabel.setLayoutData(explanationData);
+
// Create our composite
- homeDirLabel = new Label(g, SWT.NONE);
- homeDirLabel.setText(Messages.wizardFragmentHomeDirLabel);
- homeValLabel = new Label(g, SWT.NONE);
+ homeDirLabel = new Label(runtimeGroup, SWT.NONE);
+ homeDirLabel.setText(Messages.wf_HomeDirLabel);
+ homeValLabel = new Label(runtimeGroup, SWT.NONE);
homeValLabel.setLayoutData(d);
- installedJRELabel = new Label(g, SWT.NONE);
- installedJRELabel.setText(Messages.wizardFragmentJRELabel);
- jreValLabel = new Label(g, SWT.NONE);
+ installedJRELabel = new Label(runtimeGroup, SWT.NONE);
+ installedJRELabel.setText(Messages.wf_JRELabel);
+ jreValLabel = new Label(runtimeGroup, SWT.NONE);
d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
jreValLabel.setLayoutData(d);
- configLabel = new Label(g, SWT.NONE);
- configLabel.setText("Configuration");
- configValLabel = new Label(g, SWT.NONE);
+ configLabel = new Label(runtimeGroup, SWT.NONE);
+ configLabel.setText(Messages.wf_ConfigLabel);
+ configValLabel = new Label(runtimeGroup, SWT.NONE);
d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
configValLabel.setLayoutData(d);
}
+ protected void createAuthenticationGroup(Composite main) {
+ authenticationGroup = new Group(main, SWT.BORDER);
+ authenticationGroup.setText(Messages.swf_AuthenticationGroup);
+ FormData groupData = new FormData();
+ groupData.left = new FormAttachment(0,5);
+ groupData.right = new FormAttachment(100, -5);
+ groupData.top = new FormAttachment(runtimeGroup, 5);
+ authenticationGroup.setLayoutData(groupData);
+
+ authenticationGroup.setLayout(new GridLayout(2, false));
+ GridData d;
+
+ authenticationExplanationLabel = new Label(authenticationGroup, SWT.NONE);
+ authenticationExplanationLabel.setText("Authentication Explanation is long and its
also very very long so there");
+ d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
+ d.horizontalSpan = 2;
+ authenticationExplanationLabel.setLayoutData(d);
+
+ d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
+ d.minimumWidth = 200;
+ usernameLabel = new Label(authenticationGroup, SWT.NONE);
+ usernameLabel.setText(Messages.swf_Username);
+ userText = new Text(authenticationGroup, SWT.BORDER);
+ userText.setLayoutData(d);
+
+ d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
+ d.minimumWidth = 200;
+ passLabel = new Label(authenticationGroup, SWT.NONE);
+ passLabel.setText(Messages.swf_Password);
+ passText = new Text(authenticationGroup, SWT.BORDER);
+ passText.setLayoutData(d);
+
+ // listeners
+ passText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ authPass = passText.getText();
+ }
+ });
+ userText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ authUser = userText.getText();
+ }
+ });
+ }
+
private void updateErrorMessage() {
String error = getErrorString();
if( error == null ) {
@@ -227,7 +272,7 @@
private String getErrorString() {
if( findServer(name) != null )
- return Messages.serverNameInUse;
+ return Messages.swf_NameInUse;
return null;
}
@@ -250,7 +295,7 @@
jreValLabel.setText(install.getInstallLocation().getAbsolutePath() + " (" +
install.getName() + ")");
runtimeLoc = homeValLabel.getText();
configName = configValLabel.getText();
- g.layout();
+ runtimeGroup.layout();
}
}
@@ -262,7 +307,10 @@
serverWC.setRuntime((IRuntime)getTaskModel().getObject(TaskModel.TASK_RUNTIME));
serverWC.setName(name);
serverWC.setServerConfiguration(null);
- //IServer s = serverWC.save(false, new NullProgressMonitor());
+ if( serverWC instanceof ServerWorkingCopy) {
+ ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
+ ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
+ }
IPath configFolder = new
Path(runtimeLoc).append("server").append(configName);
XPathModel.getDefault().loadDefaults((IServer)serverWC, configFolder.toOSString());
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java 2007-08-21
21:05:27 UTC (rev 3265)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/StrippedServerWizardFragment.java 2007-08-22
00:21:20 UTC (rev 3266)
@@ -52,12 +52,12 @@
nameLabel = new Label(main, SWT.NONE);
nameText = new Text(main, SWT.BORDER);
- nameLabel.setText("Server Name");
+ nameLabel.setText(Messages.serverName);
deployLabel = new Label(main, SWT.NONE);
deployText = new Text(main, SWT.BORDER);
browse = new Button(main, SWT.PUSH);
- deployLabel.setText(Messages.deployDirectory);
+ deployLabel.setText(Messages.sswf_DeployDirectory);
browse.setText(Messages.browse);
FormData lData = new FormData();
@@ -136,7 +136,8 @@
}
public void enter() {
- handle.setTitle("Create a new System Copy Server");
+ //handle.setTitle("Create a new System Copy Server");
+ handle.setTitle(Messages.sswf_Title);
IServer s = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER);
IServerWorkingCopy swc;
if( s instanceof IServerWorkingCopy)
@@ -190,7 +191,7 @@
}
private String getDefaultNameText() {
- String base = "JBoss deployer";
+ String base = Messages.sswf_BaseName;
if( findServer(base) == null ) return base;
int i = 1;
while( ServerCore.findServer(base + " (" + i + ")") != null )