カスタムコマンド定義の例
例: プロパティ置換を使用した URL の一部の置換
このカスタムコマンドには Button Label というラベルが付き、ツールヒントなどがあります。さらに、このコマンドをアクティブ化した場合、現在選択されている部分で、指定されているプロパティ (Source_file_name) の有無がチェックされます。見つからない場合、このボタンは有効になりません。見つかった場合、URL 内のサブ文字列が置き換えられます。
<menu
ui="rmb"
view="all"
pane="all"
select="any"
visible="getSelectedCount()==1 &amp;&amp; getPropertyExists(&apos;Source_file_name&apos;)">
<command_name >MyCommand 1</command_name>
<label >Button Label</label>
<tooltip>This is a new command.</tooltip>
<icon>\my\icons\location\icon16x16.png</icon>
<action
target="browser">
http://somewhere.com/content.jsp?partName=&lt;!Source_file_name!&gt;
</action>
</menu>
例: 複数の部分が選択されている場合の URL の一部の置換
この例では、ユーザーが 2 つの部分を選択すると、Featrue_Id から返った、両方の部分の getSelectedPartProperty プロパティの値が呼び出されます。その後、URL の 2 つのサブ文字列がこれらの値に置き換えられます。
<menu
ui="rmb"
view="all"
pane="all"
select="any"
visible="getSelectedCount()==2 &amp;&amp; getSelectedPartProperty(1,&apos;Feature_Id&apos;,&apos;featureId1&apos;) &amp;&amp;
getSelectedPartProperty(2,&apos;Feature_Id&apos;,&apos;featureId2&apos;)">
<command_name >MyCommand 2</command_name>
<label >Button Label</label>
<action
target="browser">
http://www.somewhere.com/index.jsp?Id1=&lt;!featureId1!&gt;&amp;Id2=&lt;!featureId2!&gt;
</action>
</menu>
これは役に立ちましたか?