[openrtm-commit:03282] r832 - in trunk/rtmtools/jp.go.aist.rtm.nameserviceview: . src/jp/go/aist/rtm/nameserviceview/ui/action
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 3月 27日 (火) 12:40:10 JST
Author: ga
Date: 2018-03-27 12:40:10 +0900 (Tue, 27 Mar 2018)
New Revision: 832
Added:
trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/action/StartManagerAction.java
Modified:
trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.properties
trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.xml
Log:
Add manager start button. #4496
Modified: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.properties
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.properties 2018-03-26 14:49:46 UTC (rev 831)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.properties 2018-03-27 03:40:10 UTC (rev 832)
@@ -38,3 +38,4 @@
Kill_Zombies =&Kill Zombies
Kill_All_Zombies =Kill All Zombies
Start_NameService =&Start_NameService
+Start_Manager =&Start_Manager
Modified: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.xml
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.xml 2018-03-26 14:49:46 UTC (rev 831)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview/plugin.xml 2018-03-27 03:40:10 UTC (rev 832)
@@ -32,6 +32,15 @@
id="jp.go.aist.rtm.nameserviceview.ui.views.nameserviceview.NameServiceView.contribution"
targetID="jp.go.aist.rtm.nameserviceview.ui.views.nameserviceview.NameServiceView">
<action
+ class="jp.go.aist.rtm.nameserviceview.ui.action.StartManagerAction"
+ icon="icons/StartNS.png"
+ id="jp.go.aist.rtm.nameserviceview.ui.action.StartManager"
+ label="%Start_Manager"
+ menubarPath="additions"
+ toolbarPath="additions"
+ tooltip="%Start_Manager">
+ </action>
+ <action
class="jp.go.aist.rtm.nameserviceview.ui.action.StartNameServiceAction"
icon="icons/StartNS.png"
id="jp.go.aist.rtm.nameserviceview.ui.action.StartNameservice"
Added: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/action/StartManagerAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/action/StartManagerAction.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/action/StartManagerAction.java 2018-03-27 03:40:10 UTC (rev 832)
@@ -0,0 +1,45 @@
+package jp.go.aist.rtm.nameserviceview.ui.action;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+
+public class StartManagerAction implements IViewActionDelegate {
+ private boolean isWindows = false;
+
+ public void init(IViewPart view) {
+ }
+
+ public void run(IAction action) {
+ String targetOS = System.getProperty("os.name").toLowerCase();
+ if(targetOS.toLowerCase().startsWith("windows")) {
+ isWindows = true;
+ }
+
+ if(isWindows) {
+ String target = System.getenv("RTM_ROOT") + "bin" + Path.SEPARATOR + System.getenv("RTM_VC_VERSION") + Path.SEPARATOR + "rtcd.exe";
+ try {
+ ProcessBuilder pb = new ProcessBuilder(target);
+ Process process = pb.start();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ } else {
+ String target = "/usr/bin/rtcd";
+ try {
+ ProcessBuilder pb = new ProcessBuilder(target);
+ Process process = pb.start();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+}
Property changes on: trunk/rtmtools/jp.go.aist.rtm.nameserviceview/src/jp/go/aist/rtm/nameserviceview/ui/action/StartManagerAction.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
openrtm-commit メーリングリストの案内