protected Object[] getChildren(Object parent) {
   if (parent instanceof PDEFormPage) {
     PDEFormPage page = (PDEFormPage) parent;
     ISiteModel model = (ISiteModel) page.getModel();
     if (model.isValid()) {
       ISite site = model.getSite();
       if (page.getId().equals(FeaturesPage.PAGE_ID)) {
         ArrayList<IWritable> result = new ArrayList<IWritable>();
         ISiteCategoryDefinition[] catDefs = site.getCategoryDefinitions();
         for (int i = 0; i < catDefs.length; i++) {
           result.add(catDefs[i]);
         }
         ISiteFeature[] features = site.getFeatures();
         for (int i = 0; i < features.length; i++) {
           if (features[i].getCategories().length == 0)
             result.add(new SiteFeatureAdapter(null, features[i]));
         }
         return result.toArray();
       }
       if (page.getId().equals(ArchivePage.PAGE_ID)) return site.getArchives();
     }
   }
   if (parent instanceof ISiteCategoryDefinition) {
     ISiteCategoryDefinition catDef = (ISiteCategoryDefinition) parent;
     ISiteModel model = catDef.getModel();
     if (model.isValid()) {
       ISite site = model.getSite();
       ISiteFeature[] features = site.getFeatures();
       HashSet<SiteFeatureAdapter> result = new HashSet<SiteFeatureAdapter>();
       for (int i = 0; i < features.length; i++) {
         ISiteCategory[] cats = features[i].getCategories();
         for (int j = 0; j < cats.length; j++) {
           if (cats[j].getDefinition() != null && cats[j].getDefinition().equals(catDef)) {
             result.add(new SiteFeatureAdapter(cats[j].getName(), features[i]));
           }
         }
       }
       return result.toArray();
     }
   }
   return new Object[0];
 }
Example #2
0
  protected void createFormContent(IManagedForm mform) {
    super.createFormContent(mform);
    ScrolledForm form = mform.getForm();
    form.getBody().setLayout(FormLayoutFactory.createFormGridLayout(false, 1));

    fDescSection = new DescriptionSection(this, form.getBody());
    fArchiveSection = new ArchiveSection(this, form.getBody());
    fMirrorsSection = new MirrorsSection(this, form.getBody());

    mform.addPart(fDescSection);
    mform.addPart(fMirrorsSection);
    mform.addPart(fArchiveSection);

    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(form.getBody(), IHelpContextIds.MANIFEST_SITE_ARCHIVES);
    form.setText(PDEUIMessages.ArchivePage_title);
    form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_JAVA_LIB_OBJ));
  }
 /**
  * @param page
  * @param parent
  * @param style
  */
 public LinkSection(PDEFormPage page, Composite parent, int style) {
   super(page, parent, style);
   FormToolkit toolkit = page.getManagedForm().getToolkit();
   linkHandler = new LinkHandler();
   createClient(getSection(), toolkit);
 }
 public SplashConfigurationSection(PDEFormPage page, Composite parent) {
   super(page, parent, Section.DESCRIPTION);
   fFieldTemplateCombo = null;
   fControlDecoration = null;
   createClient(getSection(), page.getEditor().getToolkit());
 }
Example #5
0
 public GeneralInfoSection(PDEFormPage page, Composite parent) {
   super(page, parent, Section.DESCRIPTION);
   createClient(getSection(), page.getEditor().getToolkit());
 }
 public IncludedFeaturesPortabilitySection(
     PDEFormPage page, Composite parent, String title, String desc, int toggleStyle) {
   super(page, parent, Section.DESCRIPTION | ExpandableComposite.NO_TITLE | toggleStyle, false);
   getSection().setDescription(desc);
   createClient(getSection(), page.getManagedForm().getToolkit());
 }