Package org.netbeans.spi.project

Examples of org.netbeans.spi.project.ActionProvider


                    if (!COMPILE_ON_SAVE_MODEL.isSelected()) {
                        FileObject buildClasses = updateHelper.getAntProjectHelper().resolveFileObject(evaluator.getProperty(ProjectProperties.BUILD_CLASSES_DIR));
                        if (buildClasses != null) {
                            FileObject mark = buildClasses.getFileObject(COS_MARK);
                            if (mark != null) {
                                final ActionProvider ap = project.getLookup().lookup(ActionProvider.class);
                                assert ap != null;
                                ap.invokeAction(ActionProvider.COMMAND_CLEAN, Lookups.fixed(project));
                            }
                        }
                    }
                    return null;
                }
View Full Code Here


    private boolean shouldBeEnabled () {
       
        // check if current project supports this action
        Project p = MainProjectManager.getDefault ().getMainProject ();
        if (p == null) return false;
        ActionProvider actionProvider = (ActionProvider) p.getLookup ().
            lookup (ActionProvider.class);
        if (actionProvider == null) return false;
        String[] sa = actionProvider.getSupportedActions ();
        int i, k = sa.length;
        for (i = 0; i < k; i++)
            if (ActionProvider.COMMAND_DEBUG_STEP_INTO.equals (sa [i]))
                break;
        if (i == k) return false;
       
        if (DebuggerManager.getDebuggerManager().getDebuggerEngines().length > 0) {
            // Do not enable this non-contextual action when some debugging session is already running.
            return false;
        }
        // check if this action should be enabled
        return actionProvider.isActionEnabled (
            ActionProvider.COMMAND_DEBUG_STEP_INTO,
            MainProjectManager.getDefault ().getMainProject ().getLookup ()
        );
    }
View Full Code Here

        // check if current debugger supports this action
        if (!debugger.canFixClasses()) return false;
        // check if current project supports this action
        Project p = getCurrentProject();
        if (p == null) return false;
        ActionProvider actionProvider = (ActionProvider) p.getLookup ().
            lookup (ActionProvider.class);
        if (actionProvider == null) return false;
        String[] sa = actionProvider.getSupportedActions ();
        int i, k = sa.length;
        for (i = 0; i < k; i++)
            if (JavaProjectConstants.COMMAND_DEBUG_FIX.equals (sa [i]))
                break;
        if (i == k) return false;
View Full Code Here

        if (!editor.getCurrentURL ().endsWith (".scala")) return false;
       
        // check if current project supports this action
        Project p = MainProjectManager.getDefault ().getMainProject ();
        if (p == null) return false;
        ActionProvider actionProvider = (ActionProvider) p.getLookup ().
            lookup (ActionProvider.class);
        if (actionProvider == null) return false;
        String[] sa = actionProvider.getSupportedActions ();
        int i, k = sa.length;
        for (i = 0; i < k; i++)
            if (ActionProvider.COMMAND_DEBUG.equals (sa [i]))
                break;
        if (i == k) return false;
View Full Code Here

        }
       
        // check if current project supports this action
        Project p = MainProjectManager.getDefault ().getMainProject ();
        if (p == null) return false;
        ActionProvider actionProvider = (ActionProvider)p.getLookup ().lookup (ActionProvider.class);
        if (actionProvider == null) return false;

        String[] sa = actionProvider.getSupportedActions ();
        int i, k = sa.length;
        for (i = 0; i < k; i++) {
            if (ActionProvider.COMMAND_DEBUG.equals (sa [i])) {
                break;
            }
View Full Code Here

    @Test
    public void testSingleCommandsEnabledForJava() throws Exception {
        NbGradleProject project = rootProject;

        ActionProvider actionProvider = project.getLookup().lookup(ActionProvider.class);
        Set<String> supportedActions = new HashSet<>(Arrays.asList(actionProvider.getSupportedActions()));

        FileObject javaFile = project.getProjectDirectory().getFileObject(
                "src/main/java/org/netbeans/gradle/Sample.java");
        for (String command: getSingleCommands()) {
            Lookup lookup = Lookups.fixed(javaFile);
            boolean actionEnabled = actionProvider.isActionEnabled(command, lookup);
            assertTrue(actionEnabled);
            assertTrue(supportedActions.contains(command));
        }
    }
View Full Code Here

    @Test
    public void testSingleCommandsEnabledForJava() throws Exception {
        NbGradleProject project = rootProject;

        ActionProvider actionProvider = project.getLookup().lookup(ActionProvider.class);
        Set<String> supportedActions = new HashSet<>(Arrays.asList(actionProvider.getSupportedActions()));

        FileObject javaFile = project.getProjectDirectory().getFileObject(
                "src/main/java/org/netbeans/gradle/Sample.java");
        for (String command: getSingleCommands()) {
            Lookup lookup = Lookups.fixed(javaFile);
            boolean actionEnabled = actionProvider.isActionEnabled(command, lookup);
            assertTrue(actionEnabled);
            assertTrue(supportedActions.contains(command));
        }
    }
View Full Code Here

TOP

Related Classes of org.netbeans.spi.project.ActionProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.