javafx.scene.control.Label.setMnemonicParsing()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中javafx.scene.control.Label.setMnemonicParsing()方法的一些代码示例,展示了Label.setMnemonicParsing()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setMnemonicParsing()方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:setMnemonicParsing

Label.setMnemonicParsing介绍

暂无

代码示例

代码示例来源:origin: no.tornado/tornadofx-controls

private void configureMnemonicTarget( Node target ){
  if( target.getProperties().containsKey("mnemonicTarget") ){
    getLabel().setMnemonicParsing(true);
    getLabel().setLabelFor(target);
  }
}

代码示例来源:origin: no.tornado/tornadofx-controls

public static void setMnemonicTarget( Node target ){
  Field parent = NodeHelper.findParentOfType( target, Field.class);
  if( parent != null ){
    parent.getLabel().setMnemonicParsing(true);
    parent.getLabel().setLabelFor(target);
  } else {
    // we will detect this when this target is added as an input
    target.getProperties().put("mnemonicTarget",Boolean.TRUE);
  }
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

private Label addLabelContent(GridPane gridPane, int row, Attribute<?,?> attribute) {
    String mnemonicLabelText=uniformDesign.getLabelText(attribute);
    if (mnemonicLabelText!=null){
      mnemonicLabelText="_"+mnemonicLabelText;
    }
    Label label = new Label(mnemonicLabelText);
    label.setMnemonicParsing(true);
    label.setWrapText(true);
//        label.setTextOverrun(OverrunStyle.CLIP);
    GridPane.setMargin(label, new Insets(0, 9, 0, 0));
    StackPane pane = new StackPane();
    pane.setPadding(new Insets(5,3,5,3));
    pane.setAlignment(Pos.CENTER_LEFT);
    pane.getChildren().add(label);
    gridPane.add(pane, 0, row);

    if (row%2==0) {
      pane.setStyle("-fx-background-color: " + highlightBackground + ";");
    }
    String tooltip=uniformDesign.getTooltipText(attribute);
    if (!Strings.isNullOrEmpty(tooltip)) {
      label.setTooltip(new Tooltip(tooltip));
    }

    return label;
  }
  final static String highlightBackground = "#FCFCFC";

相关文章