Author: mareshkau
Date: 2009-11-25 08:53:01 -0500 (Wed, 25 Nov 2009)
New Revision: 18823
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5184
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java 2009-11-25
13:53:01 UTC (rev 18823)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.mozilla;
+
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.vpe.xulrunner.XulRunnerException;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+
+public class XulRunnerPreview extends XulRunnerEditor {
+
+ private MozillaPreview mozillaPreview;
+
+ public XulRunnerPreview(Composite parent, MozillaPreview mozillaPreview) throws
XulRunnerException {
+ super(parent);
+ this.mozillaPreview = mozillaPreview;
+ }
+
+ public void onLoadWindow() {
+ super.onLoadWindow();
+ mozillaPreview.onLoadWindow();
+ }
+
+ public void onShowTooltip(int x, int y, String text) {
+ if (mozillaPreview != null && mozillaPreview.getEditorDomEventListener() !=
null) {
+ mozillaPreview.getEditorDomEventListener().onShowTooltip(x, y, text);
+ }
+ }
+ public void onHideTooltip() {
+ if (mozillaPreview != null && mozillaPreview.getEditorDomEventListener() !=
null) {
+ mozillaPreview.getEditorDomEventListener().onHideTooltip();
+ }
+ }
+
+ public void onDispose() {
+ if (mozillaPreview != null) {
+ mozillaPreview.removeDomEventListeners();
+ mozillaPreview = null;
+ }
+ super.onDispose();
+ }
+}