ColumnHeader.java 文件源码

java
阅读 54 收藏 0 点赞 0 评论 0

项目:stvs 作者:
/**
 * <p>
 * Creates the view for the given {@link SpecIoVariable} as model.
 * </p>
 *
 * @param specIoVariable the model for this view.
 */
public ColumnHeader(SpecIoVariable specIoVariable) {
  this.categoryLabel = new Label(specIoVariable.getCategory().toString());
  this.columnNameLabel = new Label(specIoVariable.getName());
  this.columnTypeLabel = new Label(specIoVariable.getType());
  this.typeOfLabel = new Label(" : ");
  this.problemTooltip = new Tooltip("");
  ViewUtils.setupClass(this);

  categoryLabel.textProperty().bind(Bindings.convert(specIoVariable.categoryProperty()));
  columnNameLabel.textProperty().bind(specIoVariable.nameProperty());
  columnTypeLabel.textProperty().bind(specIoVariable.typeProperty());

  String inout = specIoVariable.getCategory().toString().toLowerCase();

  categoryLabel.getStyleClass().addAll("spec-column-header", "category-label", inout);
  columnNameLabel.getStyleClass().addAll("spec-column-header", "name-label");
  columnTypeLabel.getStyleClass().addAll("spec-column-header", "type-label");
  typeOfLabel.getStyleClass().addAll("spec-column-header", "type-of-label");
  problemTooltip.getStyleClass().addAll("spec-column-header", "problem-tooltip");

  specIoVariable.categoryProperty().addListener(this::updateInOutClass);

  this.getStyleClass().addAll("spec-column-header", inout);
  this.setAlignment(Pos.CENTER);

  this.varDescriptionHbox = new HBox(columnNameLabel, typeOfLabel, columnTypeLabel);
  this.varDescriptionHbox.setAlignment(Pos.CENTER);

  this.getChildren().addAll(categoryLabel, varDescriptionHbox);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号