コード例 #1
0
  protected JPanel buildVersionLockingFieldChooser() {
    GridBagConstraints constraints = new GridBagConstraints();
    Pane lockingPanel = new Pane(new GridBagLayout());

    JLabel lockingFieldLabel = buildLabel("EIS_LOCKING_POLICY_XPATH");
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 0, 0, 0);
    lockingPanel.add(lockingFieldLabel, constraints);

    XpathChooser xpathChooser =
        new XpathChooser(this.getWorkbenchContextHolder(), buildLockingFieldSelectionHolder());
    xpathChooser.setAccessibleLabeler(lockingFieldLabel);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 5, 0, 0);
    lockingPanel.add(xpathChooser, constraints);

    return lockingPanel;
  }
コード例 #2
0
  // **************** Initialization ****************************************
  @Override
  protected void initializeLayoutWithAggregatable() {

    GridBagConstraints constraints = new GridBagConstraints();

    // xpath label
    JRadioButton xpathRadioButton = this.buildXpathRadioButton();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 0, 0, 0);
    this.add(xpathRadioButton, constraints);
    this.addAlignLeft(xpathRadioButton);

    // xpath chooser
    XpathChooser chooser = this.buildXpathChooser();
    chooser.setAccessibleLabeler(xpathRadioButton);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 5, 0, 0);
    this.add(chooser, constraints);
    this.addPaneForAlignment(chooser);

    // aggregate radio button
    JRadioButton aggregateRadioButton = this.buildAggregateRadioButton();
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 2;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 0, 0, 0);
    this.add(aggregateRadioButton, constraints);

    JLabel typeLabel = this.buildElementTypeLabel();
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 10, 0, 0);
    addAlignLeft(typeLabel);
    this.add(typeLabel, constraints);

    SchemaComplexTypeChooser typeChooser = this.buildElementTypeChooser(typeLabel);
    typeLabel.setLabelFor(typeChooser);
    constraints.gridx = 1;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 5, 0, 0);
    this.add(typeChooser, constraints);
    addPaneForAlignment(typeChooser);
  }
    protected void initializeLayout() {
      this.setLayout(new GridBagLayout());

      GridBagConstraints constraints = new GridBagConstraints();

      // Grouping Element label
      JLabel groupingElementLabel = this.buildGroupingElementLabel();
      constraints.gridx = 0;
      constraints.gridy = 0;
      constraints.gridwidth = 1;
      constraints.gridheight = 1;
      constraints.weightx = 0;
      constraints.weighty = 0;
      constraints.fill = GridBagConstraints.NONE;
      constraints.anchor = GridBagConstraints.LINE_START;
      constraints.insets = new Insets(0, 0, 0, 0);
      this.add(groupingElementLabel, constraints);
      this.addAlignLeft(groupingElementLabel);
      addHelpTopicId(groupingElementLabel, "mapping.eisOneToMany.foreignKeyGroupingElement");

      // Grouping Element chooser
      XpathChooser groupingElementChooser = this.buildGroupingElementXpathChooser();
      groupingElementChooser.setAccessibleLabeler(groupingElementLabel);
      constraints.gridx = 1;
      constraints.gridy = 0;
      constraints.gridwidth = 1;
      constraints.gridheight = 1;
      constraints.weightx = 1;
      constraints.weighty = 0;
      constraints.fill = GridBagConstraints.HORIZONTAL;
      constraints.anchor = GridBagConstraints.CENTER;
      constraints.insets = new Insets(0, 5, 0, 0);
      this.add(groupingElementChooser, constraints);
      this.addPaneForAlignment(groupingElementChooser);
      addHelpTopicId(groupingElementChooser, "mapping.eisOneToMany.foreignKeyGroupingElement");

      // Field Pairs label
      JLabel fieldPairsLabel = this.buildFieldPairsLabel();
      constraints.gridx = 0;
      constraints.gridy = 1;
      constraints.gridwidth = 2;
      constraints.gridheight = 1;
      constraints.weightx = 0;
      constraints.weighty = 0;
      constraints.fill = GridBagConstraints.NONE;
      constraints.anchor = GridBagConstraints.LINE_START;
      constraints.insets = new Insets(5, 0, 0, 0);
      this.add(fieldPairsLabel, constraints);
      this.addAlignLeft(fieldPairsLabel);
      addHelpTopicId(fieldPairsLabel, "mapping.eisOneToMany.fieldPairs");

      // Field Pairs table
      AbstractPanel fieldPairsPanel = this.buildFieldPairsPanel();
      constraints.gridx = 0;
      constraints.gridy = 2;
      constraints.gridwidth = 2;
      constraints.gridheight = 1;
      constraints.weightx = 1;
      constraints.weighty = 1;
      constraints.fill = GridBagConstraints.BOTH;
      constraints.anchor = GridBagConstraints.CENTER;
      constraints.insets = new Insets(1, 0, 0, 0);
      this.add(fieldPairsPanel, constraints);
      this.addPaneForAlignment(fieldPairsPanel);
      addHelpTopicId(fieldPairsPanel, "mapping.eisOneToMany.fieldPairs");
    }