protected Composite createMaxOccurComp(Composite parent, FormToolkit toolkit) {
    fMaxLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_maxOccurLabel);
    fMaxLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
    Composite comp = toolkit.createComposite(parent);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    GridLayout layout = new GridLayout(3, false);
    layout.marginHeight = layout.marginWidth = 0;
    comp.setLayout(layout);
    comp.setLayoutData(gd);

    fMaxOccurSpinner = new Spinner(comp, SWT.BORDER);
    fMaxOccurSpinner.setMinimum(1);
    fMaxOccurSpinner.setMaximum(999);
    fMaxOccurSpinner.setIncrement(1);

    fUnboundSelect =
        toolkit.createButton(comp, PDEUIMessages.AbstractSchemaDetails_unboundedButton, SWT.CHECK);
    gd = new GridData();
    gd.horizontalIndent = 10;
    fUnboundSelect.setLayoutData(gd);
    fUnboundSelect.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (blockListeners()) return;
            fMaxOccurSpinner.setEnabled(!fUnboundSelect.getSelection() && isEditableElement());
          }
        });

    return comp;
  }
  @Override
  public final void createContents(Composite parent) {
    // This is a hacked fix to ensure that the label columns on every details
    // page have the same width. SchemaDetails_translatable plus 11 pixels
    // represents the longest label on any field on any details page. This
    // occurs on SchemaStringAttributeDetails and 11 is the size of the
    // horizontal indent that contributes to the label's width.
    GC gc = new GC(parent);
    minLabelWeight = gc.textExtent(PDEUIMessages.SchemaDetails_translatable).x + 11;
    gc.dispose();
    gc = null;

    parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1));
    FormToolkit toolkit = getManagedForm().getToolkit();
    fSection = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR);
    fSection.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING;
    fSection.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));

    GridData gd;
    if (fShowDescription) gd = new GridData(GridData.FILL_BOTH);
    else gd = new GridData(GridData.FILL_HORIZONTAL);
    fSection.setLayoutData(gd);

    // Align the master and details section headers (misalignment caused
    // by section toolbar icons)
    getPage().alignSectionHeaders(fElementSection.getSection(), fSection);

    Composite client = toolkit.createComposite(fSection);
    client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 3));

    createDetails(client);

    if (fShowDescription) createDescription(client, toolkit);

    // If the DTD Approximation section was requested, instantiate it and create it's contents
    // on the same parent Composite
    if (fShowDTD) {
      fDtdSection = new SchemaDtdDetailsSection();
      fDtdSection.initialize(getManagedForm());
      fDtdSection.createContents(parent);
    }

    toolkit.paintBordersFor(client);
    fSection.setClient(client);
    markDetailsPart(fSection);

    if (fShowDescription) fDescriptionViewer.createUIListeners();
    hookListeners();
  }
 protected Composite createMinOccurComp(Composite parent, FormToolkit toolkit) {
   fMinLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_minOccurLabel);
   fMinLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
   Composite comp = toolkit.createComposite(parent);
   GridData gd = new GridData(GridData.FILL_HORIZONTAL);
   gd.horizontalSpan = 2;
   GridLayout layout = new GridLayout();
   layout.marginHeight = layout.marginWidth = 0;
   comp.setLayout(layout);
   comp.setLayoutData(gd);
   fMinOccurSpinner = new Spinner(comp, SWT.BORDER);
   fMinOccurSpinner.setMinimum(0);
   fMinOccurSpinner.setMaximum(999);
   return comp;
 }
 protected Button[] createTrueFalseButtons(Composite parent, FormToolkit toolkit, int colSpan) {
   Composite comp = toolkit.createComposite(parent, SWT.NONE);
   GridLayout gl = new GridLayout(2, false);
   gl.marginHeight = gl.marginWidth = 0;
   comp.setLayout(gl);
   GridData gd = new GridData(GridData.FILL_HORIZONTAL);
   gd.horizontalSpan = colSpan;
   gd.horizontalIndent = FormLayoutFactory.CONTROL_HORIZONTAL_INDENT;
   comp.setLayoutData(gd);
   Button tButton = toolkit.createButton(comp, BOOLS[0], SWT.RADIO);
   Button fButton = toolkit.createButton(comp, BOOLS[1], SWT.RADIO);
   gd = new GridData();
   gd.horizontalIndent = 20;
   fButton.setLayoutData(gd);
   return new Button[] {tButton, fButton};
 }