[openrtm-commit:01728] r544 - in trunk/rtmtools/jp.go.aist.rtm.systemeditor: src/jp/go/aist/rtm/systemeditor src/jp/go/aist/rtm/systemeditor/restoration src/jp/go/aist/rtm/systemeditor/ui/action src/jp/go/aist/rtm/systemeditor/ui/editor src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy src/jp/go/aist/rtm/systemeditor/ui/preference src/jp/go/aist/rtm/systemeditor/ui/util test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock test/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/mock

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 2月 21日 (日) 02:37:17 JST


Author: ga
Date: 2016-02-21 02:37:17 +0900 (Sun, 21 Feb 2016)
New Revision: 544

Modified:
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/RTSystemEditorPlugin.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Main.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/AllComponentActionDelegate.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortAction.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewOfflineSystemDiagramEditorAction.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewSystemDiagramEditorAction.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/OpenCompositeComponentAction.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/GraphicalConnectorCreateManager.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/preference/IconPreferencePage.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentActionDelegate.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentUtil.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/DeployUtil.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ComponentMock.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ConfigurationSetMock.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/PortMock.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/mock/RTCManagerMock.java
Log:
Modified Logger #3211

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/RTSystemEditorPlugin.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/RTSystemEditorPlugin.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/RTSystemEditorPlugin.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -1,42 +1,36 @@
 package jp.go.aist.rtm.systemeditor;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.logging.LogManager;
-import java.util.logging.Logger;
+import jp.go.aist.rtm.toolscommon.profiles.util.LoggerUtil;
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The activator class controls the plug-in life cycle
  */
 public class RTSystemEditorPlugin extends AbstractUIPlugin {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(RTSystemEditorPlugin.class);
+
 	// The plug-in ID
 	private static final String PLUGIN_ID = "jp.go.aist.rtm.systemeditor";
 
 	// The shared instance
 	private static RTSystemEditorPlugin plugin;
 
-	RTSELogHandler logHandler = null;
-
 	/**
 	 * The constructor
 	 */
 	public RTSystemEditorPlugin() {
+		LoggerUtil.setup();
+		LOGGER.trace("RTSystemEditorPlugin: START");
+
 		plugin = this;
-		//
-		getLogger();
-		try {
-			logHandler = new RTSELogHandler();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
 	}
 
 	/*
@@ -44,10 +38,6 @@
 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
 	 */
 	public void start(BundleContext context) throws Exception {
-		if(logHandler!=null) {
-			logHandler.start();
-		}
-		//
 		super.start(context);
 	}
 
@@ -56,10 +46,6 @@
 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
 	 */
 	public void stop(BundleContext context) throws Exception {
-		if(logHandler!=null) {
-			logHandler.stop();
-		}
-		//
 		plugin = null;
 		super.stop(context);
 	}
@@ -110,37 +96,4 @@
 		return result;
 	}
 
-	static LogManager logManager = null;
-	static Logger log = null;
-
-	public static Logger getLogger() {
-		if (logManager == null) {
-			try {
-				InputStream ins = new FileInputStream(new File(
-						"systemeditor.logging.properties"));
-				logManager = LogManager.getLogManager();
-				logManager.readConfiguration(ins);
-			} catch (IOException e) {
-				// void
-			}
-		}
-		//
-		if (log == null) {
-			log = Logger.getLogger(PLUGIN_ID);
-		}
-		return log;
-	}
-
-	public static void addLogger(Logger logger) {
-		if (plugin != null) {
-			plugin.logHandler.addLogger(logger);
-		}
-	}
-
-	public static void removeLogger(Logger logger) {
-		if (plugin != null) {
-			plugin.logHandler.removeLogger(logger);
-		}
-	}
-
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Main.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Main.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Main.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -24,9 +24,14 @@
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class Main {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(Main.class);
+
 	/**
 	 * 指定されたXMLファイルを読み込み、XMLファイルの内容をシステムに反映する。
 	 * XMLファイルの場所は、ファイルパスもしくはURI(Webサーバ等可能)で指定する。
@@ -191,7 +196,7 @@
 			reader.close();
 
 		} catch (Exception e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to create mapping rules", e);
 			result.setSuccess(false);
 		}
 

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/restoration/Restoration.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -4,6 +4,9 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import jp.go.aist.rtm.systemeditor.nl.Messages;
 import jp.go.aist.rtm.toolscommon.factory.CorbaWrapperFactory;
 import jp.go.aist.rtm.toolscommon.model.component.Component;
@@ -17,6 +20,10 @@
  * ロード時に復元を行うクラス
  */
 public class Restoration {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(Restoration.class);
+
 	/**
 	 * 実行メイン
 	 * 
@@ -71,7 +78,7 @@
 						.getConfigurationSets(), component
 						.getActiveConfigurationSet(), remoteConfigurationSets);
 			} catch (Exception e) {
-				e.printStackTrace();
+				LOGGER.error("Fail to get configuration. (CORBA)", e);
 				// void
 			}
 			if (isOk == false) {

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/AllComponentActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/AllComponentActionDelegate.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/AllComponentActionDelegate.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -18,12 +18,17 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.IEditorActionDelegate;
 import org.eclipse.ui.IEditorPart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * AllStart,AllStopを実行するアクション
  */
 public class AllComponentActionDelegate implements IEditorActionDelegate {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(AllComponentActionDelegate.class);
+
 	/**
 	 * AllStartに使用されるID。この値が、Plugin.XMLに指定されなければならない。
 	 */
@@ -120,7 +125,7 @@
 				MessageDialog.openError(targetEditor.getSite().getShell(),
 						Messages.getString("AllComponentActionDelegate.13"), Messages.getString("AllComponentActionDelegate.14") + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
 			} catch (InterruptedException e) {
-				e.printStackTrace();
+				LOGGER.error("Fail in dialog (interrupted)", e);
 			}
 		}
 

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -57,10 +57,16 @@
 import org.openrtp.namespaces.rts.version02.TargetComponentExt;
 import org.openrtp.namespaces.rts.version02.TargetPort;
 import org.openrtp.namespaces.rts.version02.TargetPortExt;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
 
 public class DeployActionDelegate implements IEditorActionDelegate {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(DeployActionDelegate.class);
+
 	private ISelection selection;
 	private AbstractSystemDiagramEditor targetEditor;
 
@@ -219,13 +225,13 @@
 			newWindow = window.getActivePage().openEditor(new NullEditorInput(),
 					SystemDiagramEditor.SYSTEM_DIAGRAM_EDITOR_ID);
 		} catch (PartInitException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to open editor", e);
 		}
-		SystemDiagramEditor editor = (SystemDiagramEditor)newWindow;
+		SystemDiagramEditor editor = (SystemDiagramEditor) newWindow;
 		try {
 			loadFromOffline(editor, profile);
 		} catch (PartInitException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to load from offline", e);
 		}
 	}
 
@@ -429,7 +435,7 @@
 						handler.restoreExecutionContext(editor.getSystemDiagram());
 						editor.doReplace(editor.getSystemDiagram(), editor.getEditorSite());
 					} catch (Exception e) {
-						e.printStackTrace();
+						LOGGER.error("Fail to replace in editor", e);
 						throw new InvocationTargetException(e, Messages.getString("SystemDiagramEditor.8")); //$NON-NLS-1$
 					}
 					//

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -16,8 +16,14 @@
 import org.eclipse.ui.IEditorPart;
 import org.openrtp.namespaces.deploy.Component;
 import org.openrtp.namespaces.deploy.DeployProfile;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class DeployLoadActionDelegate implements IEditorActionDelegate {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(DeployLoadActionDelegate.class);
+
 	private ISelection selection;
 	private AbstractSystemDiagramEditor targetEditor;
 
@@ -39,8 +45,8 @@
 		DeployProfile profile = null;
 		try {
 			profile = loader.loadXmlDeploy(selectedFileName);
-		} catch(Exception ex) {
-			ex.printStackTrace();
+		} catch (Exception e) {
+			LOGGER.error("Fail to load xml and deploy", e);
 		}
 		//
 		SystemDiagram diagram = targetEditor.getSystemDiagram();

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -22,10 +22,16 @@
 import org.eclipse.ui.IEditorActionDelegate;
 import org.eclipse.ui.IEditorPart;
 import org.openrtp.namespaces.deploy.DeployProfile;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
 
 public class DeploySaveActionDelegate implements IEditorActionDelegate {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(DeploySaveActionDelegate.class);
+
 	private ISelection selection;
 	private AbstractSystemDiagramEditor targetEditor;
 
@@ -54,11 +60,11 @@
 		//
 		XmlHandler saver = new XmlHandler();
 		try {
-			saver.saveXmlDeploy(profile, URLDecoder.decode(selectedFileName,"UTF-8"));
+			saver.saveXmlDeploy(profile, URLDecoder.decode(selectedFileName, "UTF-8"));
 		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to decode url", e);
 		} catch (Exception e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to save", e);
 		}
 	}
 

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortAction.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/ExportPortAction.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -16,6 +16,8 @@
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.ui.PlatformUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * ポートの公開・非公開を切り替えるアクション
@@ -23,6 +25,9 @@
  */
 public class ExportPortAction extends Action {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(ExportPortAction.class);
+
 	private static final String ERROR_TITLE = Messages.getString("ExportPortAction.error.title"); // Error
 
 	private static final String ERROR_UPDATE_FAIL = Messages.getString("ExportPortAction.error.update_fail"); // Update failure.
@@ -65,7 +70,7 @@
 			parent.addComponentsR(emptyList);
 
 		} catch (Exception e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to add component", e);
 			return false;
 		}
 		return true;
@@ -96,7 +101,7 @@
 			parent.getSynchronizationSupport().synchronizeLocal();
 			CompositeComponentHelper.synchronizeAll(parent);
 		} catch (Exception e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to synchronize", e);
 			return false;
 		}
 		return true;

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewOfflineSystemDiagramEditorAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewOfflineSystemDiagramEditorAction.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewOfflineSystemDiagramEditorAction.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -8,6 +8,8 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 import org.eclipse.ui.PartInitException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * 新しいシステムダイアグラムを作成するアクション
@@ -15,6 +17,9 @@
 public class NewOfflineSystemDiagramEditorAction implements
 		IWorkbenchWindowActionDelegate {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(NewOfflineSystemDiagramEditorAction.class);
+
 	private IWorkbenchWindow window;
 
 	/**
@@ -38,7 +43,7 @@
 			window.getActivePage().openEditor(new NullEditorInput(),
 					OfflineSystemDiagramEditor.OFFLINE_SYSTEM_DIAGRAM_EDITOR_ID);
 		} catch (PartInitException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to open editor", e);
 		}
 	}
 

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewSystemDiagramEditorAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewSystemDiagramEditorAction.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/NewSystemDiagramEditorAction.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -8,6 +8,8 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 import org.eclipse.ui.PartInitException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * 新しいシステムダイアグラムを作成するアクション
@@ -15,6 +17,9 @@
 public class NewSystemDiagramEditorAction implements
 		IWorkbenchWindowActionDelegate {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(NewSystemDiagramEditorAction.class);
+
 	private IWorkbenchWindow window;
 
 	/**
@@ -38,7 +43,7 @@
 			window.getActivePage().openEditor(new NullEditorInput(),
 					SystemDiagramEditor.SYSTEM_DIAGRAM_EDITOR_ID);
 		} catch (PartInitException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to open editor", e);
 		}
 	}
 

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/OpenCompositeComponentAction.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/OpenCompositeComponentAction.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/OpenCompositeComponentAction.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -12,12 +12,17 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * 複合コンポーネントを開くアクション
  */
 public class OpenCompositeComponentAction extends Action {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(OpenCompositeComponentAction.class);
+
 	private IWorkbenchPart parentSystemDiagramEditor;
 
 	private Component compositeComponent;
@@ -50,7 +55,7 @@
 			compositeComponent.setChildSystemDiagram(childDiagram);
 			compositeComponentEditor.changeFile(null);
 		} catch (PartInitException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to activate composite component.", e);
 		}
 	}
 

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -97,11 +97,16 @@
 import org.eclipse.ui.part.FileEditorInput;
 import org.eclipse.ui.views.properties.IPropertySheetPage;
 import org.openrtp.namespaces.rts.version02.RtsProfileExt;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
 
 public abstract class AbstractSystemDiagramEditor extends GraphicalEditor {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(AbstractSystemDiagramEditor.class);
+
 	static final String DIALOG_TITLE_CONFIRM = Messages
 			.getString("Common.dialog.confirm_title");
 	static final String DIALOG_TITLE_ERROR = Messages
@@ -374,7 +379,7 @@
 		try {
 			save(file, monitor);
 		} catch (CoreException e) {
-			e.printStackTrace();
+			LOGGER.error("Fail to save. file=" + file, e);
 			ErrorDialog.openError(getSite().getShell(), Messages.getString("AbstractSystemDiagramEditor.12"), //$NON-NLS-1$
 					Messages.getString("AbstractSystemDiagramEditor.13"), e.getStatus()); //$NON-NLS-1$
 		}
@@ -434,7 +439,7 @@
 						try {
 							save(newFile, monitor);
 						} catch (CoreException e) {
-							e.printStackTrace();
+							LOGGER.error("Fail to save. file=" + newFile, e);
 							MessageDialog.openError(getSite().getShell(), Messages.getString("AbstractSystemDiagramEditor.21"), //$NON-NLS-1$
 									Messages.getString("AbstractSystemDiagramEditor.22") + newFile.getName()); //$NON-NLS-1$
 						}
@@ -889,7 +894,7 @@
 				load(new FileEditorInput(createNewFile), getEditorSite(),
 						restore);
 			} catch (PartInitException e) {
-				e.printStackTrace(); // system error
+				LOGGER.error("Fail to load file. file=" + createNewFile, e);
 				if (e.getStatus().getException() != null)
 					MessageDialog.openError(getSite().getShell(), "", e //$NON-NLS-1$
 							.getStatus().getException().getMessage());
@@ -925,32 +930,28 @@
 				if (evt.getOldValue() instanceof Component
 						&& ((Component) evt.getOldValue())
 								.isCompositeComponent()) {
-					try {
-						page.getWorkbenchWindow().getShell().getDisplay()
-								.asyncExec(new Runnable() {
-									@Override
-									public void run() {
-										List<Component> components = new ArrayList<Component>();
-										components
-												.add((Component) changeEvent
-														.getOldValue());
-										components
-												.addAll(((Component) changeEvent
-														.getOldValue())
-														.getAllComponents());
-										for (Component tmpComponent : components) {
-											SystemDiagram childDiagram = tmpComponent.getChildSystemDiagram();
-											if (childDiagram != null) {
-												AbstractSystemDiagramEditor editor = ComponentUtil.findEditor(childDiagram);
-												if (editor != null)	page.closeEditor(editor, false);
-												tmpComponent.setChildSystemDiagram(null);
-											}
+					page.getWorkbenchWindow().getShell().getDisplay()
+							.asyncExec(new Runnable() {
+								@Override
+								public void run() {
+									List<Component> components = new ArrayList<Component>();
+									components
+											.add((Component) changeEvent
+													.getOldValue());
+									components
+											.addAll(((Component) changeEvent
+													.getOldValue())
+													.getAllComponents());
+									for (Component tmpComponent : components) {
+										SystemDiagram childDiagram = tmpComponent.getChildSystemDiagram();
+										if (childDiagram != null) {
+											AbstractSystemDiagramEditor editor = ComponentUtil.findEditor(childDiagram);
+											if (editor != null)	page.closeEditor(editor, false);
+											tmpComponent.setChildSystemDiagram(null);
 										}
 									}
-								});
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
+								}
+							});
 				}
 			}
 		}

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -35,11 +35,17 @@
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.FileEditorInput;
 import org.openrtp.namespaces.rts.version02.RtsProfileExt;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * SystemDiagramEditorクラス
  */
 public class SystemDiagramEditor extends AbstractSystemDiagramEditor {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(SystemDiagramEditor.class);
+
 	/**
 	 * システムダイアグラムエディタのID
 	 */
@@ -213,7 +219,7 @@
 							handler.restoreExecutionContext(getSystemDiagram());
 							doReplace(getSystemDiagram(), site);
 						} catch (Exception e) {
-							e.printStackTrace();
+							LOGGER.error("Fail to replace diagram", e);
 							throw new InvocationTargetException(e, Messages.getString("SystemDiagramEditor.8")); //$NON-NLS-1$
 						}
 					}

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/GraphicalConnectorCreateManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/GraphicalConnectorCreateManager.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/editpolicy/GraphicalConnectorCreateManager.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -21,12 +21,17 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Shell;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * コネクタプロファイルを作成する責務を持ったマネージャ
  */
 public class GraphicalConnectorCreateManager {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(GraphicalConnectorCreateManager.class);
+
 	static final String ERROR_TITLE = Messages
 			.getString("GraphicalConnectorCreateManager.0");
 
@@ -129,7 +134,7 @@
 					continue;
 				}
 			} catch (Exception e) {
-				e.printStackTrace();
+				LOGGER.error("Fail to get connection profile", e);
 				return null;
 			}
 		}

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/preference/IconPreferencePage.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/preference/IconPreferencePage.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/preference/IconPreferencePage.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -35,10 +35,15 @@
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class IconPreferencePage extends PreferencePage implements
 		IWorkbenchPreferencePage {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(IconPreferencePage.class);
+
 	static final int EXEC_BUTTON_WIDTH = 90;
 
 	static final String ERROR_IMPORT_PROFILE = getString("IconPreferencePage.error.import");
@@ -198,7 +203,7 @@
 					iconTableViewer.setInput(entryList);
 				} catch (Exception e1) {
 					setErrorMessage(ERROR_IMPORT_PROFILE);
-					e1.printStackTrace();
+					LOGGER.error("Fail to load profile for icon store", e1);
 				}
 			}
 		});
@@ -226,7 +231,7 @@
 					store.saveProfile(file.getAbsolutePath());
 				} catch (Exception e1) {
 					setErrorMessage(ERROR_EXPORT_PROFILE);
-					e1.printStackTrace();
+					LOGGER.error("Fail to save profile", e1);
 				}
 			}
 		});

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentActionDelegate.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentActionDelegate.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -12,12 +12,17 @@
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.ui.IWorkbenchPart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * コマンドの実行を代理するクラス
  */
 public class ComponentActionDelegate {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(ComponentActionDelegate.class);
+
 	static final String MSG_BEGIN_TASK = Messages.getString("ComponentActionDelegate.1");
 	static final String MSG_SUB_TASK1 = Messages.getString("ComponentActionDelegate.2");
 	static final String MSG_SUB_TASK2 = Messages.getString("ComponentActionDelegate.3");
@@ -88,7 +93,7 @@
 		try {
 			dialog.run(false, false, runable);
 		} catch (Exception e) {
-			e.printStackTrace();
+			LOGGER.error("Fail in dialog", e);
 		}
 
 		if (returnCode[0] == null) {

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentUtil.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentUtil.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/ComponentUtil.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -13,12 +13,17 @@
 import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PlatformUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * コンポーネント処理に関するユーティリティ
  */
 public class ComponentUtil {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(ComponentUtil.class);
+
 	/**
 	 * ダイアグラムを表示しているエディタを探し出して返す。
 	 * 見つからなければ、nullを返す。
@@ -61,8 +66,8 @@
 										false);
 
 					} catch (Exception e) {
-						e.printStackTrace();
-						// void
+						LOGGER.error("Fail to close editor. editor=" + editor,
+								e);
 					}
 				}
 			});

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/DeployUtil.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/DeployUtil.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/DeployUtil.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -12,11 +12,16 @@
 import jp.go.aist.rtm.toolscommon.util.AdapterUtil;
 
 import org.eclipse.emf.common.util.EList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import RTC.RTObjectHelper;
 
 public class DeployUtil {
 
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(DeployUtil.class);
+
 	static public List<CorbaComponent> searchComponentList(EList target, List<CorbaComponent> result) {
 
 		for(int index=0;index<target.size();index++) {
@@ -30,8 +35,8 @@
 						component.setIor(obj.getCorbaObject().toString());
 						result.add(component);
 					}
-				} catch(Exception ex) {
-					ex.printStackTrace();
+				} catch (Exception e) {
+					LOGGER.error("Fail to search component", e);
 				}
 			} else {
 				EList nscomps = ((NamingContextNode)target.get(index)).getNodes();
@@ -58,8 +63,8 @@
 							return component;
 						}
 					}
-				} catch(Exception ex) {
-					ex.printStackTrace();
+				} catch (Exception e) {
+					LOGGER.error("Fail to search component", e);
 				}
 			} else {
 				EList nscomps = ((NamingContextNode)target.get(index)).getNodes();

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ComponentMock.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ComponentMock.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ComponentMock.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -1,5 +1,6 @@
 package jp.go.aist.rtm.systemeditor.ui.views.configurationview.mock;
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.List;
 
 import jp.go.aist.rtm.toolscommon.model.component.Component;
@@ -24,6 +25,7 @@
 import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
 import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
@@ -639,4 +641,10 @@
 		// TODO Auto-generated method stub
 	}
 
+	@Override
+	public Object eInvoke(EOperation operation, EList<?> arguments) throws InvocationTargetException {
+		// TODO 自動生成されたメソッド・スタブ
+		return null;
+	}
+
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ConfigurationSetMock.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ConfigurationSetMock.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/ConfigurationSetMock.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -6,12 +6,15 @@
 import jp.go.aist.rtm.toolscommon.model.core.Visiter;
 import jp.go.aist.rtm.toolscommon.synchronizationframework.SynchronizationSupport;
 
+import java.lang.reflect.InvocationTargetException;
+
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.util.BasicEList;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
 import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
@@ -128,4 +131,10 @@
 	public void setSynchronizationSupport(
 			SynchronizationSupport synchronizationSupport) {
 	}
+
+	@Override
+	public Object eInvoke(EOperation operation, EList<?> arguments) throws InvocationTargetException {
+		// TODO 自動生成されたメソッド・スタブ
+		return null;
+	}
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/PortMock.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/PortMock.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/configurationview/mock/PortMock.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -1,5 +1,6 @@
 package jp.go.aist.rtm.systemeditor.ui.views.configurationview.mock;
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.List;
 
 import jp.go.aist.rtm.toolscommon.model.component.Port;
@@ -14,6 +15,7 @@
 import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
 import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
@@ -275,4 +277,10 @@
 		return null;
 	}
 
+	@Override
+	public Object eInvoke(EOperation operation, EList<?> arguments) throws InvocationTargetException {
+		// TODO 自動生成されたメソッド・スタブ
+		return null;
+	}
+
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/mock/RTCManagerMock.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/mock/RTCManagerMock.java	2016-02-20 17:37:01 UTC (rev 543)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/test/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/mock/RTCManagerMock.java	2016-02-20 17:37:17 UTC (rev 544)
@@ -6,6 +6,8 @@
 import jp.go.aist.rtm.toolscommon.model.manager.RTCManager;
 import jp.go.aist.rtm.toolscommon.synchronizationframework.SynchronizationSupport;
 
+import java.lang.reflect.InvocationTargetException;
+
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.emf.common.notify.Adapter;
 import org.eclipse.emf.common.notify.Notification;
@@ -14,6 +16,7 @@
 import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
 import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
@@ -427,4 +430,10 @@
 	public EList<ModuleProfile> getLoadedModuleProfiles() {
 		return null;
 	}
+
+	@Override
+	public java.lang.Object eInvoke(EOperation operation, EList<?> arguments) throws InvocationTargetException {
+		// TODO 自動生成されたメソッド・スタブ
+		return null;
+	}
 }



More information about the openrtm-commit mailing list