org.openide.awt.ActionReference Java Examples

The following examples show how to use org.openide.awt.ActionReference. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActionProviderImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@ActionID(id = "org.netbeans.modules.maven.customPopup", category = "Project")
@ActionRegistration(displayName = "#LBL_Custom_Run", lazy=false)
@ActionReferences({
    @ActionReference(position = 1400, path = "Projects/org-netbeans-modules-maven/Actions"),
    @ActionReference(position = 250, path = "Loaders/text/x-maven-pom+xml/Actions"),
    @ActionReference(position = 1296, path = "Loaders/text/x-java/Actions"),
    @ActionReference(position = 1821, path = "Editors/text/x-java/Popup")
})
@Messages({"LBL_Custom_Run=Run Maven", "LBL_Custom_Run_File=Run Maven"})
public static ContextAwareAction customPopupActions() {
    return new ConditionallyShownAction() {
        
        protected @Override Action forProject(Project p, FileObject fo) {
            ActionProviderImpl ap = p.getLookup().lookup(ActionProviderImpl.class);
            return ap != null ? ap.new CustomPopupActions(triggeredOnFile, triggeredOnPom, fo) : null;
        }
    };
}
 
Example #2
Source File: AntActions.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages({
    "LBL_ProfileProject=Profile"
})
@ActionID(category="Profile", id="org.netbeans.modules.profiler.actions.ProfileProjectPopup")
@ActionRegistration(displayName="#LBL_ProfileProject", lazy=false, asynchronous=true)
@ActionReferences({
    @ActionReference(path="Projects/org-netbeans-modules-java-j2seproject/Actions", position=1000),
    @ActionReference(path="Projects/org-netbeans-modules-java-j2semodule/Actions", position=1000),
    @ActionReference(path="Projects/org-netbeans-modules-apisupport-project/Actions", position=900),
    @ActionReference(path="Projects/org-netbeans-modules-apisupport-project-suite/Actions", position=1000),
    @ActionReference(path="Projects/org-netbeans-modules-web-project/Actions", position=1000)
})
public static Action profileProjectPopup() {
    Action delegate = ProjectSensitiveActions.projectSensitiveAction(
            ProjectSensitivePerformer.profileProject(ActionProvider.COMMAND_PROFILE), 
            NbBundle.getMessage(AntActions.class, "LBL_ProfileProject"), // NOI18N
            null
    );
    
    return delegate;
}
 
Example #3
Source File: AntActions.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages("LBL_ProfileFile=Profile &File")
@ActionID(category="Profile", id="org.netbeans.modules.profiler.actions.ProfileSingle")
@ActionRegistration(displayName="#LBL_ProfileFile", lazy=false)
@ActionReferences({
    @ActionReference(path="Loaders/text/x-java/Actions", position=1200),
    @ActionReference(path="Loaders/text/x-jsp/Actions", position=800),
    @ActionReference(path="Menu/Profile", position=110)
})
public static Action profileSingle() {
    Action delegate = FileSensitiveActions.fileSensitiveAction(
            new FileSensitivePerformer(ActionProvider.COMMAND_PROFILE_SINGLE),  
            Bundle.LBL_ProfileFile(),
            null);
    
    return delegate;
}
 
Example #4
Source File: AntActions.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages({
        "# {0} - # of selected projects (0 if disabled), or -1 if main project", 
        "# {1} - project name, if exactly one project", 
//        "LBL_ProfileMainProjectAction=&Profile {0,choice,-1#Main Project|0#Project|1#Project ({1})|1<{0} Projects}" // #231371
        "LBL_AttachMainProjectAction=&Attach to {0,choice,-1#Main Project|0#Project|1#Project ({1})|1<Project}"
    })
    @ActionID(category="Profile", id="org.netbeans.modules.profiler.actions.AttachMainProject")
    @ActionRegistration(displayName="#LBL_AttachMainProjectAction", lazy=false)
    @ActionReferences({
        @ActionReference(path="Menu/Profile", position=125)
    })
    public static Action attachMainProjectAction() {
        Action delegate = ProjectSensitiveActions.projectSensitiveAction(
                ProjectSensitivePerformer.attachProject(), 
                NbBundle.getMessage(AntActions.class, "LBL_AttachMainProjectAction"), // NOI18N
                Icons.getIcon(ProfilerIcons.ATTACH)
        );
        delegate.putValue(Action.SHORT_DESCRIPTION, NbBundle.getMessage(AntActions.class, "LBL_AttachMainProjectAction")); // NOI18N
        delegate.putValue("iconBase", Icons.getResource(ProfilerIcons.ATTACH)); // NOI18N
        
        return delegate;
    }
 
Example #5
Source File: ActionProviderImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@ActionID(id = "org.netbeans.modules.gradle.customPopup", category = "Project")
@ActionRegistration(displayName = "#LBL_Custom_Run", lazy = false)
@ActionReferences({
    @ActionReference(position = 1400, path = "Projects/" + NbGradleProject.GRADLE_PROJECT_TYPE + "/Actions"),
    @ActionReference(position = 250, path = "Loaders/text/x-gradle+x-groovy/Actions"),
    @ActionReference(position = 250, path = "Loaders/text/x-gradle+x-kotlin/Actions"),
    @ActionReference(position = 1295, path = "Loaders/text/x-java/Actions"),
    @ActionReference(position = 1821, path = "Editors/text/x-java/Popup"),
    @ActionReference(position = 1295, path = "Loaders/text/x-groovy/Actions"),
    @ActionReference(position = 1821, path = "Editors/text/x-groovy/Popup")
})
@NbBundle.Messages({"LBL_Custom_Run=Run Gradle", "LBL_Custom_Run_File=Run Gradle"})
public static ContextAwareAction customPopupActions() {
    return new ConditionallyShownAction() {

        protected @Override
        Action forProject(Project p, FileObject fo) {
            ActionProviderImpl ap = p.getLookup().lookup(ActionProviderImpl.class);
            return ap != null ? ap.new CustomPopupActions(triggeredOnFile, triggeredOnGradle, fo) : null;
        }
    };
}
 
Example #6
Source File: Tab.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Finds default instance. Use in client code instead of {@link #getDefault()}. */
@ActionID(id = "org.netbeans.modules.favorites.View", category = "Window")
@OpenActionRegistration(displayName="#ACT_View")
@ActionReference(position = 400, path = "Menu/Window")
public static synchronized Tab findDefault() {
    if(DEFAULT == null) {
        TopComponent tc = WindowManager.getDefault().findTopComponent("favorites"); // NOI18N
        if(DEFAULT == null) {
            Logger.getLogger(Tab.class.getName()).log(Level.WARNING, null,
                              new IllegalStateException("Can not find project component for its ID. Returned " +
                                                        tc)); // NOI18N
            DEFAULT = new Tab();
            // XXX Look into getDefault method.
            DEFAULT.scheduleValidation();
        }
    }

    return DEFAULT;
}
 
Example #7
Source File: ActionProviderImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@ActionID(id = "org.netbeans.modules.maven.closeSubprojects", category = "Project")
@ActionRegistration(displayName = "#ACT_CloseRequired", lazy=false)
@ActionReference(position = 2000, path = "Projects/org-netbeans-modules-maven/Actions")
@Messages("ACT_CloseRequired=Close Required Projects")
public static ContextAwareAction closeSubprojectsAction() {
    return new ConditionallyShownAction() {
        protected @Override Action forProject(Project p, FileObject fo) {
            NbMavenProjectImpl project = p.getLookup().lookup(NbMavenProjectImpl.class);
            if (project != null && NbMavenProject.TYPE_POM.equalsIgnoreCase(project.getProjectWatcher().getPackagingType())) {
                return new CloseSubprojectsAction(project);
            } else {
                return null;
            }
        }
    };
}
 
Example #8
Source File: GroovyActionsRegistration.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_DebugTestFile_Action=Debug Test File")
@ActionID(id = "org.netbeans.modules.groovy.support.GroovyProjectModule.debug.test", category = "Groovy")
@ActionRegistration(lazy = false, displayName = "#LBL_DebugTestFile_Action")
@ActionReferences(value = {
    @ActionReference(path = "Loaders/text/x-groovy/Actions", position = 590),
    @ActionReference(path = "Editors/text/x-groovy/Popup", position = 840)
})
public static Action debugTest() {
    return FileSensitiveActions.fileCommandAction(
            ActionProvider.COMMAND_DEBUG_TEST_SINGLE,
            LBL_DebugTestFile_Action(),
            null);
}
 
Example #9
Source File: GroovyActionsRegistration.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_DebugFile_Action=Debug File")
@ActionID(id = "org.netbeans.modules.groovy.support.GroovyProjectModule.debug", category = "Groovy")
@ActionRegistration(lazy = false, displayName = "#LBL_DebugFile_Action")
@ActionReferences(value = {
    @ActionReference(path = "Loaders/text/x-groovy/Actions", position = 570),
    @ActionReference(path = "Editors/text/x-groovy/Popup", position = 820)
})
public static Action debug() {
    return FileSensitiveActions.fileCommandAction(
            ActionProvider.COMMAND_DEBUG_SINGLE,
            LBL_DebugFile_Action(),
            null);
}
 
Example #10
Source File: SelectNodeAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.project.ui.SelectInProjects", category = "Window/SelectDocumentNode")
@ActionRegistration(displayName = "#LBL_SelectInProjectsAction_MainMenuName", lazy=false)
@ActionReferences({
    @ActionReference(path = "Shortcuts", name = "DS-1"),
    @ActionReference(path = "Menu/GoTo", position = 2600, separatorBefore = 2500),
    @ActionReference(path = "Editors/TabActions", position = 100)
})
@Messages("LBL_SelectInProjectsAction_MainMenuName=Select in Pro&jects")
public static SelectNodeAction inProjects() {
    return new SelectNodeAction(SELECT_IN_PROJECTS_ICON, LBL_SelectInProjectsAction_MainMenuName(), ProjectTab.ID_LOGICAL, null);
}
 
Example #11
Source File: ProjectTabAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.project.ui.logical.tab.action", category = "Project")
@ActionRegistration(displayName = "#LBL_ProjectsLogicalTabAction_Name", iconBase = "org/netbeans/modules/project/ui/resources/projectTab.png")
@ActionReferences(value = {
    @ActionReference(path = "Shortcuts", name = "D-1"),
    @ActionReference(path = "Menu/Window", position = 100)})
@Messages("LBL_ProjectsLogicalTabAction_Name=Pro&jects")
public static Action projectsLogical() {
    return new ProjectTabAction(Bundle.LBL_ProjectsLogicalTabAction_Name(), ICON1, 1);
}
 
Example #12
Source File: ProjectTabAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.project.ui.physical.tab.action", category = "Project")
@ActionRegistration(displayName = "#LBL_ProjectsPhysicalTabAction_Name", iconBase = "org/netbeans/modules/project/ui/resources/filesTab.png")
@ActionReferences(value = {
    @ActionReference(path = "Shortcuts", name = "D-2"),
    @ActionReference(path = "Menu/Window", position = 200)})
@Messages("LBL_ProjectsPhysicalTabAction_Name=&Files")
public static Action projectsPhysical() {
    return new ProjectTabAction(Bundle.LBL_ProjectsPhysicalTabAction_Name(), ICON2, 0);
}
 
Example #13
Source File: J2eeActions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.maven.j2ee.verify", category = "Project")
@ActionRegistration(displayName = "#ACT_Verify", lazy=false)
@ActionReference(position = 651, path = "Projects/org-netbeans-modules-maven/Actions")
@Messages("ACT_Verify=Verify")
public static ContextAwareAction verifyAction() {
    return new VerifyAction();
}
 
Example #14
Source File: CreateJob.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Global action which also allows you to pick a server. */
@ActionID(category="Team", id="org.netbeans.modules.hudson.ui.actions.CreateJob.global")
@ActionRegistration(displayName="#CTL_CreateJob", iconInMenu=false)
@ActionReference(path="Menu/Versioning", position=400)
@Messages("CTL_CreateJob=Create Build &Job...")
public static ActionListener global() {
    return new CreateJob(null);
}
 
Example #15
Source File: GroovyActionsRegistration.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_RunFile_Action=Run File")
@ActionID(id = "org.netbeans.modules.groovy.support.GroovyProjectModule.run", category = "Groovy")
@ActionRegistration(lazy = false, displayName = "#LBL_RunFile_Action")
@ActionReferences(value = {
    @ActionReference(path = "Loaders/text/x-groovy/Actions", position = 560),
    @ActionReference(path = "Editors/text/x-groovy/Popup", position = 810, separatorBefore = 800)
})
public static Action run() {
    return FileSensitiveActions.fileCommandAction(
            ActionProvider.COMMAND_RUN_SINGLE,
            LBL_RunFile_Action(),
            null);
}
 
Example #16
Source File: ProfilerSessions.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
@ActionID(category="Profile", id="org.graalvm.visualvm.lib.profiler.v2.ProfilerSessions.StopAction") // NOI18N
@ActionRegistration(displayName="#LBL_StopAction", lazy=false) // NOI18N
@ActionReferences({
    @ActionReference(path="Menu/Profile", position=300, separatorAfter=400), // NOI18N
    @ActionReference(path="Shortcuts", name="S-F2") // NOI18N
})
public static StopAction getInstance() { return Singleton.INSTANCE; }
 
Example #17
Source File: GroovyActionsRegistration.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_CompileFile_Action=Compile File")
@ActionID(id = "org.netbeans.modules.groovy.support.GroovyProjectModule.compile", category = "Groovy")
@ActionRegistration(lazy = false, displayName = "#LBL_CompileFile_Action")
@ActionReference(path = "Loaders/text/x-groovy/Actions", position = 550)
public static Action compile() {
    return FileSensitiveActions.fileCommandAction(
            ActionProvider.COMMAND_COMPILE_SINGLE,
            LBL_CompileFile_Action(),
            null);
}
 
Example #18
Source File: SelectNodeAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.project.ui.SelectInFiles", category = "Window/SelectDocumentNode")
@ActionRegistration(displayName = "#LBL_SelectInFilesAction_MainMenuName", lazy=false)
@ActionReferences({
    @ActionReference(path = "Shortcuts", name = "DS-2"),
    @ActionReference(path = "Menu/GoTo", position = 2700)
})
@Messages("LBL_SelectInFilesAction_MainMenuName=Sele&ct in Files")
public static SelectNodeAction inFiles() {
    return new SelectNodeAction(SELECT_IN_FILES_ICON, LBL_SelectInFilesAction_MainMenuName(), ProjectTab.ID_PHYSICAL, null);
}
 
Example #19
Source File: TakeSnapshotAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.profiler.actions.TakeSnapshotAction", category = "Profile")
@ActionRegistration(displayName = "#LBL_TakeSnapshotAction")
@ActionReferences(value = {
    @ActionReference(path = "Shortcuts", name = "A-F2"),
    @ActionReference(path = "Menu/Profile", position = 900)})
public static TakeSnapshotAction getInstance() {
    return Singleton.INSTANCE;
}
 
Example #20
Source File: TakeThreadDumpAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.profiler.actions.TakeThreadDumpAction", category = "Profile")
@ActionRegistration(displayName = "#LBL_TakeThreadDumpAction")
@ActionReferences(value = {
    //        @ActionReference(path = "Shortcuts", name = "C-F3"),
    @ActionReference(path = "Menu/Profile", position = 500)})
public static TakeThreadDumpAction getInstance() {
    return Singleton.INSTANCE;
}
 
Example #21
Source File: ProfilerSessions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(category="Profile", id="org.netbeans.modules.profiler.v2.ProfilerSessions.StopAction") // NOI18N
@ActionRegistration(displayName="#LBL_StopAction", lazy=false) // NOI18N
@ActionReferences({
    @ActionReference(path="Menu/Profile", position=300, separatorAfter=400), // NOI18N
    @ActionReference(path="Shortcuts", name="S-F2") // NOI18N
})
public static StopAction getInstance() { return Singleton.INSTANCE; }
 
Example #22
Source File: TakeThreadDumpAction.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
@ActionID(id = "org.graalvm.visualvm.lib.profiler.actions.TakeThreadDumpAction", category = "Profile")
@ActionRegistration(displayName = "#LBL_TakeThreadDumpAction")
@ActionReferences(value = {
    //        @ActionReference(path = "Shortcuts", name = "C-F3"),
    @ActionReference(path = "Menu/Profile", position = 500)})
public static TakeThreadDumpAction getInstance() {
    return Singleton.INSTANCE;
}
 
Example #23
Source File: AntActions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_ProfileTest=Prof&ile Test File")
@ActionID(category = "Profile", id = "org.netbeans.modules.profiler.actions.ProfileTest")
@ActionRegistration(displayName = "#LBL_ProfileTest", lazy=false)
@ActionReferences(value = {
    @ActionReference(path = "Loaders/text/x-java/Actions", position = 1280),
    @ActionReference(path = "Menu/Profile", position = 120)})
public static Action profileTest() {
    return FileSensitiveActions.fileSensitiveAction(
            new FileSensitivePerformer(ActionProvider.COMMAND_PROFILE_TEST_SINGLE), 
            Bundle.LBL_ProfileTest(),
            null);
}
 
Example #24
Source File: TakeSnapshotAction.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
@ActionID(id = "org.graalvm.visualvm.lib.profiler.actions.TakeSnapshotAction", category = "Profile")
@ActionRegistration(displayName = "#LBL_TakeSnapshotAction")
@ActionReferences(value = {
    @ActionReference(path = "Shortcuts", name = "A-F2"),
    @ActionReference(path = "Menu/Profile", position = 900)})
public static TakeSnapshotAction getInstance() {
    return Singleton.INSTANCE;
}
 
Example #25
Source File: AntActions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.suite.ProfileOsgi")
@ActionRegistration(displayName="#SUITE_ACTION_profile_osgi", asynchronous=true)
@ActionReference(path="Projects/org-netbeans-modules-apisupport-project-suite-osgi/Actions", position=500)
@NbBundle.Messages("SUITE_ACTION_profile_osgi=Profile in Felix")
public static Action profileOsgi() {
    Action delegate = ProjectSensitiveActions.projectSensitiveAction(
            ProjectSensitivePerformer.profileProject("profile-osgi"), 
            Bundle.SUITE_ACTION_profile_osgi(), 
            null
    );
    
    return delegate;
}
 
Example #26
Source File: ResetResultsAction.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
@ActionID(category="Profile", id="org.graalvm.visualvm.lib.profiler.actions.ResetResultsAction")
@ActionRegistration(displayName="#LBL_ResetResultsAction", lazy=false)
@ActionReferences({
    @ActionReference(path="Menu/Profile", position=1000, separatorAfter=1100),
    @ActionReference(path = "Shortcuts", name = "AS-F2")
})
public static ResetResultsAction getInstance() {
    return Singleton.INSTANCE;
}
 
Example #27
Source File: InsertProfilingPointMenuAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.profiler.actions.InsertProfilingPointMenuAction", category = "Profile")
@ActionRegistration(displayName = "#LBL_InsertProfilingPointMenuAction")
@ActionReferences(value = {
    @ActionReference(path = "Menu/Profile", position = 1200)})
public static InsertProfilingPointMenuAction getInstance() {
    return Singleton.INSTANCE;
}
 
Example #28
Source File: NbmActionGoalProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.maven.apisupport.NBMReloadTarget", category = "Project")
@ActionRegistration(displayName = "#ACT_NBM_Reload_Target", lazy=false)
@ActionReference(position = 1225, path = "Projects/org-netbeans-modules-maven/Actions")
@Messages("ACT_NBM_Reload_Target=Reload in Target Platform")
public static Action createReloadTargetAction() {
    Action a = ProjectSensitiveActions.projectCommandAction(RELOAD_TARGET, ACT_NBM_Reload_Target(), null);
    a.putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);
    return a;
}
 
Example #29
Source File: NbmActionGoalProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(id = "org.netbeans.modules.maven.apisupport.NBMReload", category = "Project")
@ActionRegistration(displayName = "#ACT_NBM_Reload", lazy=false)
@ActionReference(position = 1250, path = "Projects/org-netbeans-modules-maven/Actions")
@Messages("ACT_NBM_Reload=Install/Reload in Development IDE")
public static Action createReloadAction() {
    Action a = ProjectSensitiveActions.projectCommandAction(NBMRELOAD, ACT_NBM_Reload(), null);
    a.putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);
    return a;
}
 
Example #30
Source File: ResetResultsAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(category="Profile", id="org.netbeans.modules.profiler.actions.ResetResultsAction")
@ActionRegistration(displayName="#LBL_ResetResultsAction", lazy=false)
@ActionReferences({
    @ActionReference(path="Menu/Profile", position=1000, separatorAfter=1100),
    @ActionReference(path = "Shortcuts", name = "AS-F2")
})
public static ResetResultsAction getInstance() {
    return Singleton.INSTANCE;
}