Author: dmaliarevich
Date: 2010-10-15 10:21:16 -0400 (Fri, 15 Oct 2010)
New Revision: 25867
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizardPage.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7218 , Empty line after 'key=value' pair was
removed, junit was corrected.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java 2010-10-15
14:01:13 UTC (rev 25866)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java 2010-10-15
14:21:16 UTC (rev 25867)
@@ -116,7 +116,12 @@
* via getInitialContent() method of the page2 during the file creation.
*/
if (bundleFile.exists() && !page1.isNewFile()) {
- InputStream is = new ByteArrayInputStream(page1.getKeyValuePair().getBytes());
+ /*
+ *
https://jira.jboss.org/browse/JBIDE-7218
+ * Add only one line before adding the value.
+ */
+ String writeToFile = "\n" + page1.getKeyValuePair(); //$NON-NLS-1$
+ InputStream is = new ByteArrayInputStream(writeToFile.getBytes());
try {
bundleFile.appendContents(is, false, true, null);
is.close();
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizardPage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizardPage.java 2010-10-15
14:01:13 UTC (rev 25866)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizardPage.java 2010-10-15
14:21:16 UTC (rev 25867)
@@ -525,7 +525,7 @@
* @return a pair <code>\nkey=value\n</code>
*/
public String getKeyValuePair() {
- return "\n" + propsKey.getText() + Constants.EQUAL + propsValue.getText() +
"\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ return propsKey.getText() + Constants.EQUAL + propsValue.getText();
}
/**
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2010-10-15
14:01:13 UTC (rev 25866)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/wizard/ExternalizeStringsDialogTest.java 2010-10-15
14:21:16 UTC (rev 25867)
@@ -341,7 +341,7 @@
SWTBotEditor editor2 = SWTTestExt.eclipse.openFile(
JBT_TEST_PROJECT_NAME, "WebContent", "pages", //$NON-NLS-1$
//$NON-NLS-2$
"externalize.properties"); //$NON-NLS-1$
- editor2.toTextEditor().selectLine(1);
+ editor2.toTextEditor().selectLine(0);
String line = editor2.toTextEditor().getSelection();
assertEquals("Created file is incorrect", "Input=Input", line);
//$NON-NLS-1$ //$NON-NLS-2$
}
@@ -534,7 +534,7 @@
SWTBotEditor editor2 = SWTTestExt.eclipse.openFile(
JBT_TEST_PROJECT_NAME, "WebContent", "pages", //$NON-NLS-1$
//$NON-NLS-2$
"hello.properties"); //$NON-NLS-1$
- editor2.toTextEditor().selectLine(1);
+ editor2.toTextEditor().selectLine(0);
String line = editor2.toTextEditor().getSelection();
assertEquals("Created file is incorrect", "Plain_text=Plain text",
line); //$NON-NLS-1$ //$NON-NLS-2$
/*