Add naming of editor parts in SLC.
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 14 Jun 2013 10:07:25 +0000 (10:07 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 14 Jun 2013 10:07:25 +0000 (10:07 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@6337 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessBuilderPage.java
plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessEditor.java

index 1444ff185c5750f99bb4d297966ff97260b228c1..07817cc2a623e7e5e1fb3019c86ad4dc43c724c7 100644 (file)
@@ -347,6 +347,8 @@ public class ProcessBuilderPage extends FormPage implements SlcNames {
                        Node flowNode = processNode.getSession().getNode(path);
                        Node realizedFlowNode = processNode.getNode(SLC_FLOW).addNode(
                                        SLC_FLOW);
+                       realizedFlowNode.setProperty(SLC_NAME,
+                                       flowNode.getProperty(SLC_NAME).getString());
                        realizedFlowNode.addMixin(SlcTypes.SLC_REALIZED_FLOW);
                        Node address = realizedFlowNode.addNode(SLC_ADDRESS,
                                        NodeType.NT_ADDRESS);
@@ -385,10 +387,21 @@ public class ProcessBuilderPage extends FormPage implements SlcNames {
                                }
                        }
 
+                       // Part title
+                       StringBuilder editorTitle = new StringBuilder();
+                       NodeIterator it = realizedFlowNode.getParent().getNodes(SLC_FLOW);
+                       while (it.hasNext()) {
+                               Node rFlowNode = it.nextNode();
+                               String name = rFlowNode.getProperty(SLC_NAME).getString();
+                               editorTitle.append(name).append(' ');
+                       }
+                       ((ProcessEditor) getEditor())
+                                       .setEditorTitle(editorTitle.toString());
+
                        flowsViewer.refresh();
                        formPart.markDirty();
                } catch (RepositoryException e) {
-                       throw new SlcException("Cannot drop " + path, e);
+                       throw new SlcException("Cannot add flow " + path, e);
                }
        }
 
index 8d4d6cd9b70f954c5a3a18ce7ca8a6c8dab65eb9..7e99f42549d9974458f1818ca4ee6c1d878ceec8 100644 (file)
@@ -235,6 +235,10 @@ public class ProcessEditor extends FormEditor implements SlcTypes, SlcNames {
                }
        }
 
+       public void setEditorTitle(String title) {
+               setPartName(title);
+       }
+
        @Override
        public void doSaveAs() {
        }