Package org.netbeans.spi.project

Examples of org.netbeans.spi.project.SingleMethod


    }

    @Override public Map<String,String> createReplacements(String action, Lookup lookup) {
        FileObject f = lookup.lookup(FileObject.class);
        if (f == null) {
            SingleMethod m = lookup.lookup(SingleMethod.class);
            if (m != null) {
                f = m.getFile();
            }
        }
        if (f != null && "text/x-scala".equals(f.getMIMEType())) {
            for (SourceGroup g : ProjectUtils.getSources(project).getSourceGroups(ScalaSourcesImpl.TYPE_SCALA)) {
                String relPath = FileUtil.getRelativePath(g.getRootFolder(), f);
View Full Code Here


    }

    private static List<FileObject> getFilesOfContext(Lookup context) {
        List<FileObject> files = new LinkedList<>();

        SingleMethod method = context.lookup(SingleMethod.class);
        if (method != null) {
            files.add(method.getFile());
        }

        for (DataObject dataObj: context.lookupAll(DataObject.class)) {
            FileObject file = dataObj.getPrimaryFile();
            if (file != null) {
View Full Code Here

                files.add(d.getPrimaryFile());
            }
        }
        Collection<? extends SingleMethod> methods = lookup.lookupAll(SingleMethod.class);
        if (methods.size() == 1) {
            SingleMethod method = methods.iterator().next();
            files.add(method.getFile());
        }

        return files.toArray(new FileObject[files.size()]);
    }
View Full Code Here

TOP

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

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.