How can I creat an item in a specify position of a menu?

User a9431cd809

28-11-2007 03:07:41

Hello:


I am writing a plugin for Instant JChem, when I put an item in menu,


I have a question:


The item which I creat appeared between "Edit" and "View", but it is not I want to. How can I creat the item in the end of the menu?


The layer.xml:


<folder name="Menu">


<folder name="Phastec">


<file name="com-im-ijc-addfield-EditAction.shadow">


<attr name="originalFile" stringvalue="Actions/Edit/com-im-ijc-addfield-EditAction.instance"/>


</file>


<attr name="com-im-ijc-addfield-EditAction.shadow/com-im-ijc-addfield-AddAction.shadow" boolvalue="true"/>


</folder>


</folder>

ChemAxon e189db4705

28-11-2007 03:24:19

Hi,





You need to use an absolute positioning for your sub-menu. All items in layers can specify their position as an integer number. This is a new feature in NetBeans 6.0 (which IJC 2.x uses). It is replacing the relative positioning which was used in NB 5.5 or older (although should still work).





If I understand correctly, you want to put your menu to right side from Help menu. In this case you must specify some number which is greater than 1300 (Help menu absolute position).





Try to add this to the layer:


Code:



<folder name="Menu">


  <folder name="Phastec">


    <attr name="position" intvalue="1400"/>


    <file name="com-im-ijc-addfield-EditAction.shadow">


      <attr name="originalFile"  stringvalue="Actions/Edit/com-im-ijc-addfield-EditAction.instance"/>


    </file>


  </folder>


</folder>








Unfortunately it looks that our tutorial is not up-to-date in this section. We will fix it.


Thanks.

User a9431cd809

28-11-2007 04:57:40

Thanks very much!!