[Sciviews-commits] r109 - in komodo/SciViews-K: . content content/js

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 3 15:01:07 CET 2009


Author: prezez
Date: 2009-02-03 15:01:07 +0100 (Tue, 03 Feb 2009)
New Revision: 109

Added:
   komodo/SciViews-K/content/RBrowserOverlay.xul
   komodo/SciViews-K/content/js/commands.js
   komodo/SciViews-K/content/overlayMain.xul
Modified:
   komodo/SciViews-K/chrome.manifest
Log:
R-object browser is put into separate overlay.
Added R-Menu stub (new script included: commands.js).


Modified: komodo/SciViews-K/chrome.manifest
===================================================================
--- komodo/SciViews-K/chrome.manifest	2009-02-03 13:39:29 UTC (rev 108)
+++ komodo/SciViews-K/chrome.manifest	2009-02-03 14:01:07 UTC (rev 109)
@@ -1,5 +1,7 @@
 content sciviewsk jar:sciviewsk.jar!/content/ xpcnativewrappers=yes
-overlay chrome://komodo/content/komodo.xul chrome://sciviewsk/content/overlay.xul
+overlay chrome://komodo/content/komodo.xul chrome://sciviewsk/content/overlayMain.xul
+overlay chrome://komodo/content/komodo.xul chrome://sciviewsk/content/RBrowserOverlay.xul
+
 # Those two items are not finished yet, and are thus commented out
 #overlay chrome://komodo/content/komodo.xul chrome://sciviewsk/content/rconsole.xul
 #overlay chrome://komodo/content/pref/pref.xul chrome://sciviewsk/content/prefsOverlay.xul

Added: komodo/SciViews-K/content/RBrowserOverlay.xul
===================================================================
--- komodo/SciViews-K/content/RBrowserOverlay.xul	                        (rev 0)
+++ komodo/SciViews-K/content/RBrowserOverlay.xul	2009-02-03 14:01:07 UTC (rev 109)
@@ -0,0 +1,339 @@
+<?xml version="1.0"?>
+<!-- ***** BEGIN LICENSE BLOCK *****
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is SciViews-K by Philippe Grosjean & Romain Francois.
+
+ Portions created by ActiveState Software Inc are Copyright (C) 2000-2008
+ ActiveState Software Inc. All Rights Reserved.
+
+ Contributor(s):
+   Philippe Grosjean
+   Romain Francois
+   Kamil Barton
+   ActiveState Software Inc
+
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
+
+ ***** END LICENSE BLOCK ***** -->
+<!DOCTYPE overlay PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" [
+  <!ENTITY % sciviewskDTD SYSTEM "chrome://sciviewsk/locale/sciviewsk.dtd">
+  %sciviewskDTD;
+]>
+
+<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="chrome://komodo/skin/global/global.p.css" type="text/css"?>
+<?xml-stylesheet href="chrome://komodo/skin/bindings/buttons.css" type="text/css"?>
+<?xml-stylesheet href="chrome://sciviewsk/skin/sciviewsk.css" type="text/css"?>
+
+<overlay id="sciviewsRBrowserOverlay"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<popupset id="extensionPopupSet">
+  <menupopup id="rObjectsContext"
+    onpopupshowing="rObjectsTree.contextOnShow();">
+        <menuitem class="primary_menu_item"
+                  id="menu_robjects_cmd_insertname"
+                  command="robjects_cmd_insertname"
+                  acceltext="Ins" />
+	  <menuitem
+                  id="menu_robjects_cmd_insertfullname"
+                  command="robjects_cmd_insertfullname"
+                  acceltext="Ctrl+Ins" />
+        <menuitem id="menu_robjects_cmd_removeobj"
+                  command="robjects_cmd_removeobj"
+                  key="key_cmd_delete"
+                  class="menuitem-iconic list-item-remove-icon"
+                  acceltext="Del" />
+        <menuitem id="menu_robjects_cmd_attach" command="robjects_cmd_attach" />
+        <menuitem id="menu_robjects_cmd_detach" command="robjects_cmd_detach" />
+        <menuseparator keep="false" intoplevel="true" />
+        <menuitem id="menu_robjects_cmd_print" command="robjects_cmd_print" />
+        <menuitem id="menu_robjects_cmd_plot" command="robjects_cmd_plot" />
+        <menuitem id="menu_robjects_cmd_summary" command="robjects_cmd_summary" />
+        <menuitem id="menu_robjects_cmd_str" command="robjects_cmd_str" />
+        <menuitem id="menu_robjects_cmd_args" command="robjects_cmd_args" />
+        <menuitem id="menu_robjects_cmd_names" command="robjects_cmd_names" />
+        <menuseparator keep="false" intoplevel="true" />
+        <menuitem id="menu_robjects_cmd_help" command="robjects_cmd_help" />
+  </menupopup>
+</popupset>
+
+
+
+<broadcasterset id="broadcasterset_global">
+  <broadcaster
+    id="cmd_robjects_viewSearchPath"
+    desc="&sciviews.robjects.tab;: &sciviews.robjects.showHide;"
+    label="&sciviews.robjects.showHide;"
+    splitter="bottom_splitter"
+    box="robjects_searchpath_panel"
+    oncommand="rObjectsTree.toggleViewSearchPath(event);"
+    checked="true"
+    state="open"
+  />
+</broadcasterset>
+
+<commandset id="allcommands">
+  <commandset id="r-objects-commands">
+    <command id="robjects_cmd_insertname"
+		label="&sciviews.robjects.insName;"
+		accesskey="I"
+		oncommand="rObjectsTree.insertName(false);" />
+    <command id="robjects_cmd_insertfullname"
+		label="&sciviews.robjects.insFullName;"
+		accesskey="F"
+		oncommand="rObjectsTree.insertName(true);" />
+    <command id="robjects_cmd_removeobj"
+		label="&sciviews.robjects.rmObj;"
+		accesskey="R"
+		oncommand="rObjectsTree.removeSelected(event.shiftKey);" />
+    <command id="robjects_cmd_attach"
+		label="&sciviews.robjects.loadPkg;"
+		accesskey="L"
+		disabled="true"
+		oncommand="rObjectsTree.do('library');" />
+    <command id="robjects_cmd_summary"
+		 label="&sciviews.robjects.summary;"
+		 accesskey="S"
+		 oncommand="rObjectsTree.do('summary');" />
+    <command id="robjects_cmd_print"
+		 label="&sciviews.robjects.print;"
+		 accesskey="P"
+		 oncommand="rObjectsTree.do('print');" />
+    <command id="robjects_cmd_plot"
+		 label="&sciviews.robjects.plot;"
+		 accesskey="O"
+		 oncommand="rObjectsTree.do('plot');" />
+    <command id="robjects_cmd_str"
+		 label="&sciviews.robjects.str;"
+		 accesskey="T"
+		 oncommand="rObjectsTree.do('str');" />
+    <command id="robjects_cmd_names"
+		 label="&sciviews.robjects.names;"
+		 accesskey="N"
+		 oncommand="rObjectsTree.do('names');" />
+    <command id="robjects_cmd_help"
+		 label="&sciviews.robjects.help;"
+		 accesskey="H"
+		 oncommand="rObjectsTree.do('help');" />
+  </commandset>
+</commandset>
+
+<menupopup id="tabPicker_popup">
+  <menuitem id="show_robjects_tab"
+    insertafter="show_runoutput_tab,show_codebrowser_tab"
+    oncommand="uilayout_ensureTabShown('sciviews_robjects_tab', true)"
+    label="&sciviews.robjects.tab;"
+  />
+</menupopup>
+
+<menupopup id="menu_view_tabs_popup">
+  <menuitem id="show_robjects_tab2"
+    insertafter="show_codebrowser_tab2"
+    class="menuitem-iconic-wide"
+    oncommand="uilayout_ensureTabShown('sciviews_robjects_tab', true)"
+    label="&sciviews.robjects.tab;"
+  />
+</menupopup>
+
+  <tabbox id="leftTabBox">
+    <tabs id="project_toolbox_tabs">
+      <tab id="sciviews_robjects_tab"
+           label="&sciviews.robjects.tab;"
+           insertafter="project_tab,codebrowser_tab"
+           tooltiptext="&sciviews.robjects.tip;"
+           onclick="rObjectsTree.getPackageList(false)"
+           />
+    </tabs>
+    <tabpanels id="project_toolbox_tabpanels">
+      <tabpanel flex="1"
+                id="sciviews_robjects_tabpanel"
+                insertafter="projectviewbox,codebrowserviewbox">
+      <vbox flex="1" id="sciviews_robjects_vbox">
+        <hbox align="center"
+              id="sciviews_robjects_hbox"
+          >
+		  <toolbarbutton
+		    id="sciviews_robjects_refresh_button"
+		    tooltiptext="&sciviews.robjects.refresh.tip;"
+		    buttonstyle="pictures"
+		    label="&sciviews.robjects.refresh;"
+		    class="refresh-icon"
+		    oncommand="rObjectsTree.getPackageList(true);"
+		  />
+		  <toolbarbutton
+		    id="sciviews_robjects_searchpath_button"
+                observes="cmd_robjects_viewSearchPath"
+		    buttonstyle="pictures"
+		    class="searchPath-icon"
+		  />
+              <toolbarbutton
+		    id="sciviews_robjects_loadPkg_button"
+		    buttonstyle="pictures"
+		    class="robjects-loadPkg-icon"
+                oncommand="sv.r.pkg.load();"
+		  />
+
+          <toolbarseparator style="min-width:10px;" flex="1"/>
+          <toolbarbutton id="sciviews_robjects_filter"
+               tooltiptext="&sciviews.robjects.filter.tip;"
+		   buttonstyle="pictures"
+		   type="menu"
+		   orient="horizontal"
+		   class="rightarrow-button-a r-objects-filter">
+          <menupopup id="sciviews_robjects_filterPopup">
+            <menuitem id="sciviews_robjects_context_filterByName"
+                      label="&sciviews.robjects.filterByName;"
+                      checked="true"
+                      accesskey="n"
+                      type="checkbox"
+                      oncommand="rObjectsTree.setFilterBy(this, 'name')" />
+            <menuitem id="sciviews_robjects_context_filterByClass"
+                      label="&sciviews.robjects.filterByClass;"
+                      accesskey="c"
+                      type="checkbox"
+                      oncommand="rObjectsTree.setFilterBy(this, 'class')" />
+            <menuitem id="sciviews_robjects_context_filterByGroup"
+                      label="&sciviews.robjects.filterByGroup;"
+                      accesskey="g"
+                      type="checkbox"
+                      oncommand="rObjectsTree.setFilterBy(this, 'group')" />
+            <menuseparator />
+            <menuitem id="sciviews_robjects_context_clrFilter"
+                      label="&sciviews.robjects.clrFilter;"
+                      accesskey="l"
+                      oncommand="document.getElementById('sciviews_robjects_filterbox').value = ''; rObjectsTree.applyFilter();" />
+          </menupopup>
+</toolbarbutton>
+          <textbox
+            id="sciviews_robjects_filterbox"
+            flex="1"
+            type="timed"
+            timeout="500"
+            tooltiptext="&sciviews.robjects.filter.tip;"
+            oninput="rObjectsTree.applyFilter();"
+		emptytext="&sciviews.robjects.filterEmptyText;"
+          />
+		</hbox>
+        <vbox id="robjects_searchpath_panel"
+          persist="height collapsed"
+          >
+          <listbox flex="1" id="sciviews_robjects_searchpath_listbox"
+	    ondragdrop="nsDragAndDrop.drop(event,window.rObjectsTree.packageListObserver);"
+	    ondragover="nsDragAndDrop.dragOver(event,rObjectsTree.packageListObserver);"
+	    onkeypress="rObjectsTree.packageListKeyEvent(event);"
+	    />
+        </vbox>
+        <splitter
+          id="sciviews_robjects_splitter"
+          collapse="before"
+          resizeafter="closest"
+          resizebefore="closest"
+          persist="state"
+          observes="cmd_robjects_viewSearchPath"
+          >
+          <grippy />
+        </splitter>
+        <vbox flex="5">
+          <tree flex="1" id="sciviews_robjects_objects_tree"
+              persist="sortDirection sortResource"
+              sortDirection="ascending" sortResource="r-name"
+		  enableColumnDrag="true"
+		  onkeypress = "rObjectsTree.onEvent(event);"
+              >
+            <treecols>
+              <treecol
+                id="r-name"
+                label="&sciviews.robjects.Name;"
+                primary="true"
+                sortActive="true"
+                persist="width ordinal hidden"
+                onclick="rObjectsTree.sort(this);"
+                ordinal="1"
+                flex="4"/>
+              <splitter class="tree-splitter" ordinal="2" />
+              <treecol
+                id="r-dims"
+                label="&sciviews.robjects.Dims;"
+                persist="width ordinal hidden"
+                onclick="rObjectsTree.sort(this);" flex="1" ordinal="3" />
+              <splitter class="tree-splitter" ordinal="4" />
+              <treecol
+                id="r-group"
+                label="&sciviews.robjects.Group;" flex="2" hidden="true"
+                persist="width ordinal hidden"
+                onclick="rObjectsTree.sort(this);" ordinal="5"
+                />
+              <splitter class="tree-splitter" ordinal="6" />
+              <treecol
+                id="r-class"
+                label="&sciviews.robjects.Class;" flex="2" hidden="true"
+                persist="width ordinal hidden"
+                onclick="rObjectsTree.sort(this);" ordinal="7"
+                />
+               <splitter class="tree-splitter" ordinal="8" />
+                <treecol id="r-fullName"
+                label="&sciviews.robjects.FullName;"
+                persist="width ordinal hidden"
+                flex="1"
+                ordinal="9"/>
+            </treecols>
+            <treechildren id="sciviews_robjects_objects_tree_main"
+              ondraggesture="nsDragAndDrop.startDrag(event, rObjectsTree.listObserver);"
+              ondblclick="rObjectsTree.onEvent(event);"
+              context="rObjectsContext"
+              >
+            </treechildren>
+          </tree>
+        </vbox>
+        <vbox>
+      <hbox align="center">
+	  <toolbarbutton
+          id="sciviews_robjects_foldAll_button"
+          label="Fold All"
+          buttonstyle="pictures"
+	    class="robjects-fold-all-icon"
+          oncommand="rObjectsTree.foldAll(true);"
+        />
+        <toolbarbutton
+          id="sciviews_robjects_ExpandAll_button"
+          label="Expand All"
+          buttonstyle="pictures"
+	    class="robjects-expand-all-icon"
+          oncommand="rObjectsTree.foldAll(false);"
+        />
+        <!--<toolbarbutton
+          id="sciviews_robjects_tmpInitialize_button"
+          label="Init!"
+          oncommand="rObjectsTreeInit();"
+        />-->
+      </hbox>
+        </vbox>
+        </vbox>
+      </tabpanel>
+    </tabpanels>
+  </tabbox>
+</overlay>

Added: komodo/SciViews-K/content/js/commands.js
===================================================================
--- komodo/SciViews-K/content/js/commands.js	                        (rev 0)
+++ komodo/SciViews-K/content/js/commands.js	2009-02-03 14:01:07 UTC (rev 109)
@@ -0,0 +1,117 @@
+/*
+
+Controllers for R related commands.
+
+*/
+
+
+sv.cmdsRControl_supported = function() {
+	var currentView = ko.views.manager.currentView;
+	if (!currentView)
+		return false;
+
+	return(currentView.document.language == "R");
+}
+
+sv.cmdsRControlSelection_supported = function() {
+	var currentView = ko.views.manager.currentView;
+	if (!currentView)
+		return false;
+
+	var anythingSelected = (currentView.scimoz.selectionEnd - currentView.scimoz.selectionStart) != 0;
+	return(currentView.document.language == "R" && anythingSelected);
+}
+
+
+sv.cmdsSetControllers = function() {
+	//alert("cmdsSetControllers!");
+
+	// make commands active only when current document language is R
+	var cmdNames = ["RunAll", "SourceAll", "RunBlock", "RunFunction", "RunLine", "RunPara",
+	 "SourceBlock", "SourceFunction", "SourcePara"];
+
+	var viewManager = ko.views.viewManager;
+	for (i in cmdNames) {
+		viewManager.prototype["is_cmd_sv_R" + cmdNames[i] + "_supported"] = sv.cmdsRControl_supported;
+		viewManager.prototype["is_cmd_sv_R" + cmdNames[i] + "_enabled"] = sv.cmdsRControl_supported;
+	}
+
+	// make these commands active only when current document language is R
+	// ... and if some text is selected
+	cmdNames = [ "RunSelection", "SourceSelection"];
+	for (i in cmdNames) {
+		viewManager.prototype["is_cmd_sv_R" + cmdNames[i] + "_supported"] = sv.cmdsRControlSelection_supported;
+		viewManager.prototype["is_cmd_sv_R" + cmdNames[i] + "_enabled"] = sv.cmdsRControlSelection_supported;
+	}
+
+	viewManager.prototype.do_cmd_sv_RRunLine = function() 	{ sv.r.send("line"); };
+
+	viewManager.prototype.do_cmd_sv_RRunAll = function()		{ sv.r.send("all"); };
+	viewManager.prototype.do_cmd_sv_RSourceAll = function() 	{ sv.r.source("all"); };
+
+	viewManager.prototype.do_cmd_sv_RSourcePara = function() 	{ sv.r.source("para"); };
+	viewManager.prototype.do_cmd_sv_RRunPara = function()		{ sv.r.send("para"); };
+
+	viewManager.prototype.do_cmd_sv_RRunSelection = function()		{ sv.r.send("sel"); };
+	viewManager.prototype.do_cmd_sv_RSourceSelection = function()	{ sv.r.source("sel"); };
+
+	viewManager.prototype.do_cmd_sv_RRunBlock = function()		{ sv.r.send("block"); };
+	viewManager.prototype.do_cmd_sv_RSourceBlock = function()	{ sv.r.source("block"); };
+
+	viewManager.prototype.do_cmd_sv_RRunFunction = function()		{ sv.r.send("function"); };
+	viewManager.prototype.do_cmd_sv_RSourceFunction = function()	{ sv.r.source("function"); };
+
+
+
+	viewManager.prototype.do_cmd_svStartR = function()	{
+		// runIn = "command-output-window", "new-console", "no-console"
+		//env strings: "ENV1=fooJ\nENV2=bar"
+		//gPrefSvc.prefs.getStringPref("runEnv");
+
+		var env = ["koPort=[[%pref:sciviews.server.socket]]", "koId=[[%pref:sciviews.client.id]]", "koHost=localhost",
+			 "koActivate=FALSE", "Rinitdir=~", "koServe=[[%pref:sciviews.client.socket]]", "Rid=Rgui"];
+
+		var cwd = "%(path:hostUserDataDir)/XRE/extensions/sciviewsk at sciviews.org/templates";
+
+		cwd = ko.interpolate.interpolateStrings(cwd);
+
+		for (i in env) {
+			try {
+				env[i] = ko.interpolate.interpolateStrings(env[i]);
+			} catch (e) {
+				alert(e);
+				return;
+			}
+		}
+		ko.run.runCommand(window, "Rgui --sdi", cwd, env.join("\n"), false, false, false, "new-console", false, false, false)
+
+	};
+
+}
+
+addEventListener("load", sv.cmdsSetControllers, false);
+
+/*
+
+//Useful garbage. delete it later.
+
+// command controllers template:
+vm.prototype.is_cmd_Test_supported
+vm.prototype.do_cmd_Test = function() { alert("do_cmd_Test!"); }
+vm.prototype.is_cmd_Test_supported = function() {
+	alert("is_cmd_Test_supported?:" + ko.views.manager.currentView.document.language);
+	return(ko.views.manager.currentView.document.language == "R");
+}
+vm.prototype.is_cmd_Test_enabled = function() { alert("is_cmd_Test_enabled?"); return false; }
+
+//commands sohuld be put in a commandset, so they can be enabled only if lang = R
+document.getElementById("cmdset_view_or_language_changed")
+
+select,current_view_changed,language_changed
+var x = document.getElementById("cmdset_r_control")
+x.oncommandupdate = function oncommandupdate(event) { ko.commands.updateCommandset(this); sv.cmdout.append(ko.views.manager.currentView.document.language) }
+
+id="cmdset_r_control"
+current_view_language_changed
+
+*/

Added: komodo/SciViews-K/content/overlayMain.xul
===================================================================
--- komodo/SciViews-K/content/overlayMain.xul	                        (rev 0)
+++ komodo/SciViews-K/content/overlayMain.xul	2009-02-03 14:01:07 UTC (rev 109)
@@ -0,0 +1,137 @@
+<?xml version="1.0"?>
+<!-- ***** BEGIN LICENSE BLOCK *****
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is SciViews-K by Philippe Grosjean & Romain Francois.
+
+ Portions created by ActiveState Software Inc are Copyright (C) 2000-2008
+ ActiveState Software Inc. All Rights Reserved.
+
+ Contributor(s):
+   Philippe Grosjean
+   Romain Francois
+   Kamil Barton
+   ActiveState Software Inc
+
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
+
+ ***** END LICENSE BLOCK ***** -->
+<!DOCTYPE overlay PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" [
+  <!ENTITY % sciviewskDTD SYSTEM "chrome://sciviewsk/locale/sciviewsk.dtd">
+  %sciviewskDTD;
+]>
+
+<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="chrome://komodo/skin/global/global.p.css" type="text/css"?>
+<?xml-stylesheet href="chrome://komodo/skin/bindings/buttons.css" type="text/css"?>
+<?xml-stylesheet href="chrome://sciviewsk/skin/sciviewsk.css" type="text/css"?>
+
+
+<overlay id="sciviewskOverlay"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+	   >
+
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/sciviews.js"/>
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/prefs.js"/>
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/strings.js"/>
+  <!--No longer neeeded for robjects.js <script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/e4x2dom.js"/>-->
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/array.js"/>
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/io.js"/>
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/socket.js"/>
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/r.js"/>
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/robjects.js"/>
+
+  <script type="application/x-javascript" src="chrome://sciviewsk/content/js/commands.js"/>
+
+  <commandset id="allcommands">
+    <command id="Tasks:svAbout" oncommand="alert('SciViews-K (Komodo R Editor) version ' + sv.version + '\na Komodo extension to interact with R\n(see http://www.sciviews.org/SciViews-K)');"/>
+
+    <command id="cmd_svStartR" key="key_cmd_svStartR"
+		     oncommand="ko.commands.doCommand('cmd_svStartR');" desc="R: Start R Console (windows)" label="Start R Console (windows)" accel="R" />
+
+    <commandset id="cmdset_r_control" commandupdater="true"
+		    events="current_view_language_changed"
+		    oncommandupdate="ko.commands.updateCommandset(this);" >
+	<command id="cmd_sv_RRunAll"  key="key_cmd_sv_RRunAll"   oncommand="ko.commands.doCommand('cmd_sv_RRunAll')"
+			 desc="R: Send file content" label="Send file content" accel="S" />
+	<command id="cmd_sv_RSourceAll"  key="key_cmd_sv_RSourceAll"  oncommand="ko.commands.doCommand('cmd_sv_RSourceAll')"
+		   desc="R: Source file" label="Source file" accel="a" />
+	<command id="cmd_sv_RRunBlock"  key="key_cmd_sv_RRunBlock"  oncommand="ko.commands.doCommand('cmd_sv_RRunBlock')"
+		   desc="R: Send marked block" label="Send marked block" accel="b" />
+	<command id="cmd_sv_RRunFunction"  key="key_cmd_sv_RRunFunction"  oncommand="ko.commands.doCommand('cmd_sv_RRunFunction')"
+		   desc="R: Send function under cursor" label="Send function under cursor" accel="c" />
+	<command id="cmd_sv_RRunLine"  key="key_cmd_sv_RRunLine"  oncommand="ko.commands.doCommand('cmd_sv_RRunLine')"
+		   desc="R: Send active line" label="Send active line" accel="l" />
+	<command id="cmd_sv_RRunPara"  key="key_cmd_sv_RRunPara"  oncommand="ko.commands.doCommand('cmd_sv_RRunPara')"
+		   desc="R: Send current paragraph" label="Send current paragraph" accel="p" />
+
+	<command id="cmd_sv_RSourceBlock"  key="key_cmd_sv_RSourceBlock"  oncommand="ko.commands.doCommand('cmd_sv_RSourceBlock')"
+		   desc="R: Source marked block" label="Source marked block" accel="m" />
+	<command id="cmd_sv_RSourceFunction"  key="key_cmd_sv_RSourceFunction"  oncommand="ko.commands.doCommand('cmd_sv_RSourceFunction')"
+		   desc="R: Source function under cursor" label="Source function under cursor" accel="s" />
+
+	<command id="cmd_sv_RSourcePara"  key="key_cmd_sv_RSourcePara"  oncommand="ko.commands.doCommand('cmd_sv_RSourcePara')"
+		   desc="R: Source current paragraph" label="Source current paragraph" accel="r" />
+
+	<commandset id="cmdset_r_control" commandupdater="true"
+		    events="select"
+		    oncommandupdate="ko.commands.updateCommandset(this);" >
+	  <command id="cmd_sv_RRunSelection"  key="key_cmd_sv_RRunSelection"  oncommand="ko.commands.doCommand('cmd_sv_RRunSelection')"
+	     desc="R: Send selection" label="Send selection" accel="i" />
+	  <command id="cmd_sv_RSourceSelection"  key="key_cmd_sv_RSourceSelection"  oncommand="ko.commands.doCommand('cmd_sv_RSourceSelection')"
+		   desc="R: Source selection" label="Source selection" accel="u" />
+	</commandset>
+
+
+    </commandset>
+  </commandset>
+
+  <menupopup id="popup_tools">
+    <menuitem id="menu_sciviewsk"
+              label="SciViews-K"
+              observes="Tasks:svAbout"
+              class="menu-iconic-wide"/>
+  </menupopup>
+
+  <menubar id="menubar_main">
+   <menu id="sciviews_menu" label="R Control" accesskey="R" insertbefore="menu_window,help_menu">
+    <menupopup id="popup_sciviews_main">
+	<menuitem id="r_start_console_menu" observes="cmd_svStartR" class="menuitem-iconic run-command-icon" />
+	<menuseparator/>
+	<menuitem id="r_send_all_menu" observes="cmd_sv_RRunAll" />
+	<menuitem id="r_src_all_menu" observes="cmd_sv_RSourceAll" />
+	<menuitem id="r_send_block_menu" observes="cmd_sv_RRunBlock" />
+	<menuitem id="r_send_function_menu" observes="cmd_sv_RRunFunction" />
+	<menuitem id="r_send_line_menu" observes="cmd_sv_RRunLine" />
+	<menuitem id="r_send_para_menu" observes="cmd_sv_RRunPara" />
+	<menuitem id="r_send_sel_menu" observes="cmd_sv_RRunSelection" />
+	<menuitem id="r_src_block_menu" observes="cmd_sv_RSourceBlock" />
+	<menuitem id="r_src_function_menu" observes="cmd_sv_RSourceFunction" />
+	<menuitem id="r_src_para_menu" observes="cmd_sv_RSourcePara" />
+	<menuitem id="r_src_sel_menu" observes="cmd_sv_RSourceSelection" />
+    </menupopup>
+   </menu>
+  </menubar>
+</overlay>



More information about the Sciviews-commits mailing list