Package org.openide.util

Examples of org.openide.util.Lookup.lookupAll()


        fullScreenButton.setPreferredSize(new Dimension(logoWidth, logoHeight));
        fullScreenButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                Lookup lookup = Lookups.forPath("org-gephi-desktop-tools/Actions/ToggleFullScreenAction");
                for (Action a : lookup.lookupAll(Action.class)) {
                    a.actionPerformed(null);
                }
            }
        });
        c.add(fullScreenButton, BorderLayout.CENTER);
View Full Code Here


    }

    private static ExtensionActions getActionsOfExtension(NbGradleExtensionRef extension) {
        Lookup extensionLookup = extension.getExtensionLookup();
        Collection<? extends GradleProjectContextActions> actionQueries
                = extensionLookup.lookupAll(GradleProjectContextActions.class);

        ExtensionActions result = new ExtensionActions();
        for (GradleProjectContextActions actionQuery: actionQueries) {
            result.addAllActions(trimNulls(actionQuery.getContextActions()));
        }
View Full Code Here

                // using the ServiceProviders annotation. Our implementation is
                // GradleFileOwnerQuery and is added using the annotation.
            });

            if (defaultLookupRef.compareAndSet(null, newLookup)) {
                for (ProjectInitListener listener: newLookup.lookupAll(ProjectInitListener.class)) {
                    listener.onInitProject();
                }
            }
            result = defaultLookupRef.get();
        }
View Full Code Here

            }
            else {
                lookup = activate();
            }

            for (ClassPathProvider otherProvider: lookup.lookupAll(ClassPathProvider.class)) {
                ClassPath result = otherProvider.findClassPath(file, type);
                if (result != null) {
                    return result;
                }
            }
View Full Code Here

    @SuppressWarnings("deprecation")
    public static List<NbGradleExtensionRef> loadExtensions(NbGradleProject project) throws IOException {
        Lookup defaultLookup = Lookup.getDefault();

        Collection<? extends org.netbeans.gradle.project.api.entry.GradleProjectExtensionQuery> defs1
                = defaultLookup.lookupAll(org.netbeans.gradle.project.api.entry.GradleProjectExtensionQuery.class);

        Collection<? extends GradleProjectExtensionDef<?>> defs2
                = defaultLookup.lookupAll(defClass());

        int expectedExtensionCount = defs1.size() + defs2.size();
View Full Code Here

        Collection<? extends org.netbeans.gradle.project.api.entry.GradleProjectExtensionQuery> defs1
                = defaultLookup.lookupAll(org.netbeans.gradle.project.api.entry.GradleProjectExtensionQuery.class);

        Collection<? extends GradleProjectExtensionDef<?>> defs2
                = defaultLookup.lookupAll(defClass());

        int expectedExtensionCount = defs1.size() + defs2.size();
        List<NbGradleExtensionRef> result = new ArrayList<>(expectedExtensionCount);

        Set<String> alreadyLoaded = CollectionUtils.newHashSet(expectedExtensionCount);
View Full Code Here

        return false;
    }

    private static boolean tryInvokeAction(Project project, String command, Lookup context) {
        Lookup projectLookup = project.getLookup();
        for (ActionProvider actionProvider: projectLookup.lookupAll(ActionProvider.class)) {
            if (supportsAction(actionProvider, command)) {
                actionProvider.invokeAction(command, context);
                return true;
            }
        }
View Full Code Here

        fullScreenButton.setPreferredSize(new Dimension(logoWidth, logoHeight));
        fullScreenButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                Lookup lookup = Lookups.forPath("org-gephi-desktop-tools/Actions/ToggleFullScreenAction");
                for (Action a : lookup.lookupAll(Action.class)) {
                    a.actionPerformed(null);
                }
            }
        });
        c.add(fullScreenButton, BorderLayout.CENTER);
View Full Code Here

    // see http://netbeans-org.1045718.n5.nabble.com/Lookup-current-active-Project-td3036983.html
    public Project getCurrentProject() {

        Lookup lookup = Utilities.actionsGlobalContext();

        for (Project p : lookup.lookupAll(Project.class)) {
            return p;
        }

        for (DataObject dObj : lookup.lookupAll(DataObject.class)) {
            FileObject fObj = dObj.getPrimaryFile();
View Full Code Here

        for (Project p : lookup.lookupAll(Project.class)) {
            return p;
        }

        for (DataObject dObj : lookup.lookupAll(DataObject.class)) {
            FileObject fObj = dObj.getPrimaryFile();
            Project p = FileOwnerQuery.getOwner(fObj);
            if (p != null) {
                return p;
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.