Author: mareshkau
Date: 2007-08-15 05:27:38 -0400 (Wed, 15 Aug 2007)
New Revision: 3135
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-754, in progress
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-08-15
09:27:30 UTC (rev 3134)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2007-08-15
09:27:38 UTC (rev 3135)
@@ -26,10 +26,14 @@
import org.mozilla.interfaces.nsIDocShell;
import org.mozilla.interfaces.nsIDragService;
import org.mozilla.interfaces.nsIDragSession;
+import org.mozilla.interfaces.nsIEditingSession;
import org.mozilla.interfaces.nsIInterfaceRequestor;
+import org.mozilla.interfaces.nsISelection;
import org.mozilla.interfaces.nsIServiceManager;
import org.mozilla.interfaces.nsISupports;
import org.mozilla.interfaces.nsITransferable;
+import org.mozilla.xpcom.Mozilla;
+import org.mozilla.xpcom.XPCOMException;
/**
* @author Sergey Vasilyev (svasilyev(a)exadel.com)
@@ -59,12 +63,17 @@
public static final String TRANS_FLAVOR_kUnicodeMime = "text/unicode";
public static final String TRANS_FLAVOR_kNativeHTMLMime =
"application/x-moz-nativehtml";
+ /**Editor types */
+ public static final String AEDITOR_TYPE_HTML="html";
+
+
/**
* @param parent
* @throws XulRunnerException
*/
public XulRunnerEditor(Composite parent) throws XulRunnerException {
super(parent);
+
}
public boolean isMozillaDragFlavor() {
@@ -145,4 +154,23 @@
nsIComponentManager componentManager = getComponentManager();
return (nsITransferable)
componentManager.createInstanceByContractID(XPCOM.NS_TRANSFERABLE_CONTRACTID, this,
nsITransferable.NS_ITRANSFERABLE_IID);
}
+
+ /**
+ * Returns selection controller which used in selection functionality
+ * @return
+ */
+ public nsISelection getSelection() {
+
+// try{
+ nsIServiceManager serviceManager = Mozilla.getInstance().getServiceManager();
+ nsIEditingSession editingSession = (nsIEditingSession)
serviceManager.getServiceByContractID
+ ("(a)mozilla.org/editor/editingsession;1",
nsIEditingSession.NS_IEDITINGSESSION_IID);
+ nsIDOMWindow domWindow = getWebBrowser().getContentDOMWindow();
+ nsISelection selection = domWindow.getSelection();
+ return selection;
+// } catch(XPCOMException exception) {
+// exception.printStackTrace();
+// }
+// return null;
+ }
}