Java 类com.intellij.util.ui.MultiRowFlowPanel 实例源码

项目:intellij-ce-playground    文件:RichTextControlBuilder.java   
private void addRow(@NotNull Collection<JComponent> rowComponents) {
  JPanel row = new MultiRowFlowPanel(FlowLayout.CENTER, getGapToUse(0), getGapToUse(3));
  row.setBackground(myBackgroundColor);
  myComponents.add(row);
  if (rowComponents.isEmpty()) {
    row.add(new JLabel(" "));
  }
  else {
    for (JComponent component : rowComponents) {
      row.add(component);
    }
  }
  GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridwidth = GridBagConstraints.REMAINDER;
  constraints.weightx = 1;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.insets.top = 3;
  myResult.add(row, constraints);
}
项目:tools-idea    文件:RichTextControlBuilder.java   
private void addRow(@NotNull Collection<JComponent> rowComponents) {
  JPanel row = new MultiRowFlowPanel(FlowLayout.CENTER, getGapToUse(0), getGapToUse(3));
  row.setBackground(myBackgroundColor);
  myComponents.add(row);
  if (rowComponents.isEmpty()) {
    row.add(new JLabel(" "));
  }
  else {
    for (JComponent component : rowComponents) {
      row.add(component);
    }
  }
  GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridwidth = GridBagConstraints.REMAINDER;
  constraints.weightx = 1;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.insets.top = 3;
  myResult.add(row, constraints);
}
项目:intellij-ce-playground    文件:ArrangementMatchingRuleEditor.java   
@NotNull
private MultiRowFlowPanel addRowIfNecessary(@NotNull MultiRowFlowPanel panel) {
  if (panel.getComponentCount() <= 0) {
    return panel;
  }
  add(panel, new GridBag().anchor(GridBagConstraints.WEST).weightx(1).fillCellHorizontally().coverLine());
  myRows.add(panel);
  return new MultiRowFlowPanel(
    FlowLayout.LEFT, ArrangementConstants.HORIZONTAL_GAP, ArrangementConstants.VERTICAL_GAP
  );
}
项目:tools-idea    文件:ArrangementMatchingRuleEditor.java   
@NotNull
private MultiRowFlowPanel addRowIfNecessary(@NotNull MultiRowFlowPanel panel) {
  if (panel.getComponentCount() <= 0) {
    return panel;
  }
  add(panel, new GridBag().anchor(GridBagConstraints.WEST).weightx(1).fillCellHorizontally().coverLine());
  myRows.add(panel);
  return new MultiRowFlowPanel(
    FlowLayout.LEFT, ArrangementConstants.HORIZONTAL_GAP, ArrangementConstants.VERTICAL_GAP
  );
}
项目:consulo    文件:ArrangementMatchingRuleEditor.java   
@Nonnull
private MultiRowFlowPanel addRowIfNecessary(@Nonnull MultiRowFlowPanel panel) {
  if (panel.getComponentCount() <= 0) {
    return panel;
  }
  add(panel, new GridBag().anchor(GridBagConstraints.WEST).weightx(1).fillCellHorizontally().coverLine());
  myRows.add(panel);
  return new MultiRowFlowPanel(
          FlowLayout.LEFT, ArrangementConstants.HORIZONTAL_GAP, ArrangementConstants.VERTICAL_GAP
  );
}
项目:intellij-ce-playground    文件:ArrangementMatchingRuleEditor.java   
public void applyAvailableWidth(int width) {
  for (MultiRowFlowPanel row : myRows) {
    row.setForcedWidth(width - myLabelWidth);
  }
  validate();
}
项目:tools-idea    文件:ArrangementMatchingRuleEditor.java   
public void applyAvailableWidth(int width) {
  for (MultiRowFlowPanel row : myRows) {
    row.setForcedWidth(width - myLabelWidth);
  }
  validate();
}
项目:consulo    文件:ArrangementMatchingRuleEditor.java   
public void applyAvailableWidth(int width) {
  for (MultiRowFlowPanel row : myRows) {
    row.setForcedWidth(width - myLabelWidth);
  }
  validate();
}