コード例 #1
0
 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];
 }
コード例 #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));
  }
コード例 #3
0
 public SplashConfigurationSection(PDEFormPage page, Composite parent) {
   super(page, parent, Section.DESCRIPTION);
   fFieldTemplateCombo = null;
   fControlDecoration = null;
   createClient(getSection(), page.getEditor().getToolkit());
 }
コード例 #4
0
 public GeneralInfoSection(PDEFormPage page, Composite parent) {
   super(page, parent, Section.DESCRIPTION);
   createClient(getSection(), page.getEditor().getToolkit());
 }
コード例 #5
0
 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());
 }