Author: mareshkau
Date: 2009-11-25 06:13:08 -0500 (Wed, 25 Nov 2009)
New Revision: 18817
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5184, new class from Snjezana Peco has been
commited
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java 2009-11-25
11:13:08 UTC (rev 18817)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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;
+import org.mozilla.interfaces.nsIDOMElement;
+
+public class XulRunnerEditor2 extends XulRunnerEditor {
+
+ private MozillaEditor mozillaEditor;
+
+ public XulRunnerEditor2(Composite parent, MozillaEditor mozillaEditor) throws
XulRunnerException {
+ super(parent);
+ this.mozillaEditor = mozillaEditor;
+ }
+
+ public void onLoadWindow() {
+ if (mozillaEditor == null) {
+ return;
+ }
+ // if the first load page
+ if (!mozillaEditor.isRefreshPage()) {
+ super.onLoadWindow();
+// MozillaEditor.this.onLoadWindow();
+ }
+ // if only refresh page
+ else {
+ mozillaEditor.onReloadWindow();
+ mozillaEditor.setRefreshPage(false);
+ }
+
+ }
+ public void onElementResize(nsIDOMElement element, int constrains, int top, int left,
int width, int height) {
+ if (mozillaEditor != null && mozillaEditor.getEditorDomEventListener() != null)
{
+ mozillaEditor.getEditorDomEventListener().elementResized(element, constrains, top,
left, width, height);
+ }
+ }
+ public void onShowTooltip(int x, int y, String text) {
+ if (mozillaEditor != null && mozillaEditor.getEditorDomEventListener() != null)
{
+ mozillaEditor.getEditorDomEventListener().onShowTooltip(x, y, text);
+ }
+ }
+ public void onHideTooltip() {
+ if (mozillaEditor != null && mozillaEditor.getEditorDomEventListener() != null)
{
+ mozillaEditor.getEditorDomEventListener().onHideTooltip();
+ }
+ }
+ public void onDispose() {
+ if (mozillaEditor != null) {
+ mozillaEditor.tearDownEditor();
+ mozillaEditor.removeDomEventListeners();
+ mozillaEditor = null;
+ }
+ super.onDispose();
+ }
+}