Package org.openide.util

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


        super();
        this.MIME_TYPE = mimetype;
        if (MIME_TYPE.equals("text/x-clojure"))
        {
            Lookup l =  MimeLookup.getLookup(MimePath.get ("text/x-clojure"));
            Preferences p = l.lookup(Preferences.class);
            p.put(SimpleValueNames.CODE_FOLDING_ENABLE,Boolean.TRUE.toString());
        }
    }
   
    @Override
View Full Code Here


        initComponents();
        setName(getBundleProperty("CTL_ReplTopComponent", _projectName));
        setToolTipText(getBundleProperty("HINT_ReplTopComponent", _projectName));
        setIcon(ImageUtilities.loadImage(ICON_PATH, true));
        Lookup l =  MimeLookup.getLookup(MimePath.get ("text/x-clojure"));
        Preferences p = l.lookup(Preferences.class);
        p.put(SimpleValueNames.CODE_FOLDING_ENABLE,"true");
        //Create project repl
        this._replPanel = replPanel;//??new ReplPanel(special);
        //??_replPanel.setName("replPanel" + projectName);
        jScrollPane1.setViewportView(_replPanel);
View Full Code Here

     *
     * @return
     */
    private DataObject getDataObject() {
        Lookup context = Utilities.actionsGlobalContext();
        return context.lookup(DataObject.class);
    }

    /**
     * Check whether action is available with editor.
     *
 
View Full Code Here

     *
     * @return
     */
    private boolean isAvailableWithEditor() {
        Lookup context = Utilities.actionsGlobalContext();
        EditorCookie ec = context.lookup(EditorCookie.class);
        StyledDocument document = ec.getDocument();
        return document != null;
    }

    //~ inner class
View Full Code Here

    }

    @Test
    public void testSourcesMerger() {
        Lookup lookup = rootProject.getLookup();
        Sources sources = lookup.lookup(Sources.class);
        assertNotNull("sources", sources);

        SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
        SourceGroup foundGroup = findGroupByName(CustomSourcesMergerExtDef.TEST_SRC_GROUP_NAME, groups);
        assertNotNull("Must have the source groups merged.", foundGroup);
View Full Code Here

            public void run() {
                LogicalViewProvider view = project.getLookup().lookup(LogicalViewProvider.class);
                Node root = view.createLogicalView();

                Lookup children = Lookups.fixed((Object[])root.getChildren().getNodes());
                JavaDependenciesNode dependenciesNode = children.lookup(JavaDependenciesNode.class);
                BuildScriptsNode buildScriptsNode = children.lookup(BuildScriptsNode.class);

                assertNotNull("Must have a dependencies node", dependenciesNode);
                assertNotNull("Must have a build scripts node", buildScriptsNode);
            }
View Full Code Here

                LogicalViewProvider view = project.getLookup().lookup(LogicalViewProvider.class);
                Node root = view.createLogicalView();

                Lookup children = Lookups.fixed((Object[])root.getChildren().getNodes());
                JavaDependenciesNode dependenciesNode = children.lookup(JavaDependenciesNode.class);
                BuildScriptsNode buildScriptsNode = children.lookup(BuildScriptsNode.class);

                assertNotNull("Must have a dependencies node", dependenciesNode);
                assertNotNull("Must have a build scripts node", buildScriptsNode);
            }
        });
View Full Code Here

            };
        }

        final Lookup appliedContext = getAppliedContext(command, context);

        NbGradleConfiguration config = appliedContext.lookup(NbGradleConfiguration.class);
        final NbGradleConfiguration appliedConfig = config != null
                ? config
                : project.getCurrentProfile();

        final AtomicReference<CustomCommandActions> customActionsRef
View Full Code Here

            LOGGER.log(Level.WARNING, "Not found wp-config.php");
            return;
        }
        try {
            Lookup lookup = config.getLookup();
            EditorCookie ec = lookup.lookup(EditorCookie.class);
            if (ec == null) {
                return;
            }
            final StyledDocument docment = ec.openDocument();
            if (docment == null) {
View Full Code Here

                if (fo != null) {
                    DataObject dobj = DataObject.find(fo);
                    FolderLookup actionRegistry = new FolderLookup((DataFolder)dobj);
                    Lookup.Template query = new Lookup.Template(Object.class);
                    Lookup lookup = actionRegistry.getLookup();
                    Iterator it = lookup.lookup(query).allInstances().iterator();
                    if (it.hasNext()) {
                        nodeActions.add(null);
                    }
                    while (it.hasNext()) {
                        Object next = it.next();
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.