Author: sflanigan
Date: 2009-05-25 02:57:08 -0400 (Mon, 25 May 2009)
New Revision: 15479
Added:
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/.settings/
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/.settings/org.eclipse.jdt.core.prefs
trunk/birt/plugins/org.jboss.tools.birt.oda/.settings/
trunk/birt/plugins/org.jboss.tools.birt.oda/.settings/org.eclipse.jdt.core.prefs
trunk/seam/plugins/org.jboss.ide.seam.gen/.settings/
trunk/seam/plugins/org.jboss.ide.seam.gen/.settings/org.eclipse.jdt.core.prefs
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/Messages.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/messages.properties
Modified:
trunk/birt/plugins/org.jboss.tools.birt.core/.settings/org.eclipse.jdt.core.prefs
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/QuestionDialog.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenPlugin.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenProperty.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewActionAction.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewConversationAction.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewEntityAction.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewFormAction.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SampleAction.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SetupDeluxeAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English Strings
Modified:
trunk/birt/plugins/org.jboss.tools.birt.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/birt/plugins/org.jboss.tools.birt.core/.settings/org.eclipse.jdt.core.prefs 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/birt/plugins/org.jboss.tools.birt.core/.settings/org.eclipse.jdt.core.prefs 2009-05-25
06:57:08 UTC (rev 15479)
@@ -4,4 +4,5 @@
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/birt/plugins/org.jboss.tools.birt.oda/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/birt/plugins/org.jboss.tools.birt.oda/.settings/org.eclipse.jdt.core.prefs 2009-05-25
06:57:08 UTC (rev 15479)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added:
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/.settings/org.eclipse.jdt.core.prefs 2009-05-25
06:57:08 UTC (rev 15479)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added: trunk/seam/plugins/org.jboss.ide.seam.gen/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/seam/plugins/org.jboss.ide.seam.gen/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/.settings/org.eclipse.jdt.core.prefs 2009-05-25
06:57:08 UTC (rev 15479)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added: trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/Messages.java
===================================================================
--- trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/Messages.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/Messages.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -0,0 +1,74 @@
+package org.jboss.ide.seam.gen;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.ide.seam.gen.messages";
//$NON-NLS-1$
+ public static String CouldNotCreateDatabaseConnectionDetails;
+ public static String CouldNotCreateDatabaseConnectionTitle;
+ public static String CouldNotReadDatabaseSettingsDetails;
+ public static String CouldNotReadDatabaseSettingsTitle;
+ public static String CreateConnectionQuestion;
+ public static String CreateConnectionTitle;
+ public static String CreateProjectQuestion;
+ public static String CreateProjectTitle;
+ public static String LaunchErrorTitle;
+ public static String NewActionAction_BeanName;
+ public static String NewActionAction_Description;
+ public static String NewActionAction_LocalInterfaceName;
+ public static String NewActionAction_MethodName;
+ public static String NewActionAction_PageName;
+ public static String NewActionAction_SeamComponentName;
+ public static String NewActionAction_Title;
+ public static String NewConversationAction_Description;
+ public static String NewConversationAction_Title;
+ public static String NewEntityAction_Description;
+ public static String NewEntityAction_EntityClassName;
+ public static String NewEntityAction_MasterPageName;
+ public static String NewEntityAction_PageName;
+ public static String NewEntityAction_Title;
+ public static String NewFormAction_Description;
+ public static String NewFormAction_Title;
+ public static String NoBuildXMLSelectedDetails;
+ public static String NoBuildXMLSelectedTitle;
+ public static String QuestionDialog_BrowseButton;
+ public static String QuestionDialog_ErrorPreloading;
+ public static String QuestionDialog_SeamGenPropertyRequiresAValue;
+ public static String QuestionDialog_SelectDirectoryDialogText;
+ public static String QuestionDialog_SelectFileDialogText;
+ public static String SeamGenAction_ProfileDescription;
+ public static String SeamGenAction_SeamGenActionName;
+ public static String SeamGenPlugin_CannotCreateConfig;
+ public static String SeamGenPlugin_ExceptionDuringSearch;
+ public static String SeamGenProperty_GeneralGroup;
+ public static String SelectBuildXML;
+ public static String SetupDeluxeAction_ActionPackageDesc;
+ public static String SetupDeluxeAction_BadDirectory;
+ public static String SetupDeluxeAction_BadFile;
+ public static String SetupDeluxeAction_CodeGenerationGroup;
+ public static String SetupDeluxeAction_DatabaseDropDesc;
+ public static String SetupDeluxeAction_DatabaseExistsDesc;
+ public static String SetupDeluxeAction_DatabaseGroup;
+ public static String SetupDeluxeAction_DatabasePasswordDesc;
+ public static String SetupDeluxeAction_DatabaseTypeDesc;
+ public static String SetupDeluxeAction_DriverJarDesc;
+ public static String SetupDeluxeAction_HibernateConnectionDriverClassDesc;
+ public static String SetupDeluxeAction_HibernateConnectionUrlDesc;
+ public static String SetupDeluxeAction_HibernateConnectionUsernameDesc;
+ public static String SetupDeluxeAction_HibernateDefaultCatalogDesc;
+ public static String SetupDeluxeAction_HibernateDefaultSchemaDesc;
+ public static String SetupDeluxeAction_HibernateDialectDesc;
+ public static String SetupDeluxeAction_JBossHomeDesc;
+ public static String SetupDeluxeAction_ModelPackageDesc;
+ public static String SetupDeluxeAction_ProjectNameDesc;
+ public static String SetupDeluxeAction_ProjectTypeDesc;
+ public static String SetupDeluxeAction_TestPackageDesc;
+ public static String SetupDeluxeAction_WorkspaceHomeDesc;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/QuestionDialog.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/QuestionDialog.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/QuestionDialog.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -3,6 +3,7 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
@@ -116,7 +117,7 @@
}
catch (CoreException e1) {
- SeamGenPlugin.logError( "Error while preloading build.properties", e1 );
+ SeamGenPlugin.logError( Messages.QuestionDialog_ErrorPreloading, e1 );
}
@@ -160,7 +161,7 @@
text.setLayoutData(data);
Button button = new Button(composite, SWT.PUSH);
- button.setText("Browse...");
+ button.setText(Messages.QuestionDialog_BrowseButton);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String paths = null;
@@ -190,7 +191,7 @@
}
label = new Label(composite, SWT.NONE);
label.setVisible(false);
- label.setText( " " );
+ label.setText( " " ); //$NON-NLS-1$
propertyToDefaultLabel.put( name, label );
@@ -211,8 +212,8 @@
protected String chooseExternalFile(Shell shell) {
FileDialog dialog= new FileDialog(shell, SWT.SINGLE);
- dialog.setText("Select file");
- dialog.setFilterExtensions(new String[] {"*.jar;*.zip"});
+ dialog.setText(Messages.QuestionDialog_SelectFileDialogText);
+ dialog.setFilterExtensions(new String[] {"*.jar;*.zip"}); //$NON-NLS-1$
//dialog.setFilterPath(lastUsedPath);
String res= dialog.open();
@@ -222,7 +223,7 @@
protected String chooseExternalDirectory(Shell shell) {
DirectoryDialog dialog= new DirectoryDialog(shell, SWT.SINGLE);
- dialog.setText("Select directory");
+ dialog.setText(Messages.QuestionDialog_SelectDirectoryDialogText);
String res= dialog.open();
return res;
@@ -246,9 +247,9 @@
} else {
Button t = (Button) element.getValue();
if(t.getSelection()) {
- text = "y";
+ text = "y"; //$NON-NLS-1$
} else {
- text = "n";
+ text = "n"; //$NON-NLS-1$
}
}
SeamGenProperty sgp = (SeamGenProperty) questions.get( element.getKey() );
@@ -305,7 +306,7 @@
Label defaultLabel = (Label) propertyToDefaultLabel.get( element.getKey() );
String defaultValue = gp.getDefaultValue( properties );
- defaultLabel.setText( defaultValue==null?"":defaultValue );
+ defaultLabel.setText( defaultValue==null?"":defaultValue ); //$NON-NLS-1$
String text2 = getText( element, defaultLabel );
@@ -316,7 +317,8 @@
haveNoWarning = false;
button.setEnabled( false );
} else if(gp.isRequired() && text2.trim().length()==0 &&
defaultLabel.getText().trim().length()==0 ) {
- setMessage( "'" + gp.getDescription() + "' requires a
value", IMessageProvider.ERROR );
+ setMessage(
MessageFormat.format(Messages.QuestionDialog_SeamGenPropertyRequiresAValue,
+ gp.getDescription()), IMessageProvider.ERROR );
haveNoWarning = false;
button.setEnabled( false );
}
@@ -354,9 +356,9 @@
Button b = (Button) object;
b.setToolTipText( defaultText.getText() );
if(b.getSelection()) {
- return "y";
+ return "y"; //$NON-NLS-1$
} else {
- return "n";
+ return "n"; //$NON-NLS-1$
}
} else {
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenPlugin.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenPlugin.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenPlugin.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -2,6 +2,7 @@
import java.io.File;
import java.io.IOException;
+import java.text.MessageFormat;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -53,19 +54,22 @@
try {
config = findLaunchConfig("seamgen"); //$NON-NLS-1$
} catch (CoreException e1) {
- logError("Exception occured during search in Launch Configuration list.",
e1);
+ logError(Messages.SeamGenPlugin_ExceptionDuringSearch, e1);
}
File buildXmlPath = null;
if(config==null) {
try {
- Bundle plugin = Platform.getBundle("org.jboss.tools.seam.core");
+ Bundle plugin = Platform.getBundle("org.jboss.tools.seam.core");
//$NON-NLS-1$
if(plugin==null) return;
- String seamHome = new ScopedPreferenceStore(new
InstanceScope(),plugin.getSymbolicName()).getString("org.jboss.tools.seam.core.project.facet.seamhome");
- buildXmlPath = new
File(seamHome+File.separator+"seam-gen"+File.separator+"build.xml");
+ String seamHome = new ScopedPreferenceStore(new
InstanceScope(),plugin.getSymbolicName()).getString("org.jboss.tools.seam.core.project.facet.seamhome");
//$NON-NLS-1$
+ buildXmlPath = new
File(seamHome+File.separator+"seam-gen"+File.separator+"build.xml");
//$NON-NLS-1$ //$NON-NLS-2$
if(buildXmlPath.exists())
SeamGenAction.createSeamgenLaunchConfig(buildXmlPath.getAbsolutePath());
} catch (CoreException e) {
- logError("Cannot create configuration for Seam-Gen tool. Seamgen build.xml file:
" + buildXmlPath, e);
+ logError(MessageFormat
+ .format(
+ Messages.SeamGenPlugin_CannotCreateConfig,
+ buildXmlPath), e);
return;
}
}
@@ -76,7 +80,7 @@
static public String assumeJBossASHome() {
String pluginLocation=null;
try {
- pluginLocation =
FileLocator.resolve(SeamGenPlugin.getDefault().getBundle().getEntry("/")).getFile();
+ pluginLocation =
FileLocator.resolve(SeamGenPlugin.getDefault().getBundle().getEntry("/")).getFile();
//$NON-NLS-1$
} catch (IOException e) {
SeamGenPlugin.log(new
Status(IStatus.ERROR,SeamGenPlugin.PLUGIN_ID,e.getMessage(),e));
};
@@ -96,7 +100,7 @@
static public ILaunchConfiguration findLaunchConfig(String name) throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType(
"org.eclipse.ant.AntLaunchConfigurationType" );
+ ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType(
"org.eclipse.ant.AntLaunchConfigurationType" ); //$NON-NLS-1$
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(
launchConfigurationType );
for (int i = 0; i < launchConfigurations.length; i++) { // can't believe there
is no look up by name API
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenProperty.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenProperty.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/SeamGenProperty.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -12,7 +12,7 @@
private String defaultPropertyName;
- public static final String GENERAL = "General";
+ public static final String GENERAL = Messages.SeamGenProperty_GeneralGroup;
public final static int TEXT = 0;
public final static int JAR = 1;
public final static int DIR = 2;
@@ -36,18 +36,18 @@
}
public String getDefaultValue(Properties others) {
- return "";
+ return ""; //$NON-NLS-1$
}
protected String upper(String name)
{
- if(name==null || name.length()==0) return "";
+ if(name==null || name.length()==0) return ""; //$NON-NLS-1$
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
protected String lower(String name) {
if ( name == null || name.length() == 0 )
- return "";
+ return ""; //$NON-NLS-1$
return name.substring( 0, 1 ).toLowerCase() + name.substring( 1 );
}
@@ -66,9 +66,9 @@
public void applyValue(Properties existing, Control control) {
if(getDefaultPropertyName()==null) return;
- String property = "";
+ String property = ""; //$NON-NLS-1$
if(existing == null || existing.get(getDefaultPropertyName())==null) {
- property = getDefaultValue(existing)==null?"":getDefaultValue(existing);
+ property = getDefaultValue(existing)==null?"":getDefaultValue(existing);
//$NON-NLS-1$
} else {
property = existing.getProperty( getDefaultPropertyName() );
}
@@ -76,13 +76,13 @@
if(control instanceof Text) {
((Text)control).setText( property );
} else if (control instanceof Button) {
- if("y".equalsIgnoreCase( property )) {
+ if("y".equalsIgnoreCase( property )) { //$NON-NLS-1$
((Button)control).setSelection( true );
} else {
((Button)control).setSelection( false );
}
} else {
- System.out.println(getDefaultPropertyName() + " " + property);
+ System.out.println(getDefaultPropertyName() + " " + property);
//$NON-NLS-1$
}
}
}
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewActionAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewActionAction.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewActionAction.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -4,6 +4,7 @@
import java.util.Map;
import java.util.Properties;
+import org.jboss.ide.seam.gen.Messages;
import org.jboss.ide.seam.gen.SeamGenProperty;
public class NewActionAction extends SeamGenAction {
@@ -13,36 +14,36 @@
}
public String getTitle() {
- return "Create new Action";
+ return Messages.NewActionAction_Title;
}
public String getDescription() {
- return "Create a new Java interface and SLSB\n with key Seam/EJB3
annotations.";
+ return Messages.NewActionAction_Description;
}
protected Map getQuestions() {
Map properties = new LinkedHashMap();
- properties.put( "component.name", new SeamGenProperty("Seam component
name") ); //$NON-NLS-1$
- properties.put( "interface.name", new SeamGenProperty("Local interface
name") { //$NON-NLS-1$
+ properties.put( "component.name", new
SeamGenProperty(Messages.NewActionAction_SeamComponentName) ); //$NON-NLS-1$
+ properties.put( "interface.name", new
SeamGenProperty(Messages.NewActionAction_LocalInterfaceName) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty( "component.name", "" );
//$NON-NLS-1$ //$NON-NLS-2$
return upper(property);
}
});
- properties.put( "bean.name", new SeamGenProperty("Bean name") {
//$NON-NLS-1$
+ properties.put( "bean.name", new
SeamGenProperty(Messages.NewActionAction_BeanName) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty( "component.name", "" );
//$NON-NLS-1$ //$NON-NLS-2$
- return upper(property + "Bean");
+ return upper(property + "Bean"); //$NON-NLS-1$
}
});
- properties.put( "method.name", new SeamGenProperty("Method name") {
//$NON-NLS-1$
+ properties.put( "method.name", new
SeamGenProperty(Messages.NewActionAction_MethodName) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty( "component.name", "" );
//$NON-NLS-1$ //$NON-NLS-2$
return lower(property);
}
});
- properties.put( "page.name", new SeamGenProperty("Page name") {
//$NON-NLS-1$
+ properties.put( "page.name", new
SeamGenProperty(Messages.NewActionAction_PageName) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty( "component.name", "" );
//$NON-NLS-1$ //$NON-NLS-2$
return lower(property);
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewConversationAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewConversationAction.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewConversationAction.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -1,5 +1,7 @@
package org.jboss.ide.seam.gen.actions;
+import org.jboss.ide.seam.gen.Messages;
+
public class NewConversationAction extends NewActionAction {
protected String getTarget() {
@@ -8,13 +10,11 @@
public String getTitle() {
- return "Create new conversation";
+ return Messages.NewConversationAction_Title;
}
public String getDescription() {
- return "Create a set of classes managing a conversation.\n";
-
+ return Messages.NewConversationAction_Description;
}
-
}
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewEntityAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewEntityAction.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewEntityAction.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -4,6 +4,7 @@
import java.util.Map;
import java.util.Properties;
+import org.jboss.ide.seam.gen.Messages;
import org.jboss.ide.seam.gen.SeamGenProperty;
public class NewEntityAction extends SeamGenAction {
@@ -13,24 +14,24 @@
}
public String getTitle() {
- return "New entity";
+ return Messages.NewEntityAction_Title;
}
public String getDescription() {
- return "Create a new entity bean\nwith key Seam/EJB3 annotations and example
attributes.";
+ return Messages.NewEntityAction_Description;
}
protected Map getQuestions() {
Map properties = new LinkedHashMap();
- properties.put( "entity.name", new SeamGenProperty("Entity class
name") ); //$NON-NLS-1$
- properties.put( "masterPage.name", new SeamGenProperty("Master page
name") { //$NON-NLS-1$
+ properties.put( "entity.name", new
SeamGenProperty(Messages.NewEntityAction_EntityClassName) ); //$NON-NLS-1$
+ properties.put( "masterPage.name", new
SeamGenProperty(Messages.NewEntityAction_MasterPageName) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty( "entity.name", "" );
//$NON-NLS-1$ //$NON-NLS-2$
- return lower(property) + "List";
+ return lower(property) + "List"; //$NON-NLS-1$
}
});
- properties.put( "page.name", new SeamGenProperty("Page name") {
//$NON-NLS-1$
+ properties.put( "page.name", new
SeamGenProperty(Messages.NewEntityAction_PageName) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty( "entity.name", "" );
//$NON-NLS-1$ //$NON-NLS-2$
return lower(property);
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewFormAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewFormAction.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/NewFormAction.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -1,5 +1,7 @@
package org.jboss.ide.seam.gen.actions;
+import org.jboss.ide.seam.gen.Messages;
+
public class NewFormAction extends NewActionAction {
/**
* The constructor.
@@ -12,12 +14,11 @@
}
public String getTitle() {
- return "Create new form";
+ return Messages.NewFormAction_Title;
}
public String getDescription() {
- return "Create a form with a single input field and related\n" +
- "Java interface, SLSB with key Seam/EJB3 annotations.";
+ return Messages.NewFormAction_Description;
}
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SampleAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SampleAction.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SampleAction.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -31,8 +31,8 @@
public void run(IAction action) {
MessageDialog.openInformation(
window.getShell(),
- "JBoss Seam-gen Plug-in",
- "Hello, Eclipse world");
+ "JBoss Seam-gen Plug-in", //$NON-NLS-1$
+ "Hello, Eclipse world"); //$NON-NLS-1$
}
/**
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -6,6 +6,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
+import java.text.MessageFormat;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
@@ -52,6 +53,7 @@
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
+import org.jboss.ide.seam.gen.Messages;
import org.jboss.ide.seam.gen.QuestionDialog;
import org.jboss.ide.seam.gen.SeamGenPlugin;
@@ -74,19 +76,19 @@
public void launchesTerminated(ILaunch[] launches) {
for (int i = 0; i < launches.length; i++) {
final ILaunch launch2 = launches[i];
- if("seamgen".equals( launch2.getLaunchConfiguration().getName() )) {
+ if("seamgen".equals( launch2.getLaunchConfiguration().getName() )) {
//$NON-NLS-1$
try {
String target =
launch2.getLaunchConfiguration().getAttribute(IAntLaunchConfigurationConstants.ATTR_ANT_TARGETS,(String)null);
- if("setup".equals(target) && launch2.getAttribute(
"terminated-done" )==null) {
- launch2.setAttribute( "terminated-done", "true" );
+ if("setup".equals(target) && launch2.getAttribute(
"terminated-done" )==null) { //$NON-NLS-1$ //$NON-NLS-2$
+ launch2.setAttribute( "terminated-done", "true" );
//$NON-NLS-1$ //$NON-NLS-2$
SeamGenPlugin.getDefault().getWorkbench().getDisplay().syncExec(
new Runnable() {
public void run(){
- if(MessageDialog.openQuestion( getShell(), "Create new Seam
project", "Create new seam project ?" )) {
+ if(MessageDialog.openQuestion( getShell(), Messages.CreateProjectTitle,
Messages.CreateProjectQuestion )) {
new NewProjectAction().run( null );
}
- if(MessageDialog.openQuestion( getShell(), "Create DB
Connection", "Create DB Connection ?" )) {
+ if(MessageDialog.openQuestion( getShell(), Messages.CreateConnectionTitle,
Messages.CreateConnectionQuestion )) {
createDatabaseConnection(launch2);
}
}
@@ -103,7 +105,7 @@
while(existing!=null ) {
number++;
name = origName+number;
- existing =
DriverManager.getInstance().getDriverInstanceByName("DriverDefn."+name);
+ existing =
DriverManager.getInstance().getDriverInstanceByName("DriverDefn."+name);
//$NON-NLS-1$
}
IPropertySet pset =
DriverManager.getInstance().createDefaultInstance(templateID);
@@ -124,23 +126,23 @@
final ILaunch launch2) {
Properties seamGenProperties = getSeamGenProperties(
launch2.getLaunchConfiguration() );
- String projectName = seamGenProperties.getProperty( "project.name"
);
+ String projectName = seamGenProperties.getProperty( "project.name"
); //$NON-NLS-1$
Properties dbProperties = new Properties();
if(seamGenProperties!=null) {
- DriverInstance driverInstance =
createNewDriverInstance("org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate",
- projectName + "
seamgen-driver",
-
seamGenProperties.getProperty("driver.jar", ""),
-
seamGenProperties.getProperty( "hibernate.connection.driver_class", ""
));
+ DriverInstance driverInstance =
createNewDriverInstance("org.eclipse.datatools.connectivity.db.generic.genericDriverTemplate",
//$NON-NLS-1$
+ projectName + "
seamgen-driver", //$NON-NLS-1$
+
seamGenProperties.getProperty("driver.jar", ""), //$NON-NLS-1$
//$NON-NLS-2$
+
seamGenProperties.getProperty( "hibernate.connection.driver_class", ""
)); //$NON-NLS-1$ //$NON-NLS-2$
dbProperties.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
driverInstance.getId());
- dbProperties.setProperty(IDBConnectionProfileConstants.DRIVER_CLASS_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.driver_class", ""
));
- dbProperties.setProperty(IDBConnectionProfileConstants.DATABASE_VENDOR_PROP_ID,
"Generic JDBC");
- dbProperties.setProperty(IDBConnectionProfileConstants.DATABASE_VERSION_PROP_ID,
"1.0");
- dbProperties.setProperty(IDBConnectionProfileConstants.DATABASE_NAME_PROP_ID,
"SeamGen database");
- dbProperties.setProperty(IDBConnectionProfileConstants.PASSWORD_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.password", ""
));
- dbProperties.setProperty(IDBConnectionProfileConstants.USERNAME_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.username", ""
));
- dbProperties.setProperty(IDBConnectionProfileConstants.URL_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.url", "" ));
+ dbProperties.setProperty(IDBConnectionProfileConstants.DRIVER_CLASS_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.driver_class", ""
)); //$NON-NLS-1$ //$NON-NLS-2$
+ dbProperties.setProperty(IDBConnectionProfileConstants.DATABASE_VENDOR_PROP_ID,
"Generic JDBC"); //$NON-NLS-1$
+ dbProperties.setProperty(IDBConnectionProfileConstants.DATABASE_VERSION_PROP_ID,
"1.0"); //$NON-NLS-1$
+ dbProperties.setProperty(IDBConnectionProfileConstants.DATABASE_NAME_PROP_ID,
"SeamGen database"); //$NON-NLS-1$
+ dbProperties.setProperty(IDBConnectionProfileConstants.PASSWORD_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.password", "" ));
//$NON-NLS-1$ //$NON-NLS-2$
+ dbProperties.setProperty(IDBConnectionProfileConstants.USERNAME_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.username", "" ));
//$NON-NLS-1$ //$NON-NLS-2$
+ dbProperties.setProperty(IDBConnectionProfileConstants.URL_PROP_ID,
seamGenProperties.getProperty( "hibernate.connection.url", "" ));
//$NON-NLS-1$ //$NON-NLS-2$
//connection.setLoadingPath(seamGenProperties.getProperty(
"driver.jar", "" ));
@@ -148,7 +150,7 @@
//connection.setCustomProperty( "JDBC_DRIVER","Other");
try {
- String name = projectName + " seamgen-connection";
+ String name = projectName + " seamgen-connection"; //$NON-NLS-1$
IConnectionProfile existing =
ProfileManager.getInstance().getProfileByName(name);
int number = 0;
String origName = name;
@@ -159,18 +161,18 @@
}
ProfileManager.getInstance().createProfile(name,
- "Database created for seam-gen project",
+ Messages.SeamGenAction_ProfileDescription,
IDBConnectionProfileConstants.CONNECTION_PROFILE_ID,
dbProperties
);
// TODO unique name ? NewCWJDBCPage.createUniqueConnectionName(
NewCWJDBCPage.getExistingConnectionNamesList(), "seamgen-connection"));
} catch (ConnectionProfileException e) {
- SeamGenPlugin.logError("Could not create database connection",
e);
- MessageDialog.openError( getShell(), "Could not create database
connection", "Could not create database connection. See Error log for
details" );
+ SeamGenPlugin.logError("Could not create database connection", e);
//$NON-NLS-1$
+ MessageDialog.openError( getShell(),
Messages.CouldNotCreateDatabaseConnectionTitle,
Messages.CouldNotCreateDatabaseConnectionDetails );
}
} else {
- MessageDialog.openError( getShell(), "Could not read database
settings", "Could not read database settings. See Error log for details"
);
+ MessageDialog.openError( getShell(),
Messages.CouldNotReadDatabaseSettingsTitle, Messages.CouldNotReadDatabaseSettingsDetails
);
}
}
});
@@ -181,12 +183,12 @@
// org.eclipse.ui.externaltools.internal.launchConfigurations
Properties p = getSeamGenProperties( launch2.getLaunchConfiguration() );
if(p!=null) {
- String seamWorkspace = p.getProperty( "workspace.home" );
- String projectName = p.getProperty( "project.name" );
+ String seamWorkspace = p.getProperty( "workspace.home" ); //$NON-NLS-1$
+ String projectName = p.getProperty( "project.name" ); //$NON-NLS-1$
IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if(!"new-project".equals(target)) {
+ if(!"new-project".equals(target)) { //$NON-NLS-1$
if(project.exists()) {
project.refreshLocal( IResource.DEPTH_INFINITE, null );
}
@@ -194,7 +196,7 @@
}
if(!project.exists()) {
- SeamGenPlugin.logInfo( "project " + projectName + " does not
exist");
+ SeamGenPlugin.logInfo( "project " + projectName + " does not
exist"); //$NON-NLS-1$ //$NON-NLS-2$
IProjectDescription description =
ResourcesPlugin.getWorkspace().newProjectDescription(projectName);
URI uri = new File(seamWorkspace, projectName).toURI();
@@ -202,26 +204,26 @@
IPath defaultDefaultLocation =
ResourcesPlugin.getWorkspace().getRoot().getLocation();
IPath parentPath = locationPath.removeLastSegments(1);
if (FileUtil.isPrefixOf(parentPath, defaultDefaultLocation) &&
FileUtil.isPrefixOf(defaultDefaultLocation, parentPath)) {
- SeamGenPlugin.logInfo( "seam workspace overlaps with eclipse. Opening
project directly." );
+ SeamGenPlugin.logInfo( "seam workspace overlaps with eclipse. Opening
project directly." ); //$NON-NLS-1$
} else {
description.setLocationURI(uri);
- SeamGenPlugin.logInfo( "project location should be " + uri);
+ SeamGenPlugin.logInfo( "project location should be " + uri);
//$NON-NLS-1$
}
project.create(description, null);
project.open( null );
- SeamGenPlugin.logInfo( "project " + projectName + " created
");
+ SeamGenPlugin.logInfo( "project " + projectName + " created
"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
- SeamGenPlugin.logInfo( "project " + projectName + " already
exists");
+ SeamGenPlugin.logInfo( "project " + projectName + " already
exists"); //$NON-NLS-1$ //$NON-NLS-2$
}
//project.refreshLocal( IResource.DEPTH_INFINITE, null );
} else {
- SeamGenPlugin.logInfo( "build.properties not found");
+ SeamGenPlugin.logInfo( "build.properties not found"); //$NON-NLS-1$
}
}
catch (CoreException e) {
- SeamGenPlugin.logError( "Error when seam-gen terminated", e );
+ SeamGenPlugin.logError( "Error when seam-gen terminated", e );
//$NON-NLS-1$
} finally {
}
@@ -240,25 +242,25 @@
}
public static ILaunchConfigurationWorkingCopy createSeamgenLaunchConfig(String
pathToSeamgenBuildXml) throws CoreException {
- SeamGenPlugin.logInfo( "User selected: " + pathToSeamgenBuildXml + " as
build.xml" );
+ SeamGenPlugin.logInfo( "User selected: " + pathToSeamgenBuildXml + " as
build.xml" ); //$NON-NLS-1$ //$NON-NLS-2$
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType(
"org.eclipse.ant.AntLaunchConfigurationType" );
- ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance( null,
"seamgen" );
- wc.setAttribute( "process_factory_id",
"org.eclipse.ant.ui.remoteAntProcessFactory" );
+ ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType(
"org.eclipse.ant.AntLaunchConfigurationType" ); //$NON-NLS-1$
+ ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance( null,
"seamgen" ); //$NON-NLS-1$
+ wc.setAttribute( "process_factory_id",
"org.eclipse.ant.ui.remoteAntProcessFactory" ); //$NON-NLS-1$ //$NON-NLS-2$
wc.setAttribute(IAntLaunchConfigurationConstants.ATTR_DEFAULT_VM_INSTALL, true);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
"org.eclipse.ant.internal.ui.antsupport.InternalAntRunner");
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
"org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"); //$NON-NLS-1$
- wc.setAttribute("org.eclipse.debug.core.appendEnvironmentVariables", true);
+ wc.setAttribute("org.eclipse.debug.core.appendEnvironmentVariables", true);
//$NON-NLS-1$
- wc.setAttribute( "org.eclipse.jdt.launching.CLASSPATH_PROVIDER",
"org.eclipse.ant.ui.AntClasspathProvider" );
- wc.setAttribute( "org.eclipse.jdt.launching.SOURCEPATH_PROVIDER",
"org.eclipse.ant.ui.AntClasspathProvider" );
+ wc.setAttribute( "org.eclipse.jdt.launching.CLASSPATH_PROVIDER",
"org.eclipse.ant.ui.AntClasspathProvider" ); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute( "org.eclipse.jdt.launching.SOURCEPATH_PROVIDER",
"org.eclipse.ant.ui.AntClasspathProvider" ); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute( "org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID",
"org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType");
+ wc.setAttribute( "org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID",
"org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"); //$NON-NLS-1$
//$NON-NLS-2$
wc.setAttribute( IExternalToolConstants.ATTR_LOCATION, pathToSeamgenBuildXml );
wc.doSave();
- SeamGenPlugin.logInfo( "seamgen launch config saved" );
+ SeamGenPlugin.logInfo( "seamgen launch config saved" ); //$NON-NLS-1$
return wc;
}
@@ -266,19 +268,19 @@
try {
- ILaunchConfiguration launchConfiguration = findLaunchConfig( "seamgen" );
+ ILaunchConfiguration launchConfiguration = findLaunchConfig( "seamgen" );
//$NON-NLS-1$
ILaunchConfigurationWorkingCopy wc = null;
if(launchConfiguration==null) {
- SeamGenPlugin.logInfo( "seamgen launch config not found. Creating one
automatically." );
+ SeamGenPlugin.logInfo( "seamgen launch config not found. Creating one
automatically." ); //$NON-NLS-1$
FileDialog fileDialog = new FileDialog(window.getShell(), SWT.NONE);
- fileDialog.setText( "Select Seam Gen build.xml..." );
- fileDialog.setFileName("build.xml");
+ fileDialog.setText( Messages.SelectBuildXML );
+ fileDialog.setFileName("build.xml"); //$NON-NLS-1$
String text=fileDialog.open();
if (text != null) {
wc = createSeamgenLaunchConfig(text);
} else {
- MessageDialog.openError( window.getShell(), "No build.xml selected",
"You have to select the build.xml to be used by Seam Gen." );
+ MessageDialog.openError( window.getShell(), Messages.NoBuildXMLSelectedTitle,
Messages.NoBuildXMLSelectedDetails );
return;
}
} else {
@@ -291,7 +293,7 @@
if(!questions.isEmpty()) {
QuestionDialog questionDialog = new QuestionDialog(window.getShell(), getTitle(),
getDescription(), questions,getGroups());
if(questionDialog.open()!= QuestionDialog.OK) {
- SeamGenPlugin.logInfo( "User cancelled dialog" );
+ SeamGenPlugin.logInfo( "User cancelled dialog" ); //$NON-NLS-1$
return;
} else {
userProperties = questionDialog.getPropertiesResult();
@@ -313,15 +315,15 @@
File createTempFile = null;
FileOutputStream fos = null;
try {
- createTempFile = File.createTempFile( "seamgenempty",
"properties" );
+ createTempFile = File.createTempFile( "seamgenempty",
"properties" ); //$NON-NLS-1$ //$NON-NLS-2$
fos = new FileOutputStream(createTempFile);
- empties.store( fos, "File used to send intentionally empty valued
properties" );
+ empties.store( fos, "File used to send intentionally empty valued
properties" ); //$NON-NLS-1$
}
catch (FileNotFoundException e) {
- SeamGenPlugin.logError( "Error while running " + getTarget(), e );
+ SeamGenPlugin.logError( "Error while running " + getTarget(), e );
//$NON-NLS-1$
}
catch (IOException e) {
- SeamGenPlugin.logError( "Error while running " + getTarget(), e );
+ SeamGenPlugin.logError( "Error while running " + getTarget(), e );
//$NON-NLS-1$
}
finally {
if (fos != null) {
@@ -349,12 +351,12 @@
launchManager.addLaunchListener( launchListener );
// launchConfiguration = wc.doSave();
- SeamGenPlugin.logInfo( "launching seamgen " + getTarget() );
+ SeamGenPlugin.logInfo( "launching seamgen " + getTarget() ); //$NON-NLS-1$
ILaunch launch = wc.launch( ILaunchManager.RUN_MODE, null );
} catch (CoreException e) {
- SeamGenPlugin.logError( "Exception when trying to launch seamgen", e );
- MessageDialog.openError(getShell(), "Seam-gen could not start",
e.getMessage());
+ SeamGenPlugin.logError( "Exception when trying to launch seamgen", e );
//$NON-NLS-1$
+ MessageDialog.openError(getShell(), Messages.LaunchErrorTitle, e.getMessage());
}
}
@@ -364,7 +366,7 @@
}
public String getDescription() {
- return "Seam Gen " + getTarget();
+ return MessageFormat.format(Messages.SeamGenAction_SeamGenActionName, getTarget());
}
public String getTitle() {
@@ -379,7 +381,7 @@
static public ILaunchConfiguration findLaunchConfig(String name) throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType(
"org.eclipse.ant.AntLaunchConfigurationType" );
+ ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType(
"org.eclipse.ant.AntLaunchConfigurationType" ); //$NON-NLS-1$
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(
launchConfigurationType );
for (int i = 0; i < launchConfigurations.length; i++) { // can't believe there
is no look up by name API
@@ -419,19 +421,19 @@
}
public static Properties getSeamGenProperties(ILaunchConfiguration lc) {
- SeamGenPlugin.logInfo( "launch completed...auto detecting project" );
+ SeamGenPlugin.logInfo( "launch completed...auto detecting project" );
//$NON-NLS-1$
IPath location;
try {
location = ExternalToolsUtil.getLocation( lc );
}
catch (CoreException e2) {
- SeamGenPlugin.logError( "Error while loading seamgen properties", e2 );
+ SeamGenPlugin.logError( "Error while loading seamgen properties", e2 );
//$NON-NLS-1$
return null;
}
- SeamGenPlugin.logInfo( "location: " + location );
- File file = new File(location.toFile().getParentFile(), "build.properties");
- SeamGenPlugin.logInfo( "build.properties: " + location );
+ SeamGenPlugin.logInfo( "location: " + location ); //$NON-NLS-1$
+ File file = new File(location.toFile().getParentFile(), "build.properties");
//$NON-NLS-1$
+ SeamGenPlugin.logInfo( "build.properties: " + location ); //$NON-NLS-1$
if(file.exists()) {
Properties p = new Properties();
@@ -441,7 +443,7 @@
p.load( fileInputStream );
}
catch (Exception e) {
- SeamGenPlugin.logError( "Error while loading seamgen properties", e );
+ SeamGenPlugin.logError( "Error while loading seamgen properties", e );
//$NON-NLS-1$
}
finally {
if(fileInputStream!=null)
@@ -449,7 +451,7 @@
fileInputStream.close();
}
catch (IOException e1) {
- SeamGenPlugin.logError( "Error while closing seamgen properties", e1 );
+ SeamGenPlugin.logError( "Error while closing seamgen properties", e1 );
//$NON-NLS-1$
}
}
return p;
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SetupDeluxeAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SetupDeluxeAction.java 2009-05-25
06:54:13 UTC (rev 15478)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SetupDeluxeAction.java 2009-05-25
06:57:08 UTC (rev 15479)
@@ -1,6 +1,7 @@
package org.jboss.ide.seam.gen.actions;
import java.io.File;
+import java.text.MessageFormat;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
@@ -8,6 +9,7 @@
import java.util.Set;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.jboss.ide.seam.gen.Messages;
import org.jboss.ide.seam.gen.SeamGenPlugin;
import org.jboss.ide.seam.gen.SeamGenProperty;
@@ -15,8 +17,8 @@
IWorkbenchWindowActionDelegate {
- protected static final String DB = "Database";
- protected static final String CODEGEN = "Code generation";
+ protected static final String DB = Messages.SetupDeluxeAction_DatabaseGroup;
+ protected static final String CODEGEN = Messages.SetupDeluxeAction_CodeGenerationGroup;
protected String getTarget() {
return "setup"; //$NON-NLS-1$
@@ -32,11 +34,11 @@
protected Map getQuestions() {
Map properties = new LinkedHashMap();
- properties.put( "project.name.new",
- new SeamGenProperty( "Project name", "project.name" ) {
+ properties.put( "project.name.new", //$NON-NLS-1$
+ new SeamGenProperty( Messages.SetupDeluxeAction_ProjectNameDesc,
"project.name" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty(
- "project.name.new", "" );
+ "project.name.new", "" ); //$NON-NLS-1$ //$NON-NLS-2$
return property;
}
@@ -46,10 +48,10 @@
}
);
- properties.put( "workspace.home.new", new SeamGenProperty(
- "Seam project workspace", "workspace.home" ) {
+ properties.put( "workspace.home.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_WorkspaceHomeDesc, "workspace.home" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "workspace.home",
+ String property = others.getProperty( "workspace.home", //$NON-NLS-1$
SeamGenPlugin.assumeWorkspacePath() );
return property;
}
@@ -58,13 +60,15 @@
return DIR;
};
- public String valid(String string) {
- if(string==null) return null;
- File file = new File(string);
+ public String valid(String filename) {
+ if(filename==null) return null;
+ File file = new File(filename);
if (file.exists() && file.isDirectory()) {
return null;
} else {
- return string + " does not exist or is not a directory";
+ return MessageFormat
+ .format(Messages.SetupDeluxeAction_BadDirectory,
+ filename);
}
}
@@ -72,10 +76,10 @@
} );
- properties.put( "jboss.home.new", new SeamGenProperty(
- "JBoss AS home directory", "jboss.home" ) {
+ properties.put( "jboss.home.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_JBossHomeDesc, "jboss.home" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "jboss.home.new",
+ String property = others.getProperty( "jboss.home.new", //$NON-NLS-1$
SeamGenPlugin.assumeJBossASHome() );
return property;
}
@@ -84,21 +88,23 @@
return DIR;
};
- public String valid(String string) {
- if(string==null) return null;
- File file = new File(string);
+ public String valid(String filename) {
+ if(filename==null) return null;
+ File file = new File(filename);
if (file.exists() && file.isDirectory()) {
return null;
} else {
- return string + " does not exist or is not a directory";
+ return MessageFormat
+ .format(Messages.SetupDeluxeAction_BadDirectory,
+ filename);
}
}
} );
- properties.put( "project.type.new", new SeamGenProperty(
- "Deploy as an EAR or a WAR", "project.type" ) {
+ properties.put( "project.type.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_ProjectTypeDesc, "project.type" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "project.type", "ear" );
+ String property = others.getProperty( "project.type", "ear" );
//$NON-NLS-1$ //$NON-NLS-2$
return property; // ear,war
}
@@ -107,11 +113,11 @@
}
} );
- properties.put( "action.package.new", new SeamGenProperty(
- "Session beans package name", "action.package" ) {
+ properties.put( "action.package.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_ActionPackageDesc, "action.package" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "project.name.new", "" );
- return "com.mydomain." + property;
+ String property = others.getProperty( "project.name.new", "" );
//$NON-NLS-1$ //$NON-NLS-2$
+ return "com.mydomain." + property; //$NON-NLS-1$
}
public String getGroup() {
@@ -119,10 +125,10 @@
}
} );
- properties.put( "model.package.new", new SeamGenProperty(
- "Entity beans package name", "model.package" ) {
+ properties.put( "model.package.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_ModelPackageDesc, "model.package" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "action.package.new", ""
);
+ String property = others.getProperty( "action.package.new", "" );
//$NON-NLS-1$ //$NON-NLS-2$
return property;
}
@@ -131,11 +137,11 @@
}
} );
- properties.put( "test.package.new", new SeamGenProperty(
- "Test cases package name", "test.package" ) {
+ properties.put( "test.package.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_TestPackageDesc, "test.package" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "action.package.new", ""
);
- return property + ".test";
+ String property = others.getProperty( "action.package.new", "" );
//$NON-NLS-1$ //$NON-NLS-2$
+ return property + ".test"; //$NON-NLS-1$
}
public String getGroup() {
@@ -143,11 +149,11 @@
}
} );
- properties.put( "database.type.new", new SeamGenProperty(
- "Database type", "database.type" ) {
+ properties.put( "database.type.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_DatabaseTypeDesc, "database.type" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "database.type.new",
- "hql" );
+ String property = others.getProperty( "database.type.new", //$NON-NLS-1$
+ "hql" ); //$NON-NLS-1$
return property; // hsql,mysql,oracle,postgres,mssql,db2,sybase,enterprisedb
}
@@ -157,11 +163,11 @@
} );
- properties.put( "hibernate.dialect.new", new SeamGenProperty(
- "Hibernate dialect", "hibernate.dialect" ) {
+ properties.put( "hibernate.dialect.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_HibernateDialectDesc, "hibernate.dialect" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "hibernate.dialect.new",
- "org.hibernate.dialect.HSQLDialect" );
+ String property = others.getProperty( "hibernate.dialect.new",
//$NON-NLS-1$
+ "org.hibernate.dialect.HSQLDialect" ); //$NON-NLS-1$
return property;
}
public String getGroup() {
@@ -169,11 +175,11 @@
}
} );
- properties.put( "driver.jar.new", new SeamGenProperty(
- "Filesystem path to the JDBC driver jar", "driver.jar" ) {
+ properties.put( "driver.jar.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_DriverJarDesc, "driver.jar" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "driver.jar.new",
- "lib/hsqldb.jar" );
+ String property = others.getProperty( "driver.jar.new", //$NON-NLS-1$
+ "lib/hsqldb.jar" ); //$NON-NLS-1$
return property;
}
@@ -181,23 +187,24 @@
return JAR;
};
- public String valid(String string) {
- if(string==null) return null;
- File file = new File(string);
+ public String valid(String filename) {
+ if(filename==null) return null;
+ File file = new File(filename);
if (file.exists() && file.isFile()) {
return null;
} else {
- return string + " does not exist or is not a file";
+ return MessageFormat.format(Messages.SetupDeluxeAction_BadFile,
+ filename);
}
}
} );
- properties.put( "hibernate.connection.driver_class.new",
- new SeamGenProperty( "JDBC driver class for your database",
"hibernate.connection.driver_class" ) {
+ properties.put( "hibernate.connection.driver_class.new", //$NON-NLS-1$
+ new SeamGenProperty( Messages.SetupDeluxeAction_HibernateConnectionDriverClassDesc,
"hibernate.connection.driver_class" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty(
- "hibernate.connection.driver_class",
- "org.hsqldb.jdbcDriver" );
+ "hibernate.connection.driver_class", //$NON-NLS-1$
+ "org.hsqldb.jdbcDriver" ); //$NON-NLS-1$
return property;
}
public String getGroup() {
@@ -205,12 +212,12 @@
}
} );
- properties.put( "hibernate.connection.url.new", new SeamGenProperty(
- "JDBC URL for your database", "hibernate.connection.url" ) {
+ properties.put( "hibernate.connection.url.new", new SeamGenProperty(
//$NON-NLS-1$
+ Messages.SetupDeluxeAction_HibernateConnectionUrlDesc,
"hibernate.connection.url" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty(
- "hibernate.connection.url",
- "jdbc:hsqldb:hsql://localhost:1701" );
+ "hibernate.connection.url", //$NON-NLS-1$
+ "jdbc:hsqldb:hsql://localhost:1701" ); //$NON-NLS-1$
return property;
}
public String getGroup() {
@@ -218,11 +225,11 @@
}
} );
- properties.put( "hibernate.connection.username.new",
- new SeamGenProperty( "Database username",
"hibernate.connection.username" ) {
+ properties.put( "hibernate.connection.username.new", //$NON-NLS-1$
+ new SeamGenProperty( Messages.SetupDeluxeAction_HibernateConnectionUsernameDesc,
"hibernate.connection.username" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty(
- "hibernate.connection.username", "sa" );
+ "hibernate.connection.username", "sa" ); //$NON-NLS-1$
//$NON-NLS-2$
return property;
}
public String getGroup() {
@@ -230,11 +237,11 @@
}
} );
- properties.put( "hibernate.connection.password.new",
- new SeamGenProperty( "Database password",
"hibernate.connection.password" ) {
+ properties.put( "hibernate.connection.password.new", //$NON-NLS-1$
+ new SeamGenProperty( Messages.SetupDeluxeAction_DatabasePasswordDesc,
"hibernate.connection.password" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty(
- "hibernate.connection.password", "" );
+ "hibernate.connection.password", "" ); //$NON-NLS-1$
//$NON-NLS-2$
return property;
}
@@ -246,11 +253,11 @@
}
} );
- properties.put( "hibernate.default_schema.new", new SeamGenProperty(
- "Database schema name", "hibernate.default_schema" ) {
+ properties.put( "hibernate.default_schema.new", new SeamGenProperty(
//$NON-NLS-1$
+ Messages.SetupDeluxeAction_HibernateDefaultSchemaDesc,
"hibernate.default_schema" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty(
- "hibernate.default_schema", "" );
+ "hibernate.default_schema", "" ); //$NON-NLS-1$//$NON-NLS-2$
return property;
}
@@ -263,11 +270,11 @@
}
} );
- properties.put( "hibernate.default_catalog.new", new SeamGenProperty(
- "Database catalog name", "hibernate.default_catalog" ) {
+ properties.put( "hibernate.default_catalog.new", new SeamGenProperty(
//$NON-NLS-1$
+ Messages.SetupDeluxeAction_HibernateDefaultCatalogDesc,
"hibernate.default_catalog" ) { //$NON-NLS-1$
public String getDefaultValue(Properties others) {
String property = others.getProperty(
- "hibernate.default_catalog", "" );
+ "hibernate.default_catalog", "" ); //$NON-NLS-1$ //$NON-NLS-2$
return property;
}
@@ -282,10 +289,10 @@
);
- properties.put( "database.exists.new", new SeamGenProperty(
- "Does tables already exist in the database?", "database.exists" )
{
+ properties.put( "database.exists.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_DatabaseExistsDesc, "database.exists" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "database.exists", "y" );
+ String property = others.getProperty( "database.exists", "y" );
//$NON-NLS-1$ //$NON-NLS-2$
return property; // yn
}
@@ -300,10 +307,10 @@
} );
- properties.put( "database.drop.new", new SeamGenProperty(
- "Recreate database tables + data on deploy?", "database.drop" )
{
+ properties.put( "database.drop.new", new SeamGenProperty( //$NON-NLS-1$
+ Messages.SetupDeluxeAction_DatabaseDropDesc, "database.drop" ) {
//$NON-NLS-1$
public String getDefaultValue(Properties others) {
- String property = others.getProperty( "database.drop", "n" );
+ String property = others.getProperty( "database.drop", "n" );
//$NON-NLS-1$ //$NON-NLS-2$
return property; // yn
}
Added:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/messages.properties
(rev 0)
+++
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/messages.properties 2009-05-25
06:57:08 UTC (rev 15479)
@@ -0,0 +1,60 @@
+NewActionAction_BeanName=Bean name
+NewActionAction_Description=Create a new Java interface and SLSB\n with key Seam/EJB3
annotations.
+NewActionAction_LocalInterfaceName=Local interface name
+NewActionAction_MethodName=Method name
+NewActionAction_PageName=Page name
+NewActionAction_SeamComponentName=Seam component name
+NewActionAction_Title=Create new Action
+NewConversationAction_Description=Create a set of classes managing a conversation.\n
+NewConversationAction_Title=Create new conversation
+NewEntityAction_Description=Create a new entity bean\nwith key Seam/EJB3 annotations and
example attributes.
+NewEntityAction_EntityClassName=Entity class name
+NewEntityAction_MasterPageName=Master page name
+NewEntityAction_PageName=Page name
+NewEntityAction_Title=New entity
+NewFormAction_Description=Create a form with a single input field and related\nJava
interface, SLSB with key Seam/EJB3 annotations.
+NewFormAction_Title=Create new form
+CouldNotCreateDatabaseConnectionTitle=Could not create database connection
+CouldNotCreateDatabaseConnectionDetails=Could not create database connection. See Error
log for details
+CouldNotReadDatabaseSettingsTitle=Could not read database settings
+CouldNotReadDatabaseSettingsDetails=Could not read database settings. See Error log for
details
+CreateProjectTitle=Create new Seam project
+CreateProjectQuestion=Create new seam project ?
+SelectBuildXML=Select Seam Gen build.xml...
+NoBuildXMLSelectedTitle=No build.xml selected
+NoBuildXMLSelectedDetails=You have to select the build.xml to be used by Seam Gen.
+CreateConnectionTitle=Create DB Connection
+LaunchErrorTitle=Seam-gen could not start
+CreateConnectionQuestion=Create DB Connection ?
+QuestionDialog_BrowseButton=Browse...
+QuestionDialog_ErrorPreloading=Error while preloading build.properties
+QuestionDialog_SeamGenPropertyRequiresAValue=''{0}'' requires a value
+QuestionDialog_SelectDirectoryDialogText=Select directory
+QuestionDialog_SelectFileDialogText=Select file
+SeamGenAction_ProfileDescription=Database created for seam-gen project
+SeamGenAction_SeamGenActionName=Seam Gen {0}
+SeamGenPlugin_CannotCreateConfig=Cannot create configuration for Seam-Gen tool. Seamgen
build.xml file: {0}
+SeamGenPlugin_ExceptionDuringSearch=Exception occured during search in Launch
Configuration list.
+SeamGenProperty_GeneralGroup=General
+SetupDeluxeAction_ActionPackageDesc=Session beans package name
+SetupDeluxeAction_BadDirectory={0} does not exist or is not a directory
+SetupDeluxeAction_BadFile={0} does not exist or is not a file
+SetupDeluxeAction_CodeGenerationGroup=Code generation
+SetupDeluxeAction_DatabaseDropDesc=Recreate database tables + data on deploy?
+SetupDeluxeAction_DatabaseExistsDesc=Does tables already exist in the database?
+SetupDeluxeAction_DatabaseGroup=Database
+SetupDeluxeAction_DatabasePasswordDesc=Database password
+SetupDeluxeAction_DatabaseTypeDesc=Database type
+SetupDeluxeAction_DriverJarDesc=Filesystem path to the JDBC driver jar
+SetupDeluxeAction_HibernateConnectionDriverClassDesc=JDBC driver class for your database
+SetupDeluxeAction_HibernateConnectionUrlDesc=JDBC URL for your database
+SetupDeluxeAction_HibernateConnectionUsernameDesc=Database username
+SetupDeluxeAction_HibernateDefaultCatalogDesc=Database catalog name
+SetupDeluxeAction_HibernateDefaultSchemaDesc=Database schema name
+SetupDeluxeAction_HibernateDialectDesc=Hibernate dialect
+SetupDeluxeAction_JBossHomeDesc=JBoss AS home directory
+SetupDeluxeAction_ModelPackageDesc=Entity beans package name
+SetupDeluxeAction_ProjectNameDesc=Project name
+SetupDeluxeAction_ProjectTypeDesc=Deploy as an EAR or a WAR
+SetupDeluxeAction_TestPackageDesc=Test cases package name
+SetupDeluxeAction_WorkspaceHomeDesc=Seam project workspace