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

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Jan 2 16:58:26 EST 2009


Author: yradtsevich
Date: 2009-01-02 16:58:26 -0500 (Fri, 02 Jan 2009)
New Revision: 12871

Modified:
   trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
CODING IN PROGRESS - issue JBIDE-3441: VPE - Preferences - change size of VE pane - press OK - Preview will show empty page
https://jira.jboss.org/jira/browse/JBIDE-3441

Code refactored.

Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java	2008-12-31 12:22:02 UTC (rev 12870)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java	2009-01-02 21:58:26 UTC (rev 12871)
@@ -173,7 +173,7 @@
 	/** @deprecated */
 	private VpeSelectionBuilder selectionBuilder;
 	// private VpeVisualKeyHandler visualKeyHandler;
-	ActiveEditorSwitcher switcher = new ActiveEditorSwitcher();
+	private ActiveEditorSwitcher switcher = new ActiveEditorSwitcher();
 	private Attr lastRemovedAttr;
 	private String lastRemovedAttrName;
 	private boolean mouseUpSelectionReasonFlag;
@@ -1369,8 +1369,7 @@
 			vpeVisualRefreshJob.schedule(delay);
 		}
 	}
-	
-public static int ii = 0;
+
 	void visualRefreshImpl() {
 		visualEditor.hideResizer();
 
@@ -1380,9 +1379,7 @@
 		} else {
 		    //Fix bugs JBIDE-2750
 			visualBuilder.setSelectionRectangle(null);
-			ii++;
 			visualEditor.reload();
-			ii--;
 //			IDOMModel sourceModel = (IDOMModel) getModel();
 //			if (sourceModel != null) {
 //				IDOMDocument sourceDocument = sourceModel.getDocument();
@@ -2733,6 +2730,11 @@
 	public ISelectionManager getSelectionManager() {
 		return selectionManager;
 	}
+
+	/**@return the switcher */
+	public ActiveEditorSwitcher getSwitcher() {
+		return switcher;
+	}
 }
 
 final class VpeVisualRefreshJob extends UIJob {
@@ -2752,13 +2754,14 @@
 				return Status.CANCEL_STATUS;
 			}
 			
-			// if this job is nested in another VpeVisualRefreshJob, then cancel it and run later
+			// if this job is nested in another VpeVisualRefreshJob, then cancel it and run again later
 			if (nestedLevel > 1) {
 				vpeController.scheduleNewVpeVisualRefreshJob(300L);
 				return Status.CANCEL_STATUS;
 			}
 			
-			if (!vpeController.switcher.startActiveEditor(VpeController.ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+			final VpeController.ActiveEditorSwitcher switcher = vpeController.getSwitcher();
+			if (!switcher.startActiveEditor(VpeController.ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
 				return Status.CANCEL_STATUS;
 			}
 			
@@ -2770,7 +2773,7 @@
 			} catch (VpeDisposeException exc) {
 				// just ignore this exception
 			} catch (NullPointerException ex) {
-				if (vpeController.switcher != null) {
+				if (switcher != null) {
 					throw ex;
 				} else {
 					// class was disposed and exception result of
@@ -2779,8 +2782,8 @@
 					// exception
 				}
 			} finally {
-				if (vpeController.switcher != null) {
-					vpeController.switcher.stopActiveEditor();
+				if (switcher != null) {
+					switcher.stopActiveEditor();
 				}
 			}
 			return Status.OK_STATUS;




More information about the jbosstools-commits mailing list