Author: mareshkau
Date: 2007-09-14 13:39:18 -0400 (Fri, 14 Sep 2007)
New Revision: 3634
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
restore selection functionality on MAC OS
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-09-14
16:15:39 UTC (rev 3633)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-09-14
17:39:18 UTC (rev 3634)
@@ -274,7 +274,7 @@
pageContext.fireTaglibsChanged();
}
- void dispose() {
+ public void dispose() {
switcher.destroyActiveEditor();
if (templateManager != null) {
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2007-09-14
16:15:39 UTC (rev 3633)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2007-09-14
17:39:18 UTC (rev 3634)
@@ -69,7 +69,6 @@
private StructuredTextEditor sourceEditor = null;
private MozillaEditor visualEditor;
private IEditorPart activeEditor;
- private VpeController controller;
private XModelTreeListener listener;
XModelObject optionsObject;
private SelectionBar selectionBar = new SelectionBar();
@@ -360,10 +359,10 @@
//Added by Max Areshkau
//was fixed bug(border which drawed by iflasher doesn't hide on MACOS when we
swith
// to souce view)
- if(Platform.getOS().equals(Platform.OS_MACOSX)&&controller!=null) {
-
- controller.visualRefresh();
- }
+// if(Platform.getOS().equals(Platform.OS_MACOSX)&&controller!=null) {
+//
+// visualEditor.getController().visualRefresh();
+// }
}
if (visualContent != null)
visualContent.setVisible(false);
@@ -393,9 +392,11 @@
container.layout();
if (visualMode == SOURCE_MODE && type != SOURCE_MODE) {
visualMode = type;
- if (controller != null) {
- controller.visualRefresh();
- controller.sourceSelectionChanged();
+ if (visualEditor.getController() != null) {
+ visualEditor.getController().visualRefresh();
+ if(type!=PREVIEW_MODE) {
+ visualEditor.getController().sourceSelectionChanged();
+ }
}
}
visualMode = type;
@@ -503,12 +504,12 @@
.setEditorLoadWindowListener(new EditorLoadWindowListener() {
public void load() {
visualEditor.setEditorLoadWindowListener(null);
- controller = new VpeController(
- VpeEditorPart.this);
- selectionBar.setVpeController(controller);
- controller.setSelectionBarController(selectionBar);
+ visualEditor.setController(new VpeController(
+ VpeEditorPart.this));
+ selectionBar.setVpeController(visualEditor.getController());
+ visualEditor.getController().setSelectionBarController(selectionBar);
try {
- controller.init(sourceEditor, visualEditor);
+ visualEditor.getController().init(sourceEditor, visualEditor);
} catch (Exception e) {
VpePlugin.reportProblem(e);
}
@@ -614,11 +615,6 @@
shell.removeShellListener(activationListener);
activationListener = null;
}
- if (controller != null) {
- controller.dispose();
- controller = null;
- }
-
// editor will disposed as part of multipart editor
if (sourceEditor != null) {
sourceEditor.dispose();
@@ -688,8 +684,8 @@
fIsHandlingActivation = true;
try {
if (sourceEditor != null) {
- if (controller != null) {
- controller.refreshTemplates();
+ if (visualEditor.getController() != null) {
+ visualEditor.getController().refreshTemplates();
}
sourceEditor.safelySanityCheckState(getEditorInput());
}
@@ -701,7 +697,7 @@
}
public VpeController getController() {
- return controller;
+ return visualEditor.getController();
}
}
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2007-09-14
16:15:39 UTC (rev 3633)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2007-09-14
17:39:18 UTC (rev 3634)
@@ -77,8 +77,10 @@
private nsIDOMNode headNode;
private nsIDOMEventTarget contentAreaEventTarget;
private MozillaDomEventListener contentAreaEventListener = new
MozillaDomEventListener();
+ //TODO Max Areshkau may be we need delete this
private MozillaBaseEventListener baseEventListener = null;
private EditorLoadWindowListener editorLoadWindowListener;
+ //
private EditorDomEventListener editorDomEventListener;
private IVpeToolBarManager vpeToolBarManager;
private FormatControllerManager formatControllerManager = new
FormatControllerManager();
@@ -299,15 +301,17 @@
public void dispose() {
removeDomEventListeners();
- // TODO Max Areshkau figure out with ClipboardDragDropHooks
-// removeClipboardDragDropHooks();
-
+ if(getController()!=null) {
+ controller.dispose();
+ controller=null;
+ }
if (xulRunnerEditor != null) {
xulRunnerEditor.getBrowser().dispose();
xulRunnerEditor = null;
}
super.dispose();
+
}
public void setEditorLoadWindowListener(EditorLoadWindowListener listener) {
@@ -582,7 +586,7 @@
/**
* @return the controller
*/
- protected VpeController getController() {
+ public VpeController getController() {
return controller;
}
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2007-09-14
16:15:39 UTC (rev 3633)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2007-09-14
17:39:18 UTC (rev 3634)
@@ -13,6 +13,7 @@
import java.util.regex.Pattern;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
@@ -22,6 +23,7 @@
import org.jboss.tools.vpe.xulrunner.XulRunnerException;
import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
import org.mozilla.interfaces.inIFlasher;
+import org.mozilla.interfaces.nsIBaseWindow;
import org.mozilla.interfaces.nsIClipboardDragDropHookList;
import org.mozilla.interfaces.nsIComponentManager;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -116,12 +118,16 @@
}
});
}};
- addListener(SWT.Activate, eventListenet);
+// addListener(SWT.Activate, eventListenet);
addListener(SWT.Paint, eventListenet);
- addListener(SWT.Resize, eventListenet);
+ //Commented by Max Areshkau (bug on Mac OS X10.4
+ //when switch from visual to preview selection rectangle doen't disappear
+// addListener(SWT.Resize, eventListenet);
addListener(SWT.Show, eventListenet);
addListener(SWT.FocusIn, eventListenet);
- addListener(SWT.FocusOut, eventListenet);
+ //Commented by Max Areshkau (bug on Mac OS X10.4
+ //when switch from visual to preview selection rectangle doen't disappear
+// addListener(SWT.FocusOut, eventListenet);
addListener(SWT.Selection, eventListenet);
addListener(SWT.Paint, eventListenet);
@@ -463,12 +469,13 @@
public void showSelectionRectangle() {
// ((nsIBaseWindow)getWebBrowser().queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID)).repaint(false);
+
if (getIFlasher() != null && getLastSelectedElement() != null) {
if (scrollRegtangleFlag) {
scrollRegtangleFlag = false;
scrollToElement(getLastSelectedElement());
- }
+ }
//checks visability of element
if(checkVisability(getLastSelectedElement())){
@@ -491,6 +498,14 @@
getIFlasher().drawElementOutline(domElement);
}
}
+ } else if(getIFlasher()!=null){
+ //Max Areshkau (bug on Mac OS X, when we swithc to preview grom other view, selection
rectangle doesn't disappear
+ //TODO Max Areshkau (may be exist passability not draw selection on resize event when
we swithes to other view)
+ try {
+ ((nsIBaseWindow)getWebBrowser().queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID)).repaint(true);
+ } catch(XPCOMException ex) {
+ //just ignore its
+ }
}
}
/**