Package com.intellij.openapi.roots

Examples of com.intellij.openapi.roots.LibraryOrderEntry


            log.info("Checking Module: " + module.getName());
            ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
            OrderEntry[] entries = rootManager.getOrderEntries();
            for (OrderEntry entry : entries) {
                if (entry instanceof LibraryOrderEntry) {
                    final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry;
                    final Library library = libraryEntry.getLibrary();
//                    log.debug("\tEntry: " + libraryEntry.getPresentableName());
                    String[] sourceUrls = entry.getUrls(OrderRootType.SOURCES);
                    String alfrescoJarUrl = null;
                    String alfrescoJavaJarUrl = null;
                    for (String url : sourceUrls) {
//                        log.debug("\t\tURL: " + url);
                        if (alfrescoJar.matcher(url).matches())
                            alfrescoJarUrl = url;
                        if (alfrescoJavaJar.matcher(url).matches())
                            alfrescoJavaJarUrl = url;
                    }
                    if (null != alfrescoJarUrl) {
                        final String finalAlfrescoJarUrl = alfrescoJarUrl;
                        final String finalAlfrescoJavaJarUrl = alfrescoJavaJarUrl;
                        ApplicationManager.getApplication().runWriteAction(new Runnable() {
                            @Override
                            public void run() {
                                Library.ModifiableModel modifiableModel = null;
                                if (library != null) {
                                    log.info("Updating sources for: " + libraryEntry.getPresentableName());
                                    modifiableModel = library.getModifiableModel();
                                    // TODO: Need to be smarter about this, may need to handle multiple
                                    if (null != finalAlfrescoJavaJarUrl)
                                        modifiableModel.removeRoot(finalAlfrescoJavaJarUrl, OrderRootType.SOURCES);
                                    modifiableModel.addRoot(finalAlfrescoJarUrl + "java", OrderRootType.SOURCES);
View Full Code Here

TOP

Related Classes of com.intellij.openapi.roots.LibraryOrderEntry

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.