コード例 #1
0
 /**
  * Retrieves all bundles (source and code) in the given target definition returning them as a set
  * of URLs.
  *
  * @param target target definition
  * @return all bundle URLs
  */
 protected Set getAllBundleURLs(ITargetDefinition target) throws Exception {
   if (!target.isResolved()) {
     target.resolve(null);
   }
   TargetBundle[] bundles = target.getBundles();
   Set urls = new HashSet(bundles.length);
   for (int i = 0; i < bundles.length; i++) {
     urls.add(new File(bundles[i].getBundleInfo().getLocation()).toURL());
   }
   return urls;
 }
コード例 #2
0
  /**
   * Set the container to display in the tree or <code>null</code> to disable the tree
   *
   * @param input bundle container or <code>null</code>
   */
  public void setInput(ITargetDefinition input) {
    fTargetDefinition = input;

    // Update the cached data
    fFileBundleMapping = null;
    fAllBundles.clear();

    if (input == null || !input.isResolved()) {
      fTree.setInput(Messages.TargetContentsGroup_10);
      setEnabled(false);
      return;
    }

    IResolvedBundle[] allResolvedBundles = input.getAllBundles();
    if (allResolvedBundles == null || allResolvedBundles.length == 0) {
      fTree.setInput(Messages.TargetContentsGroup_11);
      setEnabled(false);
      return;
    }

    for (int i = 0; i < allResolvedBundles.length; i++) {
      fAllBundles.add(allResolvedBundles[i]);
    }

    boolean isFeatureMode =
        ((TargetDefinition) fTargetDefinition).getUIMode() == TargetDefinition.MODE_FEATURE;
    fFeaureModeButton.setSelection(isFeatureMode);
    fPluginModeButton.setSelection(!isFeatureMode);
    fGroupLabel.setEnabled(!isFeatureMode);

    fTree.getControl().setRedraw(false);
    fTree.setInput(fTargetDefinition);
    fTree.expandAll();
    updateCheckState();
    updateButtons();
    setEnabled(true);
    fTree.getControl().setRedraw(true);
  }