DevFaqActionAddProjectPopUp

(Difference between revisions)
 
Line 2: Line 2:
===How do I add an action to a project popup menu?===
===How do I add an action to a project popup menu?===
-
Just register an instance of the action in your XML layer under <tt>Actions/SomeFolder</tt> and add shadow reference in <tt>Projects/Actions/</tt>. It should implement a <tt>ContextAwareAction</tt> interface.
+
Just use <tt>@ActionReference(path="Projects/Actions")</tt>. The action should take a context parameter in its constructor.
-
 
+
-
<source lang="xml">
+
-
<filesystem>
+
-
    <folder name="Actions">
+
-
        <folder name="SomeFolder">
+
-
            <file name="projectcontextmenudemo-DemoAction.instance"/>
+
-
        </folder>
+
-
    </folder>
+
-
    <folder name="Projects">
+
-
        <folder name="Actions">
+
-
            <file name="projectcontextmenudemo-DemoAction.shadow">
+
-
                <attr name="originalFile"
+
-
stringvalue="Actions/SomeFolder/projectcontextmenudemo-DemoAction.instance"/>
+
-
            </file>
+
-
        </folder>
+
-
    </folder>
+
-
</filesystem>
+
-
</source>
+
See also [[DevFaqActionAddProjectTypePopUp| How do I add an action to a project popup menu of a specific project type?]]
See also [[DevFaqActionAddProjectTypePopUp| How do I add an action to a project popup menu of a specific project type?]]

Current revision as of 00:12, 14 December 2011

How do I add an action to a project popup menu?

Just use @ActionReference(path="Projects/Actions"). The action should take a context parameter in its constructor.

See also How do I add an action to a project popup menu of a specific project type?

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo