コード例 #1
0
  public void initializeFromStyle(final ElementStyleSheet styleSheet) {
    final ElementAlignment halign =
        (ElementAlignment) styleSheet.getStyleProperty(ElementStyleKeys.ALIGNMENT);
    if (ElementAlignment.LEFT.equals(halign)) {
      leftAlignButton.setSelected(true);
    } else if (ElementAlignment.CENTER.equals(halign)) {
      centerAlignButton.setSelected(true);
    } else {
      rightAlignButton.setSelected(true);
    }

    final ElementAlignment valign =
        (ElementAlignment) styleSheet.getStyleProperty(ElementStyleKeys.VALIGNMENT);
    if (ElementAlignment.BOTTOM.equals(valign)) {
      bottomAlignButton.setSelected(true);
    } else if (ElementAlignment.MIDDLE.equals(valign)) {
      middleAlignButton.setSelected(true);
    } else {
      topAlignButton.setSelected(true);
    }

    wrapTextCheckbox.setSelected(
        TextWrap.WRAP.equals(styleSheet.getStyleProperty(TextStyleKeys.TEXT_WRAP)));
    lineHeightField.setText(
        BorderPropertiesPane.printLength(
            (Number) styleSheet.getStyleProperty(TextStyleKeys.LINEHEIGHT)));

    textAlignModel.setSelectedKey(
        styleSheet.getStyleProperty(TextStyleKeys.VERTICAL_TEXT_ALIGNMENT));
    whitespaceModel.setSelectedKey(styleSheet.getStyleProperty(TextStyleKeys.WHITE_SPACE_COLLAPSE));
  }
コード例 #2
0
 public void setExportType(final String exportType) {
   exportFormatModel.setSelectedKey(exportType);
 }