Author: scabanovich
Date: 2010-09-16 11:23:38 -0400 (Thu, 16 Sep 2010)
New Revision: 24961
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizard.java
Log:
https://jira.jboss.org/browse/JBIDE-7087
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizard.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizard.java 2010-09-16
13:03:25 UTC (rev 24960)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizard.java 2010-09-16
15:23:38 UTC (rev 24961)
@@ -48,7 +48,11 @@
page1 = new ExternalizeStringsWizardPage(
ExternalizeStringsWizardPageName, editor, bm);
page2 = new WizardNewFileCreationPage(NewFileCreationPageName,
- (IStructuredSelection) editor.getSelectionProvider().getSelection());
+ (IStructuredSelection) editor.getSelectionProvider().getSelection()) {
+ protected InputStream getInitialContents() {
+ return new ByteArrayInputStream(page1.getKeyValuePair().getBytes());
+ }
+ };
page2.setTitle(VpeUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE);
page2.setDescription(VpeUIMessages.EXTERNALIZE_STRINGS_DIALOG_DESCRIPTION);
page2.setImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
@@ -77,9 +81,10 @@
return false;
}
/*
- * Add "key=value" to the bundle
+ * Add "key=value" to the bundle if file is not new,
+ * If it is new, it got input by getInitialContent()
*/
- if (bundleFile.exists()) {
+ if (bundleFile.exists() && !page1.isNewFile()) {
InputStream is = new ByteArrayInputStream(page1.getKeyValuePair().getBytes());
try {
bundleFile.appendContents(is, false, true, null);