Package org.osmorc

Examples of org.osmorc.BundleManager


      return null;
    }

    // obtaining export name of the package from a providing manifest
    String exportedPackage = null;
    BundleManager bundleManager = BundleManager.getInstance(targetClass.getProject());
    ModuleFileIndex index = ModuleRootManager.getInstance(requestorModule).getFileIndex();
    List<OrderEntry> entries = index.getOrderEntriesForFile(targetFile.getVirtualFile());
    OrderEntry entry = !entries.isEmpty() ? entries.get(0) : null;
    if (entry instanceof ModuleOrderEntry) {
      Module module = ((ModuleOrderEntry)entry).getModule();
      if (module != null) {
        BundleManifest manifest = bundleManager.getManifestByObject(module);
        exportedPackage = manifest != null ? manifest.getExportedPackage(packageName) : null;
      }
    }
    else if (entry instanceof LibraryOrderEntry) {
      Library library = ((LibraryOrderEntry)entry).getLibrary();
      if (library != null) {
        BundleManifest manifest = bundleManager.getManifestByObject(library);
        exportedPackage = manifest != null ? manifest.getExportedPackage(packageName) : null;
      }
    }
    else if (entry instanceof JdkOrderEntry) {
      exportedPackage = packageName;
    }
    if (exportedPackage == null) {
      return NOT_EXPORTED;
    }

    if (!facet.getConfiguration().isManifestManuallyEdited()) {
      return null;
    }

    BundleManifest manifest = bundleManager.getManifestByObject(requestorModule);
    if (manifest != null) {
      // Imported packages
      if (manifest.isPackageImported(packageName)) {
        return null;
      }

      // Required bundles
      for (String bundleSpec : manifest.getRequiredBundles()) {
        BundleManifest bundle = bundleManager.getManifestByBundleSpec(bundleSpec);
        if (bundle != null && bundle.getExportedPackage(packageName) != null) {
          return null;
        }
      }
View Full Code Here

TOP

Related Classes of org.osmorc.BundleManager

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.