Author: dmaliarevich
Date: 2010-10-06 13:09:03 -0400 (Wed, 06 Oct 2010)
New Revision: 25527
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/outline/cssdialog/common/Constants.java
Log:
https://jira.jboss.org/browse/JBIDE-7247 , initial values are set.
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-06
17:08:30 UTC (rev 25526)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java 2010-10-06
17:09:03 UTC (rev 25527)
@@ -16,13 +16,17 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.common.model.ui.ModelUIImages;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.bundle.BundleMap;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
public class ExternalizeStringsWizard extends Wizard {
@@ -56,6 +60,28 @@
page2.setTitle(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE);
page2.setDescription(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_DESCRIPTION);
page2.setImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
+ /*
+ *
https://jira.jboss.org/browse/JBIDE-7247
+ * Set initial values for the new properties file
+ */
+ if (editor.getEditorInput() instanceof IStorageEditorInput) {
+ try {
+ IPath fullPath = ((IStorageEditorInput)
editor.getEditorInput()).getStorage().getFullPath();
+ page2.setContainerFullPath(fullPath);
+ } catch (CoreException e) {
+ JspEditorPlugin.getDefault().logError(e);
+ }
+
+ }
+ String fileName = editor.getEditorInput().getName();
+ int pos = fileName.lastIndexOf(Constants.DOT);
+ if (pos != -1) {
+ fileName = fileName.substring(0, pos) + Constants.PROPERTIES_EXTENTION;
+ }
+ page2.setFileName(fileName);
+ /*
+ * Add all the pages to the wizard
+ */
addPage(page1);
addPage(page2);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java 2010-10-06
17:08:30 UTC (rev 25526)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java 2010-10-06
17:09:03 UTC (rev 25527)
@@ -83,6 +83,7 @@
public static final String END_BRACKET = ")"; //$NON-NLS-1$
public static final String GT = ">"; //$NON-NLS-1$
public static final String LT = "<"; //$NON-NLS-1$
+ public static final String PROPERTIES_EXTENTION = ".properties";
//$NON-NLS-1$
public static final String LEFT_BRACE = "{"; //$NON-NLS-1$
public static final String RIGHT_BRACE = "}"; //$NON-NLS-1$