// 
//     Licensed to the Apache Software Foundation (ASF) under one
//     or more contributor license agreements.  See the NOTICE file
//     distributed with this work for additional information
//     regarding copyright ownership.  The ASF licenses this file
//     to you under the Apache License, Version 2.0 (the
//     "License"); you may not use this file except in compliance
//     with the License.  You may obtain a copy of the License at
// 
//       http://www.apache.org/licenses/LICENSE-2.0
// 
//     Unless required by applicable law or agreed to in writing,
//     software distributed under the License is distributed on an
//     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
//     KIND, either express or implied.  See the License for the
//     specific language governing permissions and limitations
//     under the License.
//

= DevFaqActionsFolder
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqActionsFolder
:description: Apache NetBeans wiki DevFaqActionsFolder
:toc: left
:toc-title:
:syntax: true

=== What is the Actions folder in the system filesystem, and why should I use it?

When you use @ActionRegistration the META-INF/generated-layer.xml may contain:

[source,xml]
----

<folder name="Actions">
   <folder name="Build">
     <file name="com-foo-SomeAction.instance"/>
   </folder>
</folder>
<folder name="Menu">
   <folder name="Build">
     <file name="pointerToComFooSomeAction.shadow">
        <attr name="originalFile" stringvalue="Actions/Build/com-foo-SomeAction.instance"/>
     </file>
   </folder>
</folder>

----

And you may have noticed that actions are usually put, not directly into the `Menu/` folders, but into subfolders of this `Actions/` folder.  Then we create link:DevFaqDotShadowFiles.asciidoc[.shadow files ] that act like symbolic links, pointing to the real link:DevFaqInstanceDataObject.asciidoc[.instance file ].  Why all this indirection?

Older versions of the NetBeans UI included the ability to rearrange, and even delete, whole menus or individual menu items, and future ones may again.
(Many applications built on NetBeans will not want to expose such customizability, but some do.)
The current UI does include a key binding editor;
the `Actions/` folder can be used from this editor to list available actions, even those which are not currently bound to any keystroke.

Additionally, for actions which are `javax.swing.Action` but not `SystemAction`,
creating the action instance in only a single place
ensures that it acts as a singleton.
(While the action class likely has no declared instance fields,
it does have some state,
notably information about keyboard accelerators which should be displayed in menu presenters.)

<hr/>

Applies to: NetBeans 6.7 and above

=== Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.

This page was exported from link:http://wiki.netbeans.org/DevFaqActionsFolder[http://wiki.netbeans.org/DevFaqActionsFolder] , 
that was last modified by NetBeans user Jglick 
on 2011-12-14T00:09:39Z.


*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.
