Author: snjeza
Date: 2008-08-07 22:02:16 -0400 (Thu, 07 Aug 2008)
New Revision: 9615
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
JBIDE-2504 Problems with VPE refresh when CTRL+Z(Y) hotkeys used
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-08-07
22:36:19 UTC (rev 9614)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-08
02:02:16 UTC (rev 9615)
@@ -524,6 +524,9 @@
uiJob.setPriority(Job.LONG);
// Fix of JBIDE-1900
+
+ uiJob.schedule(400L);
+ } else {
uiJob.cancel();
uiJob.schedule(400L);
}
@@ -1673,9 +1676,11 @@
public void templateReloaded() {
visualRefresh();
}
-
+
public void visualRefresh() {
-
+ if (uiJob != null && uiJob.getState() != Job.NONE) {
+ return;
+ }
if (visualRefresfJob == null || visualRefresfJob.getState() == Job.NONE) {
visualRefresfJob = new UIJob(VpeUIMessages.VPE_VISUAL_REFRESH_JOB) {
@@ -1687,47 +1692,32 @@
return Status.CANCEL_STATUS;
}
+ if (!switcher
+ .startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ return Status.CANCEL_STATUS;
+ }
+ try {
+ monitor.beginTask(VpeUIMessages.VPE_VISUAL_REFRESH_JOB,
+ IProgressMonitor.UNKNOWN);
+ visualRefreshImpl();
+ monitor.done();
+ } catch (VpeDisposeException exc) {
+ // just ignore this exception
+ } catch (NullPointerException ex) {
- if (uiJob != null && uiJob.getState() == Job.RUNNING) {
- uiJob.cancel();
- getChangeEvents().clear();
- // wait while ui job is finished
- schedule(500);
- } else {
-
- if (uiJob != null) {
-
- uiJob.cancel();
- getChangeEvents().clear();
+ if (switcher != null) {
+ throw ex;
+ } else {
+ // class was disposed and exception result of
+ // that we can't stop
+ // refresh job in time, so we just ignore this
+ // exception
}
- if (!switcher
- .startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
- return Status.CANCEL_STATUS;
- }
- try {
- monitor.beginTask(
- VpeUIMessages.VPE_VISUAL_REFRESH_JOB,
- IProgressMonitor.UNKNOWN);
- visualRefreshImpl();
- monitor.done();
- } catch (VpeDisposeException exc) {
- // just ignore this exception
- } catch (NullPointerException ex) {
+ } finally {
- if (switcher != null) {
- throw ex;
- } else {
- // class was disposed and exception result of
- // that we can't stop
- // refresh job in time, so we just ignore this
- // exception
- }
- } finally {
+ if (switcher != null) {
- if (switcher != null) {
-
- switcher.stopActiveEditor();
- }
+ switcher.stopActiveEditor();
}
}
return Status.OK_STATUS;
Show replies by date