Commits

Lynn Rees committed 0b44c4a

- fix convert child to x

Comments (0)

Files changed (6)

scripts/cvrtChild2Detail.groovy

-c.selecteds.each {
-	it.parent.details = it.text
-	it.delete()
-}
+// @CacheScriptContent(true)
+// @ExecutionModes({ON_SINGLE_NODE})
+
+import org.hardknots.wikd.wikdnode.WikdGroove
+
+WikdGroove.cvrtChild(c, 'setDetails')

scripts/cvrtChild2Note.groovy

-c.selecteds.each {
-	it.parent.note = it.text
-	it.delete()
-}
+// @CacheScriptContent(true)
+// @ExecutionModes({ON_SINGLE_NODE})
+
+import org.hardknots.wikd.wikdnode.WikdGroove
+
+WikdGroove.cvrtChild(c, 'setNote')

scripts/cvrtChild2Parent.groovy

 // @CacheScriptContent(true)
 // @ExecutionModes({ON_SINGLE_NODE})
-def parent
-def wipe = []
 
-c.selecteds.toList().each {
-  parent = it.parent
-  parent.text = it.text
-  wipe.add(it)
-}
+import org.hardknots.wikd.wikdnode.WikdGroove
 
-wipe.toList().each { it.delete() }
-
-c.select(parent)
+WikdGroove.cvrtChild(c, 'setText')

scripts/org/hardknots/wikd/wikdnode/WikdGroove.groovy

+package org.hardknots.wikd.wikdnode
+
+import org.freeplane.plugin.script.proxy.Proxy
+
+class WikdGroove {
+
+	public static cvrtChild(Proxy.Controller c, String prop) {
+		def parent
+		def wipe = []
+		def selected = []
+		c.selecteds.each {
+			parent = it.parent
+			parent.invokeMethod(prop, it.text)
+			wipe << it
+			selected << parent
+		}
+		wipe.toList().each { it.delete() }
+		c.selectMultipleNodes(selected)
+	}
+
+}
 <map version="freeplane 1.2.0">
 <!--To view this file, download free mind mapping software Freeplane from http://freeplane.sourceforge.net -->
-<node TEXT="wikdNode" FOLDED="false" ID="ID_1723255651" CREATED="1283093380553" MODIFIED="1364327472039" BACKGROUND_COLOR="#97c7dc" LINK="https://bitbucket.org/lcrees/wikdnode/">
+<node TEXT="wikdNode" FOLDED="false" ID="ID_1723255651" CREATED="1283093380553" MODIFIED="1365542765591" BACKGROUND_COLOR="#97c7dc" LINK="https://bitbucket.org/lcrees/wikdnode/">
 <font SIZE="16" BOLD="true" ITALIC="true"/>
 <hook NAME="MapStyle">
     <properties show_icon_for_attributes="true" show_note_icons="true"/>
 <hook NAME="AutomaticEdgeColor" COUNTER="7"/>
 <attribute_layout NAME_WIDTH="103" VALUE_WIDTH="103"/>
 <attribute NAME="name" VALUE="wikdNode"/>
-<attribute NAME="version" VALUE="v0.7.7" OBJECT="org.freeplane.features.format.FormattedObject|v0.7.7|number:decimal:#0.####"/>
+<attribute NAME="version" VALUE="v0.7.8" OBJECT="org.freeplane.features.format.FormattedObject|v0.7.8|number:decimal:#0.####"/>
 <attribute NAME="author" VALUE="L. C. Rees"/>
 <attribute NAME="freeplaneVersionFrom" VALUE="1.2.15"/>
 <attribute NAME="freeplaneVersionTo" VALUE=""/>
     </ul>
   </body>
 </html>
-
 </richcontent>
 <hook NAME="FlexibleLayout" VALUE="CHILDREN"/>
 <node TEXT="description" FOLDED="true" POSITION="left" ID="ID_143630176" CREATED="1357715826843" MODIFIED="1364327418267">
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node ID="ID_419235551" CREATED="1357715987721" MODIFIED="1362699867699"><richcontent TYPE="NODE">
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="0.3.0" ID="ID_1041388750" CREATED="1358051551048" MODIFIED="1358051563586">
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="This add-on is free software: you can redistribute it and/or modify&#xa;it under the terms of the GNU General Public License as published by&#xa;the Free Software Foundation, either version 2 of the License, or&#xa;(at your option) any later version.&#xa;&#xa;This program is distributed in the hope that it will be useful,&#xa;but WITHOUT ANY WARRANTY; without even the implied warranty of&#xa;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&#xa;GNU General Public License for more details." ID="ID_241792435" CREATED="1357715826895" MODIFIED="1357719017976">
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#xa;&lt;preferences_structure&gt;&#xa;&lt;tabbed_pane&gt;&#xa;&lt;tab name=&quot;plugins&quot;&gt;&#xa;&lt;separator name=&quot;wikd&quot;&gt;&#xa;&lt;boolean name=&quot;wikd_first_split&quot; /&gt;&#xa;&lt;/separator&gt;&#xa;&lt;/tab&gt;&#xa;&lt;/tabbed_pane&gt;&#xa;&lt;/preferences_structure&gt;" ID="ID_873595672" CREATED="1358304692163" MODIFIED="1358308194898">
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="72" VALUE_WIDTH="72"/>
 <attribute NAME="wikd_first_split" VALUE="false"/>
     </ul>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="en" ID="ID_1245393964" CREATED="1357715826986" MODIFIED="1362734033478">
 <attribute NAME="OptionPanel.wikd_first_split" VALUE="Halten erste Spaltung als Elternknoten"/>
 </node>
 </node>
-<node TEXT="deinstall" POSITION="left" ID="ID_1844997656" CREATED="1357715826998" MODIFIED="1364327454901">
+<node TEXT="uninstall" POSITION="left" ID="ID_1844997656" CREATED="1357715826998" MODIFIED="1365542852956">
 <edge COLOR="#7c0000"/>
 <richcontent TYPE="NOTE">
 
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="30" VALUE_WIDTH="269"/>
 <attribute NAME="delete" VALUE="${installationbase}/addons/${name}.script.xml"/>
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="caseCapitalize.groovy" ID="ID_1501046977" CREATED="1357794199593" MODIFIED="1362733463031">
     </p>
   </body>
 </html>
-
 </richcontent>
 </node>
 <node TEXT="images" POSITION="right" ID="ID_112966804" CREATED="1357715827065" MODIFIED="1364327418302">
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="${name}.png" ID="ID_473909841" CREATED="1357854883609" MODIFIED="1357866785018">
     </p>
   </body>
 </html>
-
 </richcontent>
 <attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
 <node TEXT="wikdnode.jar" ID="ID_1338104924" CREATED="1357890163166" MODIFIED="1364327438526">
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <jardesc>
-    <jar path="wikdNode/zips/scripts/wikd.jar"/>
-    <options buildIfNeeded="true" compress="true" descriptionLocation="/wikdNode/wikd.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
+    <jar path="wikdNode/jars/wikdnode.jar"/>
+    <options buildIfNeeded="true" compress="true" descriptionLocation="/wikdNode/wikdnode.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
     <storedRefactorings deprecationInfo="true" structuralOnly="false"/>
     <selectedProjects/>
     <manifest generateManifest="true" manifestLocation="" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.