[jbosstools-commits] JBoss Tools SVN: r22913 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Jun 21 06:58:03 EDT 2010


Author: dmaliarevich
Date: 2010-06-21 06:58:03 -0400 (Mon, 21 Jun 2010)
New Revision: 22913

Modified:
   trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizardPage.java
Log:
https://jira.jboss.org/browse/JBIDE-6287 , combobox initalization was corrected.

Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizardPage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizardPage.java	2010-06-21 10:56:33 UTC (rev 22912)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dialog/ExternalizeStringsWizardPage.java	2010-06-21 10:58:03 UTC (rev 22913)
@@ -226,18 +226,7 @@
 		rbCombo.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				IFile bundleFile = bm.getBundleFile(rbCombo.getText());
-				String bundlePath = Constants.EMPTY;
-				if (bundleFile != null) {
-					bundlePath = bundleFile.getFullPath().toString();
-					updateTable(bundleFile);
-				} else {
-					VpePlugin.getDefault().logError(
-							"Could not get Bundle File for resource '" //$NON-NLS-1$
-									+ rbCombo.getText() + "'"); //$NON-NLS-1$
-				}
-				propsFile.setText(bundlePath);
-				
+				setResourceBundlePath(rbCombo.getText());
 				updateDuplicateKeyStatus();
 				updateStatus();
 			}
@@ -361,6 +350,7 @@
 				 */
 				if (rbCombo.getItemCount() > 0) {
 					rbCombo.select(0);
+					setResourceBundlePath(rbCombo.getText());
 				}
 			}
 			/*
@@ -805,5 +795,25 @@
 		 */
 		return result;
 	}
+
+	/**
+	 * Sets the resource bundle path according to the selection
+	 * from the bundles list.
+	 *
+	 * @param bundleName the resource bundle name
+	 */
+	private void setResourceBundlePath(String bundleName) {
+		IFile bundleFile = bm.getBundleFile(bundleName);
+		String bundlePath = Constants.EMPTY;
+		if (bundleFile != null) {
+			bundlePath = bundleFile.getFullPath().toString();
+			updateTable(bundleFile);
+		} else {
+			VpePlugin.getDefault().logError(
+					"Could not get Bundle File for resource '" //$NON-NLS-1$
+							+ bundleName + "'"); //$NON-NLS-1$
+		}
+		propsFile.setText(bundlePath);
+	}
 	
 }



More information about the jbosstools-commits mailing list