コード例 #1
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
   */
  public void start(BundleContext bundleContext) throws Exception {
    super.start(bundleContext);

    plugin = this;
    ProvUIActivator.context = bundleContext;
    packageAdminRef = bundleContext.getServiceReference(PackageAdmin.class.getName());
    packageAdmin = (PackageAdmin) bundleContext.getService(packageAdminRef);
  }
コード例 #2
0
 public static boolean matchesCurrentEnvironment(IMonitorModelBase model) {
   BundleContext context = MDECore.getDefault().getBundleContext();
   Dictionary environment = getTargetEnvironment();
   BundleDescription bundle = model.getBundleDescription();
   String filterSpec = bundle != null ? bundle.getPlatformFilter() : null;
   try {
     return filterSpec == null || context.createFilter(filterSpec).match(environment);
   } catch (InvalidSyntaxException e) {
     return false;
   }
 }