org.openide.awt.ActionID Java Examples

The following examples show how to use org.openide.awt.ActionID. 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: DesignView.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@ActionID(category = "System", id = "org.netbeans.core.windows.model.NewMode")
@ActionRegistration(iconBase = "org/netbeans/core/windows/design/DesignView.png",
displayName = "#CTL_NewMode")
@Messages("CTL_NewMode=New Mode")
public static ActionListener newModeAction() {
    return new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            DesignViewComponent dvc = new DesignViewComponent();
            /*
            WindowManagerImpl wmi = (WindowManagerImpl)WindowManager.getDefault();
            Mode m = wmi.createMode("mode_" + (++designModeCounter),
                Constants.MODE_KIND_VIEW, Constants.MODE_KIND_VIEW, true,
                new SplitConstraint[]{new SplitConstraint(Constants.HORIZONTAL, 1, 0.2)}
            );
            m.dockInto(dvc);
             */
            dvc.open();
            dvc.requestAttention(true);
        }
    };
}
 
Example #8
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 #9
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 #10
Source File: GroovyActionsRegistration.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_TestProject_Action=Test")
@ActionID(id = "org.netbeans.modules.groovy.support.GroovyProjectModule.test.project", category = "Groovy")
@ActionRegistration(lazy = false, displayName = "#LBL_TestProject_Action")
public static Action testProject() {
    return ProjectSensitiveActions.projectCommandAction(
            ActionProvider.COMMAND_TEST,
            LBL_TestProject_Action(),
            null);
}
 
Example #11
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 #12
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 #13
Source File: GroovyActionsRegistration.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_TestFile_Action=Test File")
@ActionID(id = "org.netbeans.modules.groovy.support.GroovyProjectModule.test", category = "Groovy")
@ActionRegistration(lazy = false, displayName = "#LBL_TestFile_Action")
@ActionReferences(value = {
    @ActionReference(path = "Loaders/text/x-groovy/Actions", position = 580),
    @ActionReference(path = "Editors/text/x-groovy/Popup", position = 830)
})
public static Action test() {
    return FileSensitiveActions.fileCommandAction(
            ActionProvider.COMMAND_TEST_SINGLE,
            LBL_TestFile_Action(),
            null);
}
 
Example #14
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 #15
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 #16
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 #17
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 #18
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 #19
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 #20
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 #21
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 #22
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 #23
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 #24
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 #25
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 #26
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 #27
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 #28
Source File: ModuleActions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.createNbm")
@ActionRegistration(displayName="#ACTION_nbm", lazy=false)
@ActionReference(path=MODULE_ACTIONS_PATH, position=1600)
@Messages("ACTION_nbm=Create NBM")
public static Action createNbm() {
    return ProjectSensitiveActions.projectCommandAction(COMMAND_NBM, ACTION_nbm(), null);
}
 
Example #29
Source File: ModuleActions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.reloadInIde")
@ActionRegistration(displayName="#ACTION_reload_in_ide", lazy=false)
@ActionReference(path=MODULE_ACTIONS_PATH, position=1500)
@Messages("ACTION_reload_in_ide=Install/Reload in Development IDE")
public static Action reloadInIde() {
    return reload(true);
}
 
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;
}