[jbosstools-commits] JBoss Tools SVN: r22877 - trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/common.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Jun 18 05:41:13 EDT 2010


Author: yzhishko
Date: 2010-06-18 05:41:13 -0400 (Fri, 18 Jun 2010)
New Revision: 22877

Modified:
   trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/common/CSSStyleListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5979 - safe check for editor instance was added.

Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/common/CSSStyleListener.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/common/CSSStyleListener.java	2010-06-18 05:54:50 UTC (rev 22876)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/common/CSSStyleListener.java	2010-06-18 09:41:13 UTC (rev 22877)
@@ -159,12 +159,13 @@
 		 */
 		IEditorPart editorPart = PlatformUI.getWorkbench()
 				.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-		StructuredTextEditor structuredTextEditor = (StructuredTextEditor) editorPart;
-		Object page = structuredTextEditor.getAdapter(IPropertySheetPage.class);
-		if (page instanceof ConfigurablePropertySheetPage) {
-			((ConfigurablePropertySheetPage) page).refresh();
+		if (editorPart instanceof StructuredTextEditor) {
+			StructuredTextEditor structuredTextEditor = (StructuredTextEditor) editorPart;
+			Object page = structuredTextEditor.getAdapter(IPropertySheetPage.class);
+			if (page instanceof ConfigurablePropertySheetPage) {
+				((ConfigurablePropertySheetPage) page).refresh();
+			}
 		}
-		
 		clearListeners(newValue);
 		clearListeners(oldValue);
 		Object[] array = listeners.getListeners();



More information about the jbosstools-commits mailing list