Removing Menu Entries

View: New views
4 Messages — Rating Filter:   Alert me  

Removing Menu Entries

by Q Beukes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey,

I am trying to remove the default menu entries from a NB platform app.

This was fine, as I changed the .shadow options to .shadow_hidden in one of my module's layer.xml. Though some options aren't going away, like File->Save, File->SaveAll and Tools->Templates.

I tried adding a layer.xml for org-netbeans-modules-favorites.jar to my branding, and overriding it's layer.xml. At first I just copied it's layer.xml, and this was loaded (as some of it's resource references were now unresolved because I didn't copy them to my JAR - these gave FileNotFoundExceptions). Then I tried removing/hiding it in this override. No effect.

I also tried making one of my modules depend on this module, to ensure it loads before mine, but this had no effect either.

Is there any way I can determine where these entries are coming from, and/or does someone know this and can tell me how to remove it?

Quintin Beukes

Re: Removing Menu Entries

by Jesse Glick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quintin Beukes wrote:
> I changed the .shadow options to .shadow_hidden in one
> of my module's layer.xml. Though some options aren't going away, like
> File->Save, File->SaveAll and Tools->Templates.

For example,

http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/build/generated/layers.txt

indicates that (at least in dev builds) Tools > Templates is produced by

o.n.m.favorites                           Menu/Tools/o-n-m-favorites-templates-TemplatesAction.shadow @1000

So all you need is for some layer, anywhere that gets loaded (can be in a module in your suite etc.) to define

<folder name="Menu">
   <folder name="Tools">
     <file name="org-netbeans-modules-favorites-templates-TemplatesAction.shadow_hidden"/>
   </folder>
</folder>

and this menu item should vanish.


Re: Re: Removing Menu Entries

by Quintin Beukes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I even tried putting in ALL my modules being loaded (after one was ineffective):
<filesystem>
  <folder name="Menu">
         <folder name="Tools">
            <file name="Separator1.instance_hidden"/>
            <file name="org-netbeans-modules-favorites-templates-TemplatesAction.shadow_hidden"/>
        </folder>
  </folder>
</filesystem>

Like I mentioned, most of the .shadow_hidden entries work, but some don't.

What about these (will try them tomorrow):
o.n.m.codetemplatetools                   Actions/Edit/o-n-m-codetemplatetools-actions-ShowTemplatesAction.instance

o.n.core.ui                               Actions/System/o-o-actions-SaveAction.instance
o.n.core.ui                               Actions/System/o-o-actions-SaveAllAction.instance
They seem like alternatives for those that don't want to vanish, so I might be lucky and have them work. Even though their paths don't match the menus they appear on?

Quintin Beukes


On Thu, Oct 29, 2009 at 10:11 PM, Jesse Glick <jesse.glick@...> wrote:
Quintin Beukes wrote:
I changed the .shadow options to .shadow_hidden in one of my module's layer.xml. Though some options aren't going away, like File->Save, File->SaveAll and Tools->Templates.

For example,

http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/build/generated/layers.txt

indicates that (at least in dev builds) Tools > Templates is produced by

o.n.m.favorites                           Menu/Tools/o-n-m-favorites-templates-TemplatesAction.shadow @1000

So all you need is for some layer, anywhere that gets loaded (can be in a module in your suite etc.) to define

<folder name="Menu">
 <folder name="Tools">
   <file name="org-netbeans-modules-favorites-templates-TemplatesAction.shadow_hidden"/>
 </folder>
</folder>

and this menu item should vanish.



Re: Removing Menu Entries

by Jesse Glick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quintin Beukes wrote:
> o.n.core.ui                               Actions/System/o-o-actions-SaveAction.instance

This is just an action definition which GUI registrations may link to. By itself it has no GUI presence.