[openrtm-commit:00584] r241 - in trunk/rtmtools/jp.go.aist.rtm.systemeditor: . src/jp/go/aist/rtm/systemeditor/nl src/jp/go/aist/rtm/systemeditor/ui/action src/jp/go/aist/rtm/systemeditor/ui/dialog src/jp/go/aist/rtm/systemeditor/ui/editor src/jp/go/aist/rtm/systemeditor/ui/util

openrtm @ openrtm.org openrtm @ openrtm.org
2012年 1月 14日 (土) 00:33:27 JST


Author: sakamoto
Date: 2012-01-14 00:33:27 +0900 (Sat, 14 Jan 2012)
New Revision: 241

Added:
   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/DeploySettingActionDelegate.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/DeployUtil.java
Modified:
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.properties
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DataConnectorCreaterDialog.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ProfileInformationDialog.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ServiceConnectorCreaterDialog.java
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java
Log:
The addition of Deploy function from OFFLINE Profile

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.properties
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.properties	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.properties	2012-01-13 15:33:27 UTC (rev 241)
@@ -68,6 +68,10 @@
 Decompose_Composite_Component =Decompose Composite Component
 Open_With_System_Diagram_Editor =Open With System Diagram Editor
 StartLogging.label =Start Logging
+Set_Deploy_Info =Set Deploy Info.
+Deploy_System =Deploy System
+Deploy_Save =Save Deploy Info.
+Deploy_Load =Load Deploy Info.
 
 All_Disconnect =All Disconnect
 

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/plugin.xml	2012-01-13 15:33:27 UTC (rev 241)
@@ -205,6 +205,28 @@
 				class="jp.go.aist.rtm.systemeditor.ui.action.CombineActionDelegate">
 			</action>
 		</viewerContribution>
+  <viewerContribution
+        id="jp.go.aist.rtm.systemeditor.ui.editor.OfflineSystemDiagramEditor.deploy"
+        targetID="jp.go.aist.rtm.systemeditor.ui.editor.OfflineSystemDiagramEditor">
+     <action
+           class="jp.go.aist.rtm.systemeditor.ui.action.DeployLoadActionDelegate"
+           id="jp.go.aist.rtm.systemeditor.ui.action.DeployLoadActionDelegate"
+           label="%Deploy_Load"
+           menubarPath="deploy">
+     </action>
+     <action
+           class="jp.go.aist.rtm.systemeditor.ui.action.DeploySaveActionDelegate"
+           id="jp.go.aist.rtm.systemeditor.ui.action.DeploySaveActionDelegate"
+           label="%Deploy_Save"
+           menubarPath="deploy">
+     </action>
+     <action
+           class="jp.go.aist.rtm.systemeditor.ui.action.DeployActionDelegate"
+           id="jp.go.aist.rtm.systemeditor.ui.action.DeployActionDelegate"
+           label="%Deploy_System"
+           menubarPath="deploy">
+     </action>
+  </viewerContribution>
 		<viewerContribution
 			id="jp.go.aist.rtm.systemeditor.ui.editor.OfflineSystemDiagramEditor.combine" 
 			targetID="jp.go.aist.rtm.systemeditor.ui.editor.OfflineSystemDiagramEditor">
@@ -216,6 +238,12 @@
 				menubarPath="composite"
 				class="jp.go.aist.rtm.systemeditor.ui.action.CombineActionDelegate">
 			</action>
+		   <action
+		         class="jp.go.aist.rtm.systemeditor.ui.action.DeploySettingActionDelegate"
+		         id="jp.go.aist.rtm.systemeditor.ui.action.DeploySettingActionDelegate"
+		         label="%Set_Deploy_Info"
+		         menubarPath="deploy">
+		   </action>
 		</viewerContribution>
 		<!--
 		<viewerContribution
@@ -229,6 +257,7 @@
 			</action>
 		</viewerContribution>
 		-->
+	  
  		<objectContribution
 			id="jp.go.aist.rtm.systemeditor.ui.objectContribution.Component"
         	objectClass="jp.go.aist.rtm.toolscommon.model.component.Component"

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties	2012-01-13 15:33:27 UTC (rev 241)
@@ -33,7 +33,8 @@
 AllComponentActionDelegate.12=Sent the request to the component.
 AllComponentActionDelegate.13=Error
 AllComponentActionDelegate.14=An error has occurred while sending the request:\r\n
-DataConnectorCreaterDialog.1=Please enter ConnectorProfile.
+ConnectorCreaterDialogBase.0=\u30d7\u30ed\u30d1\u30c6\u30a3\u540d\u304c\u91cd\u8907\u3057\u3066\u3044\u307e\u3059\u3002
+DataConnectorCreaterDialog.1=Property Name is duplicated.
 DataConnectorCreaterDialog.2=Name : 
 DataConnectorCreaterDialog.3=Data Type : 
 DataConnectorCreaterDialog.4=*Any input
@@ -73,6 +74,7 @@
 ProfileInformationDialog.16=Required :
 ProfileInformationDialog.17=&Select All
 ProfileInformationDialog.18=&Deselect All
+DeploymentInformationDialog.0=Deployment Information
 NewCompositeComponentDialog.2=Manager : 
 NewCompositeComponentDialog.3=Name : 
 NewCompositeComponentDialog.4=Type : 
@@ -324,3 +326,4 @@
 SelectAttachComponentDialog.1=Please select component attached to Context.
 StartLoggingActionDelegate.start=Start Logging
 StartLoggingActionDelegate.stop=Stop Logging
+DeployActionDelegate.0=XML Format

Added: 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	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployActionDelegate.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -0,0 +1,528 @@
+package jp.go.aist.rtm.systemeditor.ui.action;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.datatype.DatatypeConstants;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import jp.go.aist.rtm.nameserviceview.model.manager.NameServerManager;
+import jp.go.aist.rtm.nameserviceview.model.manager.impl.NameServerManagerImpl;
+import jp.go.aist.rtm.systemeditor.factory.Rehabilitation;
+import jp.go.aist.rtm.systemeditor.factory.SystemEditorWrapperFactory;
+import jp.go.aist.rtm.systemeditor.manager.SystemEditorPreferenceManager;
+import jp.go.aist.rtm.systemeditor.nl.Messages;
+import jp.go.aist.rtm.systemeditor.ui.dialog.DeploymentSettingDialog;
+import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
+import jp.go.aist.rtm.systemeditor.ui.editor.NullEditorInput;
+import jp.go.aist.rtm.systemeditor.ui.editor.SystemDiagramEditor;
+import jp.go.aist.rtm.systemeditor.ui.editor.editpart.SystemDiagramEditPart;
+import jp.go.aist.rtm.systemeditor.ui.util.DeployUtil;
+import jp.go.aist.rtm.toolscommon.model.component.Component;
+import jp.go.aist.rtm.toolscommon.model.component.ComponentFactory;
+import jp.go.aist.rtm.toolscommon.model.component.CorbaComponent;
+import jp.go.aist.rtm.toolscommon.model.component.SystemDiagram;
+import jp.go.aist.rtm.toolscommon.model.component.SystemDiagramKind;
+import jp.go.aist.rtm.toolscommon.model.manager.RTCManager;
+import jp.go.aist.rtm.toolscommon.util.RtsProfileHandler;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.openrtp.namespaces.rts.version02.ComponentExt;
+import org.openrtp.namespaces.rts.version02.ConfigurationSet;
+import org.openrtp.namespaces.rts.version02.DataportConnector;
+import org.openrtp.namespaces.rts.version02.ExecutionContext;
+import org.openrtp.namespaces.rts.version02.ObjectFactory;
+import org.openrtp.namespaces.rts.version02.Participants;
+import org.openrtp.namespaces.rts.version02.Property;
+import org.openrtp.namespaces.rts.version02.RtsProfileExt;
+import org.openrtp.namespaces.rts.version02.ServiceportConnector;
+import org.openrtp.namespaces.rts.version02.TargetComponent;
+import org.openrtp.namespaces.rts.version02.TargetComponentExt;
+import org.openrtp.namespaces.rts.version02.TargetPort;
+import org.openrtp.namespaces.rts.version02.TargetPortExt;
+
+import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
+
+public class DeployActionDelegate implements IEditorActionDelegate {
+	private ISelection selection;
+	private AbstractSystemDiagramEditor targetEditor;
+
+	/**
+	* アクションのメインの実行メソッド
+	* 
+	*/
+	public void run(final IAction action) {
+		//一旦オフラインプロファイルの形式に変換
+		SystemDiagram diagram = targetEditor.getSystemDiagram();
+		XMLGregorianCalendar calendar = new XMLGregorianCalendarImpl(new GregorianCalendar());
+		calendar.setMillisecond(DatatypeConstants.FIELD_UNDEFINED);
+		diagram.setCreationDate(calendar.toString());
+		diagram.setUpdateDate(calendar.toString());
+		RtsProfileHandler handler = new RtsProfileHandler();
+		RtsProfileExt profile = handler.save(diagram);
+		
+		//プロファイル情報の書き換え
+		ObjectFactory factory = new ObjectFactory();
+		//事前処理
+		prepareProfile(profile, factory);
+		//候補コンポーネントの取得
+		NameServerManager ns = NameServerManagerImpl.getInstance();
+		EList nscomps = ns.getNodes();
+		List<CorbaComponent> componentCandidates = new ArrayList<CorbaComponent>(); 
+		componentCandidates = DeployUtil.searchComponentList(nscomps, componentCandidates);
+		
+		EList<Component> comps = targetEditor.getSystemDiagram().getComponents();
+		Map<String, CorbaComponent> replaced = new HashMap<String, CorbaComponent>();
+		//プロファイル情報の書き換え(複合RTC以外)
+		 modifyComponents(profile, ns, componentCandidates, factory, comps, replaced);
+		//プロファイル情報の書き換え
+		for(org.openrtp.namespaces.rts.version02.Component target : profile.getComponents()) {
+			CorbaComponent source = replaced.get(target.getId().trim() + target.getInstanceName().trim());
+			if( target.getCompositeType()==null || target.getCompositeType().equals("None") ) {
+				target.setPathUri(source.getPathId());
+				target.setInstanceName(source.getInstanceNameL());
+				for(ExecutionContext ec : target.getExecutionContexts() ) {
+					if( ec.getId().equals("default") ) ec.setId("0");
+				}
+				Property prop = factory.createProperty();
+				prop.setName("IOR");
+				prop.setValue(source.getIor());
+				((ComponentExt)target).getProperties().add(prop);
+				
+			} else {
+				for(Participants parts : target.getParticipants()) {
+					TargetComponent part = parts.getParticipant();
+					Component sourcePart = replaced.get(part.getComponentId().trim() + part.getInstanceName().trim());
+					part.setInstanceName(sourcePart.getInstanceNameL());
+					//
+					boolean isHit = false;
+					for( Property dpp : ((TargetComponentExt)part).getProperties()) {
+						if( dpp.getName().equals("COMPONENT_PATH_ID") ) {
+							dpp.setValue(sourcePart.getPathId());
+							isHit = true;
+							break;
+						}
+					}
+					if( !isHit ) {
+						Property path = factory.createProperty();
+						path.setName("COMPONENT_PATH_ID");
+						path.setValue(sourcePart.getPathId());
+						((TargetComponentExt)part).getProperties().add(path);
+					}
+				}
+			}
+			for( DataportConnector dpc : profile.getDataPortConnectors() ) {
+				modifyTargetComponent(factory, target.getId(), source, dpc.getSourceDataPort());
+				modifyTargetComponent(factory, target.getId(), source, dpc.getTargetDataPort());
+			}
+			for( ServiceportConnector svc : profile.getServicePortConnectors() ) {
+				modifyTargetComponent(factory, target.getId(), source, svc.getSourceServicePort());
+				modifyTargetComponent(factory, target.getId(), source, svc.getTargetServicePort());
+			}
+			modifyConfigurationSet(factory, target);
+		}
+		//新規オンラインエディタの生成
+		IWorkbenchWindow window = targetEditor.getSite().getWorkbenchWindow();
+		IEditorPart newWindow = null;
+		try {
+			newWindow = window.getActivePage().openEditor(new NullEditorInput(),
+					SystemDiagramEditor.SYSTEM_DIAGRAM_EDITOR_ID);
+		} catch (PartInitException e) {
+			e.printStackTrace();
+		}
+		SystemDiagramEditor editor = (SystemDiagramEditor)newWindow;
+		try {
+			loadFromOffline(editor, profile);
+		} catch (PartInitException e) {
+			e.printStackTrace();
+		}
+	}
+
+	private void prepareProfile(RtsProfileExt profile, ObjectFactory factory) {
+		org.openrtp.namespaces.rts.version02.Component baseComp = null;
+		for(org.openrtp.namespaces.rts.version02.Component target : profile.getComponents()) {
+			if( target.getCompositeType()==null || target.getCompositeType().equals("None") ) {
+				baseComp = target;
+				//デフォルトフィギュレーションセットの設定
+				if( target.getConfigurationSets().size()==0 ) {
+					ConfigurationSet config = factory.createConfigurationSet();
+					config.setId("default");
+					target.getConfigurationSets().add(config);
+					target.setActiveConfigurationSet("default");
+				}
+			}
+		}
+		//
+		String baseIds[] = baseComp.getId().split(":");
+		String baseCategory = baseIds[1];
+		for(org.openrtp.namespaces.rts.version02.Component target : profile.getComponents()) {
+			if( !(target.getCompositeType()==null || target.getCompositeType().equals("None")) ) {
+				//複合RTCのID情報の書き換え
+				String strId = target.getId();
+				String strIds[] = strId.split(":");
+				if(strIds[1]==null || strIds[1].length()<=0) {
+					strIds[1] = baseCategory;
+				}
+				String newId;
+				if(strIds.length<5) {
+					newId = strIds[0] + ":" + strIds[1] + ":" + strIds[2] + ":" + strIds[3] + ":0.1";
+				} else {
+					newId = strIds[0] + ":" + strIds[1] + ":" + strIds[2] + ":" + strIds[3] + ":" + strIds[4];
+				}
+				target.setId(newId);
+			}
+		}
+	}
+
+	private boolean modifyComponents(RtsProfileExt profile,
+			NameServerManager ns, List<CorbaComponent> componentCandidates,
+			ObjectFactory factory, EList<Component> comps, Map<String, CorbaComponent> replaced) {
+		for(Component target : comps) {
+			if( target.isCompositeComponent() == false ) {
+				String type = target.getProperty(DeploymentSettingDialog.KEY_DEPLOY_TYPE);
+				if( type==null || type.length()==0 ) continue;
+				//Profile中のコンポーネント情報の探索
+				org.openrtp.namespaces.rts.version02.Component propTarget = searchProfileComp(profile, target);
+				if(propTarget==null) return false;
+				
+				//実コンポーネント中から対象コンポーネントの探索
+				CorbaComponent actTarget = null;
+				if( type.equals(DeploymentSettingDialog.KEY_DEPLOY_TYPE_COMPONENT)) {
+					actTarget = searchActiveComp(componentCandidates, target);
+				} else if( type.equals(DeploymentSettingDialog.KEY_DEPLOY_TYPE_MANAGER)) {
+					actTarget = searchActiveCompByManager(ns, factory, target, propTarget);
+				}
+				if(actTarget==null) return false;
+				replaced.put(propTarget.getId().trim() + propTarget.getInstanceName().trim(), actTarget);
+				
+			} else {
+				org.openrtp.namespaces.rts.version02.ComponentExt propTarget = searchProfileComp(profile, target);
+				propTarget.setPathUri(target.getProperty(DeploymentSettingDialog.KEY_DEPLOY_TARGET));
+				propTarget.setInstanceName(target.getInstanceNameL());
+				EList<Component> subComps = target.getComponents();
+				if(modifyComponents(profile, ns, componentCandidates, factory, subComps, replaced)==false) {
+					return false;
+				}
+				//
+			}
+		}
+		return true;
+	}
+
+	private CorbaComponent searchActiveCompByManager(NameServerManager ns, ObjectFactory factory,
+			Component target, org.openrtp.namespaces.rts.version02.Component propTarget) {
+		CorbaComponent result = null;
+		EList nscomps;
+		//設定したManager情報を検索
+		java.util.List<RTCManager> managerCandidates = DeployUtil.searchManager(target);
+		String refId = target.getProperty(DeploymentSettingDialog.KEY_DEPLOY_TARGET);
+		RTCManager actManager = null;
+		for(int index=0;index<managerCandidates.size();index++) {
+			RTCManager manager = managerCandidates.get(index);
+			if( manager.getPathId().equals(refId) ) {
+				actManager = manager;
+				break;
+			}
+		}
+		if(propTarget==null ) return result;
+		//
+		EList createds = actManager.getComponentInstanceNamesR();
+		jp.go.aist.rtm.toolscommon.model.component.Component created = null;
+		Property prop = factory.createProperty();
+		for(int index=0;index<createds.size();index++) {
+			if( ((String)createds.get(index)).equals(propTarget.getInstanceName()) ) {
+				created = ComponentFactory.eINSTANCE.createCorbaComponent();
+				prop.setName("IOR");
+				prop.setValue( actManager.getComponentsR().get(index).toString());
+				break;
+			}
+		}
+		if( created==null ) {
+			created = actManager.createComponentR(createParam(propTarget));
+			//パラメータフル指定でRTCを生成できなかった場合には型のみ指定して試す
+			if( created==null ) {
+				created = actManager.createComponentR(createParamAlt(propTarget));
+			}
+			prop.setName("IOR");
+			prop.setValue(((CorbaComponent)created).getCorbaObject().toString());
+		}
+		//
+		((ComponentExt)propTarget).getProperties().add(prop);
+		for(ExecutionContext ec : propTarget.getExecutionContexts() ) {
+			if( ec.getId().equals("default") ) ec.setId("0");
+		}
+		if( propTarget.getConfigurationSets().size()==0 ) {
+			ConfigurationSet configSet = factory.createConfigurationSet();
+			configSet.setId("default");
+			propTarget.getConfigurationSets().add(configSet);
+			
+		}
+		((NameServerManagerImpl)ns).refreshAll();
+		nscomps = ns.getNodes();
+		for( Property property : ((ComponentExt)propTarget).getProperties() ) {
+			if( !property.getName().equals("IOR")) continue;
+			CorbaComponent corbaComp = DeployUtil.searchComponent(property.getValue(), nscomps);
+			if( corbaComp!=null ) {
+				propTarget.setPathUri(corbaComp.getPathId());
+				corbaComp.setComponentId(propTarget.getId());
+				corbaComp.setIor(prop.getValue());
+				result = corbaComp;
+				break;
+			}
+		}
+		return result;
+	}
+
+	private CorbaComponent searchActiveComp(List<CorbaComponent> componentCandidates, Component target) {
+		String ior = target.getProperty(DeploymentSettingDialog.KEY_DEPLOY_IOR);
+		String refId = target.getProperty(DeploymentSettingDialog.KEY_DEPLOY_TARGET);
+		CorbaComponent actTarget = null;
+		for(Component actComp : componentCandidates) {
+			if( ((CorbaComponent)actComp).getIor().equals(ior) ) {
+				actTarget = (CorbaComponent)actComp;
+				return actTarget;
+			}
+		}
+		//IORでは見つからなかった場合
+		for(Component actComp : componentCandidates) {
+			if( ((CorbaComponent)actComp).getPathId().equals(refId) ) {
+				actTarget = (CorbaComponent)actComp;
+				return actTarget;
+			}
+		}
+		return null;
+	}
+
+	private org.openrtp.namespaces.rts.version02.ComponentExt searchProfileComp(RtsProfileExt profile, Component target) {
+		org.openrtp.namespaces.rts.version02.ComponentExt propTarget = null;
+		for(org.openrtp.namespaces.rts.version02.Component proComp: profile.getComponents() ) {
+			if(proComp.getPathUri().equals(target.getPathId()) && proComp.getInstanceName().equals(target.getInstanceNameL())) {
+				propTarget = (org.openrtp.namespaces.rts.version02.ComponentExt)proComp;
+				break;
+			}
+		}
+		return propTarget;
+	}
+
+	protected void loadFromOffline(final SystemDiagramEditor editor, final RtsProfileExt profile) throws PartInitException {
+		try {
+			if (editor.getSystemDiagram() != null) {
+				editor.getSystemDiagram().setSynchronizeInterval(0);
+			}
+
+			ProgressMonitorDialog dialog = new ProgressMonitorDialog(editor.getEditorSite().getShell());
+			IRunnableWithProgress runable = new IRunnableWithProgress() {
+				public void run(IProgressMonitor monitor)
+						throws InvocationTargetException,
+						InterruptedException {
+
+					monitor.beginTask(Messages.getString("SystemDiagramEditor.3"), 100); //$NON-NLS-1$
+					monitor.subTask(Messages.getString("SystemDiagramEditor.4")); //$NON-NLS-1$
+					monitor.internalWorked(20);
+
+					try {
+						SystemDiagram diagram = (SystemDiagram)loadContentFromResource(profile);
+						editor.setSystemDiagram(diagram);
+					} catch (Exception e) {	 
+						monitor.done();
+						throw new InvocationTargetException(e,
+								Messages.getString("SystemDiagramEditor.6")  + "\r\n" + e.getMessage()); //$NON-NLS-1$
+					}
+					monitor.internalWorked(35);
+
+					monitor.subTask(Messages.getString("SystemDiagramEditor.7")); //$NON-NLS-1$
+					try{
+						RtsProfileHandler handler = new RtsProfileHandler();
+						handler.restoreConnection(editor.getSystemDiagram());
+						handler.restoreConfigSet(editor.getSystemDiagram());
+						handler.restoreExecutionContext(editor.getSystemDiagram());
+						editor.doReplace(editor.getSystemDiagram(), editor.getEditorSite());
+					} catch (Exception e) {
+						e.printStackTrace();
+						throw new InvocationTargetException(e, Messages.getString("SystemDiagramEditor.8")); //$NON-NLS-1$
+					}
+					//
+					monitor.done();
+				}
+			};
+			dialog.run(false, false, runable);
+		} catch (Exception e) {
+			throw new PartInitException(Messages.getString("SystemDiagramEditor.9"), e); //$NON-NLS-1$
+		}
+
+		editor.getSystemDiagram()
+				.setSynchronizeInterval(SystemEditorPreferenceManager.getInstance().getInterval(SystemEditorPreferenceManager.SYNC_SYSTEMEDITOR_INTERVAL));
+
+		editor.postLoad();
+		editor.setDirty();
+	}
+	
+	private EObject loadContentFromResource(RtsProfileExt profile) throws Exception {
+		RtsProfileHandler handler = new RtsProfileHandler();
+		SystemDiagram diagram = handler.load(profile, SystemDiagramKind.ONLINE_LITERAL);
+		SystemEditorWrapperFactory.getInstance().getSynchronizationManager()
+								.assignSynchonizationSupportToDiagram(diagram);
+		Rehabilitation.rehabilitation(diagram);
+
+		// 読み込み時に明示的に状態の同期を実行
+		List<Component> eComps = new ArrayList<Component>(diagram.getComponents());
+		diagram.getComponents().clear();
+		for (Component c : eComps) {
+			c.synchronizeManually();
+			diagram.addComponent(c);
+		}
+		handler.restoreCompositeComponentPort(diagram);
+		
+		return SystemEditorWrapperFactory.getInstance().postLoad(handler, diagram);
+	}
+	
+	private void modifyTargetComponent(ObjectFactory factory, String id, CorbaComponent result, TargetPort target) {
+		if( id.equals(target.getComponentId() )) {
+			target.setInstanceName(result.getInstanceNameL());
+			boolean isHit = false;
+			for( Property dpp : ((TargetPortExt)target).getProperties()) {
+				if( dpp.getName().equals("COMPONENT_PATH_ID") ) {
+					dpp.setValue(result.getPathId());
+					isHit = true;
+					break;
+				}
+			}
+			if( !isHit ) {
+				Property path = factory.createProperty();
+				path.setName("COMPONENT_PATH_ID");
+				path.setValue(result.getPathId());
+				((TargetPortExt)target).getProperties().add(path);
+			}
+		}
+	}
+	
+	private void modifyConfigurationSet(ObjectFactory factory, org.openrtp.namespaces.rts.version02.Component comp) {
+		if(comp.getConfigurationSets().size() == 0 ) {
+			ConfigurationSet config = factory.createConfigurationSet();
+			config.setId("default");
+			comp.getConfigurationSets().add(config);
+		}
+	}
+	
+	private String createParam(org.openrtp.namespaces.rts.version02.Component comp) {
+		StringBuffer buf = new StringBuffer();
+
+		String[] params = comp.getId().split(":");
+
+		if( params.length < 5 ) {
+
+			
+			if( params.length < 2) return "";
+			String[] items = params[1].split("\\.");
+			StringBuffer vendor = new StringBuffer();
+			for(int index=0;index<items.length-2;index++) {
+				vendor.append(items[index]);
+			}
+			StringBuffer newId = new StringBuffer();
+			newId.append(params[0]);
+			newId.append(":");
+			newId.append(vendor.toString());
+			newId.append(":");
+			newId.append(items[items.length-2]);
+			newId.append(":");
+			newId.append(items[items.length-1]);
+			newId.append(":");
+			newId.append(params[2]);
+			          
+			buf.append(newId.toString());
+			buf.append("?instance_name=");
+			buf.append(comp.getInstanceName());
+			buf.append("&vendor=");
+			buf.append(vendor);
+			buf.append("&version=");
+			buf.append(params[2]);
+			buf.append("&category=");
+			buf.append(items[items.length-2]);
+			
+		} else {
+			buf.append(comp.getId());
+			buf.append("?instance_name=");
+			buf.append(comp.getInstanceName());
+			buf.append("&vendor=");
+			buf.append(params[1]);
+			buf.append("&version=");
+			buf.append(params[params.length-1]);
+			buf.append("&category=");
+			buf.append(params[2]);
+		}
+		
+		return buf.toString();
+	}
+
+	private String createParamAlt(org.openrtp.namespaces.rts.version02.Component comp) {
+		StringBuffer buf = new StringBuffer();
+
+		String[] params = comp.getId().split(":");
+
+		if( params.length < 5 ) {
+			if( params.length < 2) return "";
+			String[] items = params[1].split("\\.");
+			StringBuffer vendor = new StringBuffer();
+			for(int index=0;index<items.length-2;index++) {
+				vendor.append(items[index]);
+			}
+			buf.append(items[items.length-1]);
+			buf.append("?instance_name=");
+			buf.append(comp.getInstanceName());
+			buf.append("&vendor=");
+			buf.append(vendor);
+			buf.append("&version=");
+			buf.append(params[2]);
+			buf.append("&category=");
+			buf.append(items[items.length-2]);
+		} else {
+			buf.append(params[3]);
+			buf.append("?instance_name=");
+			buf.append(comp.getInstanceName());
+			buf.append("&vendor=");
+			buf.append(params[1]);
+			buf.append("&version=");
+			buf.append(params[params.length-1]);
+			buf.append("&category=");
+			buf.append(params[2]);
+		}
+		
+		return buf.toString();
+	}
+	
+	@Override
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		this.targetEditor = (AbstractSystemDiagramEditor) targetEditor;
+	}
+	
+	@Override
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+		action.setEnabled(isEnable());
+	}
+	
+	@SuppressWarnings("unchecked")
+	private boolean isEnable() {
+		if (selection instanceof IStructuredSelection) {
+			if( ((IStructuredSelection) selection).getFirstElement() instanceof SystemDiagramEditPart) {
+				return true;
+			}
+		}
+		return false;
+	}
+}

Added: 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	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeployLoadActionDelegate.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -0,0 +1,84 @@
+package jp.go.aist.rtm.systemeditor.ui.action;
+
+import jp.go.aist.rtm.systemeditor.nl.Messages;
+import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
+import jp.go.aist.rtm.systemeditor.ui.editor.editpart.SystemDiagramEditPart;
+import jp.go.aist.rtm.toolscommon.model.component.SystemDiagram;
+import jp.go.aist.rtm.toolscommon.profiles.util.XmlHandler;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.openrtp.namespaces.deploy.Component;
+import org.openrtp.namespaces.deploy.DeployProfile;
+
+public class DeployLoadActionDelegate implements IEditorActionDelegate {
+	private ISelection selection;
+	private AbstractSystemDiagramEditor targetEditor;
+
+	@Override
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		this.targetEditor = (AbstractSystemDiagramEditor) targetEditor;
+	}
+
+	@Override
+	public void run(IAction action) {
+		FileDialog dialog = new FileDialog(targetEditor.getSite().getShell(),SWT.SAVE);
+        dialog.setText("Load Deploy Info.");
+		dialog.setFilterNames(new String[] {Messages.getString("DeployActionDelegate.0")}); //$NON-NLS-1$
+		dialog.setFilterExtensions(new String[] { "*.xml" });
+		String selectedFileName = dialog.open();
+		if( selectedFileName==null ) return;
+		//
+		XmlHandler loader = new XmlHandler();
+		DeployProfile profile = null;
+		try {
+			profile = loader.loadXmlDeploy(selectedFileName);
+		} catch(Exception ex) {
+			ex.printStackTrace();
+		}
+		//
+		SystemDiagram diagram = targetEditor.getSystemDiagram();
+		for(Component target : profile.getComponents()) {
+			EList<jp.go.aist.rtm.toolscommon.model.component.Component> compList = diagram.getComponents();
+			loadDeployInfo(target, compList);
+		}
+	}
+
+	private void loadDeployInfo(Component target,
+			EList<jp.go.aist.rtm.toolscommon.model.component.Component> compList) {
+		for(jp.go.aist.rtm.toolscommon.model.component.Component comp : compList) {
+			if(target.getId().trim().equals(comp.getComponentId())
+					&& target.getInstanceName().trim().equals(comp.getInstanceNameL().trim())) {
+				comp.setProperty("DeployType", target.getDeployType());
+				comp.setProperty("DeployTarget", target.getTarget());
+				comp.setProperty("DeployIOR", target.getIor());
+			} else {
+				if( comp.isCompositeComponent() ) {
+					loadDeployInfo(target, comp.getComponents());
+				}
+			}
+		}
+	}
+
+	@Override
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+		action.setEnabled(isEnable());
+	}
+	
+	@SuppressWarnings("unchecked")
+	private boolean isEnable() {
+		if (selection instanceof IStructuredSelection) {
+			if( ((IStructuredSelection) selection).getFirstElement() instanceof SystemDiagramEditPart) {
+				return true;
+			}
+		}
+		return false;
+	}
+}

Added: 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	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySaveActionDelegate.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -0,0 +1,80 @@
+package jp.go.aist.rtm.systemeditor.ui.action;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.GregorianCalendar;
+
+import javax.xml.datatype.DatatypeConstants;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import jp.go.aist.rtm.systemeditor.nl.Messages;
+import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
+import jp.go.aist.rtm.systemeditor.ui.editor.editpart.SystemDiagramEditPart;
+import jp.go.aist.rtm.toolscommon.model.component.SystemDiagram;
+import jp.go.aist.rtm.toolscommon.profiles.util.XmlHandler;
+import jp.go.aist.rtm.toolscommon.util.DeployProfileHandler;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.openrtp.namespaces.deploy.DeployProfile;
+
+import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
+
+public class DeploySaveActionDelegate implements IEditorActionDelegate {
+	private ISelection selection;
+	private AbstractSystemDiagramEditor targetEditor;
+
+	@Override
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		this.targetEditor = (AbstractSystemDiagramEditor) targetEditor;
+	}
+
+	@Override
+	public void run(IAction action) {
+		FileDialog dialog = new FileDialog(targetEditor.getSite().getShell(),SWT.SAVE);
+        dialog.setText("Save Deploy Info.");
+		dialog.setFilterNames(new String[] {Messages.getString("DeployActionDelegate.0")}); //$NON-NLS-1$
+		dialog.setFilterExtensions(new String[] { "*.xml" });
+		String selectedFileName = dialog.open();
+		if( selectedFileName==null ) return;
+
+		SystemDiagram diagram = targetEditor.getSystemDiagram();
+		XMLGregorianCalendar calendar = new XMLGregorianCalendarImpl(new GregorianCalendar());
+		calendar.setMillisecond(DatatypeConstants.FIELD_UNDEFINED);
+		diagram.setCreationDate(calendar.toString());
+		diagram.setUpdateDate(calendar.toString());
+		//
+		DeployProfileHandler handler = new DeployProfileHandler();
+		DeployProfile profile = handler.save(diagram);
+		//
+		XmlHandler saver = new XmlHandler();
+		try {
+			saver.saveXmlDeploy(profile, URLDecoder.decode(selectedFileName,"UTF-8"));
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	@Override
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+		action.setEnabled(isEnable());
+	}
+	
+	@SuppressWarnings("unchecked")
+	private boolean isEnable() {
+		if (selection instanceof IStructuredSelection) {
+			if( ((IStructuredSelection) selection).getFirstElement() instanceof SystemDiagramEditPart) {
+				return true;
+			}
+		}
+		return false;
+	}
+}

Added: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySettingActionDelegate.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySettingActionDelegate.java	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/action/DeploySettingActionDelegate.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -0,0 +1,73 @@
+package jp.go.aist.rtm.systemeditor.ui.action;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import jp.go.aist.rtm.systemeditor.nl.Messages;
+import jp.go.aist.rtm.systemeditor.ui.dialog.DeploymentSettingDialog;
+import jp.go.aist.rtm.systemeditor.ui.editor.AbstractSystemDiagramEditor;
+import jp.go.aist.rtm.systemeditor.ui.editor.editpart.ComponentEditPart;
+import jp.go.aist.rtm.toolscommon.model.component.Component;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+
+public class DeploySettingActionDelegate implements IEditorActionDelegate {
+
+	static final String DIALOG_TITLE_ERROR = Messages.getString("Common.dialog.error_title");
+
+	private ISelection selection;
+	private AbstractSystemDiagramEditor targetEditor;
+	private List<Component> selectedComponents;
+
+	/**
+	* アクションのメインの実行メソッド
+	* 
+	*/
+	public void run(final IAction action) {
+		if (selectedComponents.size() != 1) {
+			return;
+		}
+		Shell shell = targetEditor.getSite().getShell();
+		
+		DeploymentSettingDialog dialog = new DeploymentSettingDialog(shell, selectedComponents.get(0));
+		int open = dialog.open();
+		if (open != IDialogConstants.OK_ID) {
+			return;
+		}
+	}
+	
+	public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+		this.targetEditor = (AbstractSystemDiagramEditor) targetEditor;
+	}
+	
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+		action.setEnabled(isEnable());
+	}
+	
+	@SuppressWarnings("unchecked")
+	private boolean isEnable() {
+		selectedComponents = new ArrayList<Component>();
+		if (selection instanceof IStructuredSelection) {
+			for (Iterator iterator = ((IStructuredSelection) selection)
+					.iterator(); iterator.hasNext();) {
+				Object part = iterator.next();
+				if (part instanceof ComponentEditPart) {
+					selectedComponents.add(((ComponentEditPart) part)
+							.getModel());
+				}
+			}
+		}
+		if (selectedComponents.isEmpty()) {
+			return false;
+		}
+		return true;
+	}
+}

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ConnectorDialogBase.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -5,6 +5,9 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import jp.go.aist.rtm.systemeditor.nl.Messages;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
 import org.eclipse.jface.dialogs.TitleAreaDialog;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.CellEditor;
@@ -31,6 +34,7 @@
 	static final int PROPERTY_NAME = 0;
 	static final int PROPERTY_VALUE = 1;
 	static final int EXEC_BUTTON_WIDTH = 70;
+	static protected final String MSG_ERROR_PROPERTY_DUPLICATE = Messages.getString("ConnectorCreaterDialogBase.0");
 	
 	private List<AdditionalEntry> additional;
 	
@@ -132,6 +136,21 @@
 		return col;
 	}
 	
+	protected boolean checkProperties(List<AdditionalEntry> additional) {
+		//重複チェック
+		List<String> listAdd = new ArrayList<String>();
+		for(AdditionalEntry target : additional) {
+			if(listAdd.contains(target.getName().trim())==false) {
+				listAdd.add(target.getName().trim());
+			} else {
+				setMessage(MSG_ERROR_PROPERTY_DUPLICATE,
+						IMessageProvider.ERROR);
+				return false;
+			}
+		}
+		return true;
+	}
+	
 	public class AdditionalEntry {
 		private String name;
 		private String value;

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DataConnectorCreaterDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DataConnectorCreaterDialog.java	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DataConnectorCreaterDialog.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -769,6 +769,10 @@
 	protected void okPressed() {
 		if( additionalTableViewer!=null ) {
 			List<AdditionalEntry> additional = (List<AdditionalEntry>)additionalTableViewer.getInput();
+			//重複チェック
+			if( checkProperties(additional)==false) {
+				return;
+			}
 			for(AdditionalEntry target : additional) {
 				connectorProfile.setProperty(target.getName(), target.getValue());
 			}

Added: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/DeploymentSettingDialog.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -0,0 +1,156 @@
+package jp.go.aist.rtm.systemeditor.ui.dialog;
+
+import java.util.ArrayList;
+
+import jp.go.aist.rtm.nameserviceview.model.manager.NameServerManager;
+import jp.go.aist.rtm.nameserviceview.model.manager.impl.NameServerManagerImpl;
+import jp.go.aist.rtm.systemeditor.nl.Messages;
+import jp.go.aist.rtm.systemeditor.ui.util.DeployUtil;
+import jp.go.aist.rtm.toolscommon.model.component.Component;
+import jp.go.aist.rtm.toolscommon.model.component.CorbaComponent;
+import jp.go.aist.rtm.toolscommon.model.manager.RTCManager;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+
+public class DeploymentSettingDialog extends Dialog {
+	
+	final static public String KEY_DEPLOY_TYPE = "DeployType";
+	final static public String KEY_DEPLOY_TARGET = "DeployTarget";
+	final static public String KEY_DEPLOY_IOR = "DeployIOR";
+	
+	final static public String KEY_DEPLOY_TYPE_COMPONENT = "Component";
+	final static public String KEY_DEPLOY_TYPE_MANAGER = "Manager";
+	
+	private Component targetComponent;
+	private java.util.List<CorbaComponent> componentCandidates;
+	private java.util.List<RTCManager> managerCandidates;
+	
+	private CTabFolder tabFolder;
+	private List listComp;
+	private List listManager;
+
+	public DeploymentSettingDialog(Shell shell, Component target) {
+		super(shell);
+		this.setShellStyle(this.getShellStyle() | SWT.RESIZE  );
+		this.targetComponent = target;
+	}
+	
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		GridLayout gridLayout = new GridLayout(1, false);
+
+		Composite mainComposite = (Composite) super.createDialogArea(parent);
+		mainComposite.setLayout(gridLayout);
+		mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+		//
+		tabFolder = new CTabFolder(mainComposite,SWT.NONE);
+		GridData gd = new GridData(GridData.FILL_BOTH);
+		gd.grabExcessHorizontalSpace = true;
+		gd.grabExcessVerticalSpace = true;
+		gd.widthHint = 400;
+		gd.heightHint = 200;
+		tabFolder.setSimple(false);
+		tabFolder.setLayoutData(gd);
+		componentCandidates = new ArrayList<CorbaComponent>(); 
+		if( targetComponent.isCompositeComponent()==false ) {
+			CTabItem tabComponent = new CTabItem(tabFolder,SWT.NONE);
+			tabComponent.setText("Component");
+			//
+			NameServerManager ns = NameServerManagerImpl.getInstance();
+			EList nscomps = ns.getNodes();
+			componentCandidates = DeployUtil.searchComponentList(nscomps, componentCandidates);
+			listComp = new List(tabFolder,SWT.SINGLE|SWT.BORDER|SWT.V_SCROLL);
+			for(int index=0;index<componentCandidates.size();index++) {
+				CorbaComponent comp = componentCandidates.get(index);
+				listComp.add(comp.getPathId());
+			}
+			tabComponent.setControl(listComp);
+		}
+		CTabItem tabManager = new CTabItem(tabFolder,SWT.NONE);
+		tabManager.setText("Manager");
+		//
+		managerCandidates = DeployUtil.searchManager(targetComponent);
+		listManager = new List(tabFolder,SWT.SINGLE|SWT.BORDER|SWT.V_SCROLL);
+		for(int index=0;index<managerCandidates.size();index++) {
+			RTCManager manager = managerCandidates.get(index);
+			listManager.add(manager.getPathId());
+		}
+		tabManager.setControl(listManager);
+		
+		load();
+		
+		return mainComposite;
+	}
+	
+	private void load() {
+		String type = targetComponent.getProperty(KEY_DEPLOY_TYPE);
+		String target = targetComponent.getProperty(KEY_DEPLOY_TARGET);
+		if( type==null || type.length()==0 ) return;
+		if( type.equals(KEY_DEPLOY_TYPE_COMPONENT) ) {
+			tabFolder.setSelection(0);
+			if( target==null || target.length()==0 ) return;
+			for(int index=0;index<listComp.getItemCount();index++) {
+				if(target.equals(listComp.getItem(index).trim())) {
+					listComp.setSelection(index);
+					return;
+				}
+			}
+			
+		} else if(type.equals(KEY_DEPLOY_TYPE_MANAGER) ) {
+			if( targetComponent.isCompositeComponent() ) {
+				tabFolder.setSelection(0);
+			} else {
+				tabFolder.setSelection(1);
+			}
+			if( target==null || target.length()==0 ) return;
+			for(int index=0;index<listManager.getItemCount();index++) {
+				if(target.equals(listManager.getItem(index).trim())) {
+					listManager.setSelection(index);
+					return;
+				}
+			}
+		}
+	}
+	
+	@Override
+	protected void configureShell(Shell shell) {
+		super.configureShell(shell);
+		shell.setText(Messages.getString("DeploymentInformationDialog.0")); //$NON-NLS-1$
+	}
+	
+	@Override
+	protected void okPressed() {
+		int tabSelection = tabFolder.getSelectionIndex();
+		if(tabSelection==0) {
+			if( targetComponent.isCompositeComponent() ) {
+				targetComponent.setProperty(KEY_DEPLOY_TYPE, KEY_DEPLOY_TYPE_MANAGER);
+				int listSelection = listManager.getSelectionIndex();
+				targetComponent.setProperty(KEY_DEPLOY_TARGET, managerCandidates.get(listSelection).getPathId());
+				targetComponent.setProperty(KEY_DEPLOY_IOR, "");
+			} else {
+				targetComponent.setProperty(KEY_DEPLOY_TYPE, KEY_DEPLOY_TYPE_COMPONENT);
+				int listSelection = listComp.getSelectionIndex();
+				targetComponent.setProperty(KEY_DEPLOY_TARGET, componentCandidates.get(listSelection).getPathId());
+				targetComponent.setProperty(KEY_DEPLOY_IOR, componentCandidates.get(listSelection).getIor());
+				
+			}
+		} else {
+			targetComponent.setProperty(KEY_DEPLOY_TYPE, KEY_DEPLOY_TYPE_MANAGER);
+			int listSelection = listManager.getSelectionIndex();
+			targetComponent.setProperty(KEY_DEPLOY_TARGET, managerCandidates.get(listSelection).getPathId());
+			targetComponent.setProperty(KEY_DEPLOY_IOR, "");
+		}
+		
+		super.okPressed();
+	}
+}

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ProfileInformationDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ProfileInformationDialog.java	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ProfileInformationDialog.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -101,51 +101,14 @@
 		if (inputId != null) txtVersion.setText(inputId.version);
 		txtVersion.addKeyListener(listener);
 		//
-		GridData gd;
-		Label label = new Label(mainComposite, SWT.NULL);
-		label.setText(Messages.getString("ProfileInformationDialog.3")); //$NON-NLS-1$
-		final Text txtPathLocal = new Text(mainComposite, SWT.SINGLE | SWT.BORDER | SWT.LEFT);
-		txtPath = txtPathLocal;
-		if(inputPath!=null) txtPath.setText(inputPath);
-		txtPath.addKeyListener(listener);
-		txtPath.addModifyListener(new ModifyListener() {
-			@Override
-			public void modifyText(ModifyEvent e) {
-				doValidate();
-			}
-		});
-		gd = new GridData();
-		gd.horizontalAlignment = SWT.FILL;
-		gd.grabExcessHorizontalSpace = true;
-		txtPath.setLayoutData(gd);
-		if( isOverWrite ) txtPath.setEnabled(false);
+		txtPath = createLabelAndTextAndButton(mainComposite, Messages.getString("ProfileInformationDialog.3"),
+						inputPath, isOverWrite); //$NON-NLS-1$
 		//
-		Button checkButton = new Button(mainComposite, SWT.PUSH);
-		checkButton.setText(Messages.getString("ProfileInformationDialog.4") ); //$NON-NLS-1$
-		gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
-		gd.horizontalAlignment = SWT.FILL;
-		checkButton.setLayoutData(gd);
-		checkButton.addSelectionListener(new SelectionAdapter() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				FileDialog dialog = new FileDialog(getShell());
-				dialog.setFilterExtensions(new String[] { "*.xml" }); //$NON-NLS-1$
-				if (txtPath.getText().length() > 0)
-					dialog.setFileName(txtPath.getText());
-				String newPath = dialog.open();
-				if (newPath != null) {
-					if( !newPath.endsWith(".xml") ) newPath += ".xml"; //$NON-NLS-1$ //$NON-NLS-2$
-					txtPath.setText(newPath);
-				}
-			}
-		});
-		if( isOverWrite ) checkButton.setEnabled(false);
-		//
-		label = new Label(mainComposite, SWT.LEFT);
+		Label label = new Label(mainComposite, SWT.LEFT);
 		label.setText(Messages.getString("ProfileInformationDialog.8")); //$NON-NLS-1$
 		txtUpdateLog = new Text(mainComposite, SWT.MULTI | SWT.BORDER | SWT.LEFT);
 		txtUpdateLog.addKeyListener(listener);
-		gd = new GridData();
+		GridData gd = new GridData();
 		gd.horizontalAlignment = SWT.FILL;
 		gd.grabExcessHorizontalSpace = true;
 		gd.horizontalSpan = 2;
@@ -179,6 +142,59 @@
 		return mainComposite;
 	}
 
+	private Text createLabelAndTextAndButton(Composite mainComposite,
+			String labelString, String inputPath, boolean isOverWrite) {
+		GridData gd;
+		Label label = new Label(mainComposite, SWT.NULL);
+		label.setText(labelString);
+		final Text txtPathLocal = new Text(mainComposite, SWT.SINGLE | SWT.BORDER | SWT.LEFT);
+		if(inputPath!=null) txtPathLocal.setText(inputPath);
+		KeyListener listener = new KeyListener() {
+			@Override
+			public void keyReleased(KeyEvent e) {
+				doValidate();
+			}
+
+			@Override
+			public void keyPressed(KeyEvent e) {
+			}
+		};
+		txtPathLocal.addKeyListener(listener);
+		txtPathLocal.addModifyListener(new ModifyListener() {
+			@Override
+			public void modifyText(ModifyEvent e) {
+				doValidate();
+			}
+		});
+		gd = new GridData();
+		gd.horizontalAlignment = SWT.FILL;
+		gd.grabExcessHorizontalSpace = true;
+		txtPathLocal.setLayoutData(gd);
+		if( isOverWrite ) txtPathLocal.setEnabled(false);
+		//
+		Button checkButton = new Button(mainComposite, SWT.PUSH);
+		checkButton.setText(Messages.getString("ProfileInformationDialog.4") ); //$NON-NLS-1$
+		gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+		gd.horizontalAlignment = SWT.FILL;
+		checkButton.setLayoutData(gd);
+		checkButton.addSelectionListener(new SelectionAdapter() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				FileDialog dialog = new FileDialog(getShell());
+				dialog.setFilterExtensions(new String[] { "*.xml" }); //$NON-NLS-1$
+				if (txtPathLocal.getText().length() > 0)
+					dialog.setFileName(txtPathLocal.getText());
+				String newPath = dialog.open();
+				if (newPath != null) {
+					if( !newPath.endsWith(".xml") ) newPath += ".xml"; //$NON-NLS-1$ //$NON-NLS-2$
+					txtPathLocal.setText(newPath);
+				}
+			}
+		});
+		if( isOverWrite ) checkButton.setEnabled(false);
+		return txtPathLocal;
+	}
+
 	@Override
 	protected void configureShell(Shell shell) {
 		super.configureShell(shell);

Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ServiceConnectorCreaterDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ServiceConnectorCreaterDialog.java	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/ServiceConnectorCreaterDialog.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -9,7 +9,6 @@
 import java.util.List;
 import java.util.Map;
 
-import jp.go.aist.rtm.systemeditor.ui.dialog.ConnectorDialogBase.AdditionalEntry;
 import jp.go.aist.rtm.toolscommon.model.component.Component;
 import jp.go.aist.rtm.toolscommon.model.component.ComponentFactory;
 import jp.go.aist.rtm.toolscommon.model.component.ConnectorProfile;
@@ -517,6 +516,12 @@
 
 	@Override
 	protected void okPressed() {
+		if( additionalTableViewer!=null ) {
+			//重複チェック
+			if( checkProperties((List<AdditionalEntry>)additionalTableViewer.getInput())==false) {
+				return;
+			}
+		}
 		applyEntry();
 		dialogResult = connectorProfile;
 		super.okPressed();

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	2012-01-13 15:32:57 UTC (rev 240)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -16,7 +16,6 @@
 import java.util.List;
 
 import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.XMLGregorianCalendar;
 
 import jp.go.aist.rtm.systemeditor.RTSystemEditorPlugin;
@@ -99,7 +98,6 @@
 import org.eclipse.ui.views.properties.IPropertySheetPage;
 import org.openrtp.namespaces.rts.version02.RtsProfileExt;
 
-import com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl;
 import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
 
 public abstract class AbstractSystemDiagramEditor extends GraphicalEditor {

Added: 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	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/DeployUtil.java	2012-01-13 15:33:27 UTC (rev 241)
@@ -0,0 +1,87 @@
+package jp.go.aist.rtm.systemeditor.ui.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jp.go.aist.rtm.nameserviceview.model.manager.NameServerManager;
+import jp.go.aist.rtm.nameserviceview.model.nameservice.NamingContextNode;
+import jp.go.aist.rtm.nameserviceview.model.nameservice.NamingObjectNode;
+import jp.go.aist.rtm.toolscommon.model.component.Component;
+import jp.go.aist.rtm.toolscommon.model.component.CorbaComponent;
+import jp.go.aist.rtm.toolscommon.model.manager.RTCManager;
+import jp.go.aist.rtm.toolscommon.util.AdapterUtil;
+
+import org.eclipse.emf.common.util.EList;
+
+import RTC.RTObjectHelper;
+
+public class DeployUtil {
+
+	static public List<CorbaComponent> searchComponentList(EList target, List<CorbaComponent> result) {
+
+		for(int index=0;index<target.size();index++) {
+			if( target.get(index) instanceof NamingObjectNode ) {
+				NamingObjectNode obj = ((NamingObjectNode)target.get(index));
+				try {
+					if( obj.getCorbaObject()._is_a(RTObjectHelper.id()) ) {
+						CorbaComponent component = (CorbaComponent)(jp.go.aist.rtm.toolscommon.model.component.Component) AdapterUtil.getAdapter(obj,jp.go.aist.rtm.toolscommon.model.component.Component.class);
+						obj.getSynchronizationSupport().getSynchronizationManager().assignSynchonizationSupport(component);					
+						component.synchronizeManually();
+						component.setIor(obj.getCorbaObject().toString());
+						result.add(component);
+					}
+				} catch(Exception ex) {
+					ex.printStackTrace();
+				}
+			} else {
+				EList nscomps = ((NamingContextNode)target.get(index)).getNodes();
+				searchComponentList(nscomps, result);
+			}
+		}
+		return result;
+	}
+	
+	static public CorbaComponent searchComponent(String id, EList target) {
+
+		CorbaComponent result = null;
+		
+		for(int index=0;index<target.size();index++) {
+			if( target.get(index) instanceof NamingObjectNode ) {
+				NamingObjectNode obj = ((NamingObjectNode)target.get(index));
+				try {
+					if( obj.getCorbaObject()._is_a(RTObjectHelper.id()) ) {
+						CorbaComponent component = (CorbaComponent)(jp.go.aist.rtm.toolscommon.model.component.Component) AdapterUtil.getAdapter(obj,jp.go.aist.rtm.toolscommon.model.component.Component.class);
+						obj.getSynchronizationSupport().getSynchronizationManager().assignSynchonizationSupport(component);					
+						component.synchronizeManually();
+					
+						if( id.equals(component.getCorbaObject().toString()) ) {
+							return component;
+						}
+					}
+				} catch(Exception ex) {
+					ex.printStackTrace();
+				}
+			} else {
+				EList nscomps = ((NamingContextNode)target.get(index)).getNodes();
+				result = searchComponent(id, nscomps);
+			}
+		}
+		return result;
+	}
+	
+	static public  java.util.List<RTCManager> searchManager(Component targetComponent) {
+		java.util.List<RTCManager> result = new ArrayList<RTCManager>();
+		java.util.List<RTCManager> mgrList = NameServerManager.eInstance.getRTCManagerList();
+		if( targetComponent.getCompositeTypeL()==null || targetComponent.getCompositeTypeL().equals("None") ) {
+			String compType = targetComponent.getTypeNameL();
+			for(RTCManager manager : mgrList) {
+				if( manager.getFactoryProfileTypeNamesR().contains(compType) ) {
+					result.add(manager);
+				}
+			}
+		} else {
+			result.addAll(mgrList);
+		}
+		return result;
+	}
+}



openrtm-commit メーリングリストの案内