[rkward-cvs] SF.net SVN: rkward:[4001] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Oct 26 17:30:39 UTC 2011


Revision: 4001
          http://rkward.svn.sourceforge.net/rkward/?rev=4001&view=rev
Author:   tfry
Date:     2011-10-26 17:30:39 +0000 (Wed, 26 Oct 2011)
Log Message:
-----------
Add property current_dataframe, which is like current_object (in fact, so far it is always identical), but is guaranteed to be a data.frame

Modified Paths:
--------------
    trunk/rkward/doc/rkwardplugins/index.docbook
    trunk/rkward/rkward/plugin/rkstandardcomponent.cpp
    trunk/rkward/rkward/plugins/data/sort.xml
    trunk/rkward/rkward/plugins/data/sort2.xml

Modified: trunk/rkward/doc/rkwardplugins/index.docbook
===================================================================
--- trunk/rkward/doc/rkwardplugins/index.docbook	2011-10-26 15:59:22 UTC (rev 4000)
+++ trunk/rkward/doc/rkwardplugins/index.docbook	2011-10-26 17:30:39 UTC (rev 4001)
@@ -1408,7 +1408,7 @@
 		For many plugins it is desirable to work on the <quote>current</quote> object. For instance a <quote>sort</quote> plugin could pre-select the data.frame that is currently being edited for sorting. The name of the current object is available to plugins as a pre-defined property called <parameter>current_object</parameter>. You can connect to this property in the usual way. If no object is current, the property equates to an empty string.
 	</para>
 	<para>
-		Currently the <parameter>current_object</parameter> can only be of class <function>data.frame</function>, but please do not rely on this, since this will be extended to other types of data in the future. Therefore please check any requirements by using appropriate constraints on your <command><varslot></command>s, or by using <link linkend="logic_scripted">GUI logic scripting</link>.
+		Currently the <parameter>current_object</parameter> can only be of class <function>data.frame</function>, but please do not rely on this, since this will be extended to other types of data in the future. If you are interested in <function>data.frame</function> objects, only, connect to the <parameter>current_dataframe</parameter> property, instead. Alternatively, you can enforce type requirements by using appropriate constraints on your <command><varslot></command>s, or by using <link linkend="logic_scripted">GUI logic scripting</link>.
 	</para>
 </sect1>
 

Modified: trunk/rkward/rkward/plugin/rkstandardcomponent.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkstandardcomponent.cpp	2011-10-26 15:59:22 UTC (rev 4000)
+++ trunk/rkward/rkward/plugin/rkstandardcomponent.cpp	2011-10-26 17:30:39 UTC (rev 4001)
@@ -2,7 +2,7 @@
                           rkstandardcomponent  -  description
                              -------------------
     begin                : Sun Feb 19 2006
-    copyright            : (C) 2006, 2007, 2009, 2010 by Thomas Friedrichsmeier
+    copyright            : (C) 2006, 2007, 2009, 2010, 2011 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -75,11 +75,15 @@
 	addChild ("code", code = new RKComponentPropertyCode (this, true));		// do not change this name!
 	code->setInternal (true);
 
-	RKComponentPropertyBase *current_object_property = new RKComponentPropertyBase (this, false);
+	RKComponentPropertyRObjects *current_object_property = new RKComponentPropertyRObjects (this, false);
+	RKComponentPropertyRObjects *current_dataframe_property = new RKComponentPropertyRObjects (this, false);
 	current_object_property->setInternal (true);
+	current_dataframe_property->setInternal (true);
 	RKMDIWindow *w = RKWorkplace::mainWorkplace ()->activeWindow (RKMDIWindow::AnyWindowState);
 	if (w) current_object_property->setValue (w->globalContextProperty ("current_object"));
+	if (current_object_property->objectValue () && current_object_property->objectValue ()->isDataFrame ()) current_dataframe_property->setObjectValue (current_object_property->objectValue ());
 	addChild ("current_object", current_object_property);
+	addChild ("current_dataframe", current_dataframe_property);
 
 	// open the main description file for parsing
 	XMLHelper* xml = XMLHelper::getStaticHelper ();

Modified: trunk/rkward/rkward/plugins/data/sort.xml
===================================================================
--- trunk/rkward/rkward/plugins/data/sort.xml	2011-10-26 15:59:22 UTC (rev 4000)
+++ trunk/rkward/rkward/plugins/data/sort.xml	2011-10-26 17:30:39 UTC (rev 4001)
@@ -3,7 +3,7 @@
 	<code file="sort.js"/>
 	<logic>
 		<set id="vectormode" to="0"/>
-		<connect governor="current_object" client="object.available"/>
+		<connect governor="current_dataframe" client="object.available"/>
 		<connect governor="object.available" client="sortby_selector.root"/>
 		<convert id="isok" mode="equals" sources="notice.text" standard="" require_true="true"/>
 

Modified: trunk/rkward/rkward/plugins/data/sort2.xml
===================================================================
--- trunk/rkward/rkward/plugins/data/sort2.xml	2011-10-26 15:59:22 UTC (rev 4000)
+++ trunk/rkward/rkward/plugins/data/sort2.xml	2011-10-26 17:30:39 UTC (rev 4001)
@@ -2,10 +2,10 @@
 <document>
 	<code file="sort.js"/>
 	<logic>
-		<connect governor="current_object" client="object.available"/>
+		<connect governor="current_dataframe" client="object.available"/>
 		<connect governor="object.available" client="sortby_selector.root"/>
 		<convert id="isok" mode="equals" sources="notice.text" standard="" require_true="true"/>
-		<convert id="no_current_object" mode="equals" sources="current_object" standard=""/>
+		<convert id="no_current_object" mode="equals" sources="current_dataframe" standard=""/>
 		<connect governor="no_current_object" client="object_select.visible"/>
 
 		<convert id="saveto_other_object" mode="equals" sources="saveto_select.string" standard="other"/>

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list