]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Only have Remove menu action active when the diagram selection is non-empty and renam...
authorlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 18 Mar 2010 23:36:56 +0000 (23:36 +0000)
committerlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 18 Mar 2010 23:36:56 +0000 (23:36 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15137 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/plugin.xml

index d78c871880044a386884d2d73ad062c8e8b59394..366f6029a02e8b4096ffc25ef81e30a80c8085e0 100644 (file)
                label="Rename"\r
                style="push">\r
             <visibleWhen\r
-                  checkEnabled="true">\r
+                  checkEnabled="false">\r
             </visibleWhen>\r
          </command>\r
          <command\r
                label="Remove"\r
                style="push">\r
             <visibleWhen\r
-                  checkEnabled="true">\r
+                  checkEnabled="false">\r
             </visibleWhen>\r
          </command>\r
       </menuContribution>\r
                id="org.simantics.sysdyn.ui.trend.view.pin.state">\r
          </state>\r
       </command>\r
-      <command\r
-            defaultHandler="org.simantics.sysdyn.ui.handlers.RemoveHandler"\r
-            id="org.simantics.sysdyn.ui.remove"\r
-            name="Remove">\r
-      </command>\r
       <command\r
             defaultHandler="org.simantics.sysdyn.ui.handlers.CreateAuxiliaryHandler"\r
             id="org.simantics.sysdyn.ui.createAuxiliary"\r
             name="Create Valve">\r
       </command>\r
       <command\r
-            defaultHandler="org.simantics.sysdyn.ui.handlers.RenameHandler"\r
+            id="org.simantics.sysdyn.ui.remove"\r
+            name="Remove">\r
+      </command>\r
+      <command\r
             id="org.simantics.sysdyn.ui.rename"\r
             name="Rename">\r
       </command>\r
             class="org.simantics.sysdyn.ui.trend.PinTrend"\r
             commandId="org.simantics.sysdyn.ui.trend.view.pin">\r
       </handler>\r
+      <handler\r
+            class="org.simantics.sysdyn.ui.handlers.RemoveHandler"\r
+            commandId="org.simantics.sysdyn.ui.remove">\r
+         <activeWhen>\r
+            <with\r
+                  variable="selection">\r
+              <not>\r
+                 <count\r
+                       value="0">\r
+                 </count>\r
+              </not>\r
+            </with>\r
+         </activeWhen>\r
+      </handler>\r
+      <handler\r
+            class="org.simantics.sysdyn.ui.handlers.RenameHandler"\r
+            commandId="org.simantics.sysdyn.ui.rename">\r
+         <activeWhen>\r
+            <with\r
+                  variable="selection">\r
+              <count\r
+                    value="1">\r
+              </count>\r
+            </with>\r
+         </activeWhen>\r
+      </handler>\r
       <handler\r
             class="org.simantics.sysdyn.ui.handlers.UnlinkNodeHandler"\r
             commandId="org.simantics.sysdyn.ui.removeNode">\r