javafx.scene.control.Hyperlink类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(154)

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

Hyperlink介绍

暂无

代码示例

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxplatform-components

@Override
protected void updateItem(ObjectModel item, boolean empty) {
 super.updateItem(item, empty);
 setGraphic(null);
 setText(null);
 setStyle("-fx-padding:0");
 if (!empty) {
  layout.setStyle("-fx-pref-height: 48; " + "-fx-background-color: transparent;" + "-fx-border-color: -external-border-color; " + "-fx-border-width: 0.03;"
    + "-fx-alignment: CENTER_LEFT; -fx-padding: 0 16 0 16;");
  final Hyperlink content = new Hyperlink();
  content.setStyle("-fx-text-fill: -primary-text-color; -fx-underline: false; -fx-font-size:16px;-fx-font-family:'Roboto Regular';");
  content.setFocusTraversable(false);
  content.setText(item.getName());
  content.setOnAction(e -> {
   loadChildrenFuntion.apply(item);
  });
  layout.getChildren().clear();
  layout.getChildren().add(content);
  setGraphic(layout);
 }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * Constructor
 */
public AdvancedPaginationBar() {
 super();
 previousButton.getStyleClass().add("advanced-pagination-button");
 nextButton.getStyleClass().add("advanced-pagination-button");
 firstButton.getStyleClass().add("advanced-pagination-button");
 lastButton.getStyleClass().add("advanced-pagination-button");
 nextButton.setTooltip(new Tooltip("Next"));
 nextButton.disableProperty().bind(Bindings.not(hasNext));
 lastButton.setTooltip(new Tooltip("Last"));
 lastButton.disableProperty().bind(Bindings.not(hasNext));
 previousButton.setTooltip(new Tooltip("Back"));
 previousButton.disableProperty().bind(Bindings.not(hasPrevious));
 firstButton.setTooltip(new Tooltip("First"));
 firstButton.disableProperty().bind(Bindings.not(hasPrevious));
 layout.getChildren().addAll(rowsPerPageLabel, rowsPerPageCombo, itemsCount, firstButton, previousButton, nextButton, lastButton);
}

代码示例来源:origin: stackoverflow.com

@Override
protected void updateItem(Hyperlink item, boolean empty) {
  super.updateItem(item, empty);
  if (!empty){
    item.setOnAction(e -> {
      TeDhenatBlerjes(Integer.parseInt(getTableView().getColumns().get(0).getCellData(getTableRow().getIndex())+""), item.getText());
    });
  }

  // set graphic every time i.e. set it to null for empty cells
  setGraphic(item);
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

public void toUpperCase() {
 link.setText(link.getText() != null ? link.getText().toUpperCase() : "");
}

代码示例来源:origin: stackoverflow.com

Hyperlink hl = new Hyperlink(sometext);
hl.setTooltip(new Tooltip(theurlhere);
hl.setOnAction((ActionEvent event) -> {
  Hyperlink h = (Hyperlink) event.getTarget();
  String s = h.getTooltip().getText();
  getHostServices.showDocument(s);
  event.consume();
});

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

private void buildFilterToolbar() {
 filtersToolbar.setStyle("-fx-background-color: white;" + "-fx-alignment:CENTER_LEFT;" + "-fx-padding: 16 16 16 64;" + "-fx-spacing:16;" + "-fx-border-color: -grey-color-300;"
   + "-fx-border-width: 0 0 1 0;" + "-fx-pref-height: 48;");
 getChildren().add(filtersToolbar);
 NodeHelper.setHgrow(filtersToolbar);
 filtersToolbar.managedProperty().bind(filtersToolbar.visibleProperty());
 final Hyperlink filterToolBarButton = new Hyperlink();
 defaultToolbar.getChildren().add(filterToolBarButton);
 filterToolBarButton.setOnAction(e -> {
  filtersToolbar.visibleProperty().set(!filtersToolbar.visibleProperty().get());
 });
 filtersToolbar.setVisible(false);
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

protected void buildActionsArea() {
 actionsContainer.getStyleClass().add("notification-view-actions-container");
 actionsContainer.getChildren().addAll(deleteAction);
 deleteAction.setOnAction(e -> delete());
 deleteAction.setOpacity(0.54);
 deleteAction.setFocusTraversable(false);
 deleteAction.getStyleClass().addAll("button-transparent-border-primary", "scale-down-on-click");
 deleteAction.setText(controller.getGLocalised("REMOVE_LABEL").toUpperCase());
 // IconUtils.setFontIcon("mdi-close:14", "grey-ikonli", deleteAction);
}

代码示例来源:origin: PhoenicisOrg/phoenicis

.then(false).otherwise(true);
final Hyperlink gitRevisionHyperlink = new Hyperlink();
gitRevisionHyperlink.textProperty().bind(revisionText);
gitRevisionHyperlink.disableProperty().bind(disableProperty);
gitRevisionHyperlink.visitedProperty().bind(disableProperty);
gitRevisionHyperlink.underlineProperty().bind(disableProperty);
gitRevisionHyperlink.setOnAction(event -> {
  try {
    final URI uri = new URI("https://github.com/PhoenicisOrg/phoenicis/commit/"

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
  * @return
  */
 protected ButtonBase getPinOrCloseButton() {
  Hyperlink button = new Hyperlink();
  IconUtils.setFontIcon("mdi-close:22", button);
  button.getGraphic().getStyleClass().addAll("red-ikonli", "transparent-focus");
  button.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);

  button.setOnAction(e -> {
   CloseMenuEvent closeMenuEvent = new CloseMenuEvent(MenuPos.TERNARY_MENU);
   dispatchEvent(closeMenuEvent);
  });

  return button;
 }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

protected void buildCloseButton() {
 boolean showAsDialog = Boolean.valueOf(configuration.getPropertyValue(XMLConstants.DIALOG));
 if(showAsDialog) {
  Hyperlink link = new Hyperlink();
  link.getStyleClass().add("transparent-focus");
  FontIcon icon = new FontIcon("mdi-close:32");
  link.setGraphic(icon);
  icon.getStyleClass().add("wizard-close-icon");
  layout.getChildren().addAll(NodeHelper.horizontalSpacer(), link);
  if (controller instanceof WizardViewController) {
   link.setOnAction(e -> ((WizardViewController) controller).hide());
  }
 }
 else {
  layout.getChildren().addAll(NodeHelper.horizontalSpacer());
 }
}

代码示例来源:origin: stackoverflow.com

box.getChildren().clear();
     // for each new link you need to add
       Hyperlink link = new Hyperlink(stringLink);
       link.setOnAction(new EventHandler<ActionEvent>() {
         @Override
         public void handle(ActionEvent t) {
           // do something
         }
       });
       box.getChildren().add(link);
     });

代码示例来源:origin: io.datafx/ui

public static <S, T> ActionTableCell<S, T, Hyperlink> createWithHyperlink(Consumer<S> consumer, String text) {
    return new ActionTableCell<S, T, Hyperlink>(consumer, new Hyperlink(text));
  }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

defaultToolbar.getChildren().add(NodeHelper.horizontalSpacer());
modifyButton.setOnAction(e -> modifyClicked());
modifyButton.setFocusTraversable(false);
modifyButton.visibleProperty().bind(Bindings.size(tableView.getTableView().getItems()).greaterThan(0));
final Hyperlink refresh = new Hyperlink();
defaultToolbar.getChildren().addAll(refresh);

代码示例来源:origin: net.sf.sf3jswing/kernel-core

for (int i = 0; i < linksCaptions_bunkey.length; i++) {
  Hyperlink hpl = hpls[i] = new Hyperlink(text.bundle.getString(linksCaptions_bunkey[i]));
  try {
    Image image = images[i] = new Image(linksImages[i].openStream());
    hpl.setGraphic(new ImageView(image));
  } catch (IOException ex) {
    Logger.getLogger(JXAenvUtils.LOGGER_NAME).log(Level.SEVERE, null, ex);
    hpl.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent e) {

代码示例来源:origin: org.controlsfx/controlsfx

Hyperlink hyperlink = new Hyperlink(text.substring(startPos + 1, endPos));
hyperlink.setPadding(new Insets(0, 0, 0, 0));
hyperlink.setOnAction(eventHandler);
nodes.add(hyperlink);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

@Override
public void buildFrom(VLViewComponentXML tabCfg, AbstractViewController controller) {
 this.controller = controller;
 iconAction.setFocusTraversable(false);
 iconAction.getStyleClass().add("vertical-tab-icon");
 final Tooltip tooltip = new Tooltip("All attributes");
 iconAction.setTooltip(tooltip);
 getChildren().add(iconAction);
 iconAction.setOnAction(e -> {
  tabPane.setTabContent(getTabContent());
 });
 setStyle("-fx-max-height: 52");
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

private void buildNonFloatingRightActionsButton() {
 popOverFloatingPane.managedProperty().bind(popOverFloatingPane.visibleProperty());
 showRightPaneButton.managedProperty().bind(showRightPaneButton.visibleProperty());
 hideRightPaneButton.managedProperty().bind(hideRightPaneButton.visibleProperty());
 showRightPaneButton.visibleProperty().bind(Bindings.not(hideRightPaneButton.visibleProperty()));
 IconUtils.setFontIcon("fa-angle-double-left:20", showRightPaneButton);
 showRightPaneButton.getGraphic().getStyleClass().add("grey-ikonli");
 showRightPaneButton.getStyleClass().add("transparent-focus");
 showRightPaneButton.setOnAction(e -> {
  openRightPane();
 });
 IconUtils.setFontIcon("fa-angle-double-right:20", hideRightPaneButton);
 hideRightPaneButton.getGraphic().getStyleClass().add("grey-ikonli");
 hideRightPaneButton.getStyleClass().add("transparent-focus");
 hideRightPaneButton.setOnAction(e -> {
  closeRightPane();
 });
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
  * Constructor
  */
 public NotifsFilter() {
  //allNotifs.setText(ms.getMessage("ALL_NOTIFICATIONS_LABEL", null, null));
  //newNotifs.setText(ms.getMessage("NEW_NOTIFICATIONS_LABEL", null, null));
  allNotifs.setText("ALL_NOTIFICATIONS_LABEL");
  newNotifs.setText("NEW_NOTIFICATIONS_LABEL");
  NodeHelper.setHgrow(allNotifs, newNotifs);
  allNotifs.getStyleClass().addAll("notifications-filter-button", "transparent-focus", "scale-down-on-click");
  newNotifs.getStyleClass().addAll("notifications-filter-button", "transparent-focus", "scale-down-on-click");
  allNotifs.prefHeightProperty().bind(heightProperty());
  newNotifs.prefHeightProperty().bind(heightProperty());
  allNotifs.prefWidthProperty().bind(widthProperty().divide(2));
  newNotifs.prefWidthProperty().bind(widthProperty().divide(2));
  getChildren().addAll(allNotifs, newNotifs);
  getStyleClass().add("notifications-filters-container");
  allNotifs.setOnAction(e -> filter.setAll(NotificationStatus.NEW, NotificationStatus.READEN));
  newNotifs.setOnAction(e -> filter.setAll(NotificationStatus.NEW));
 }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

protected ButtonBase build(VLViewComponentXML configuration) {
 if ("button".equals(type)) {
  Button buttonAction = new JFXButton();
  buttonAction.getStyleClass().remove(0);
  buttonAction.getStyleClass().removeAll("jfx-button", "button");
  buttonAction.managedProperty().bind(buttonAction.visibleProperty());
  NodeHelper.setTitle(buttonAction, configuration, controller);
  IconUtils.setIcon(buttonAction, configuration);
  NodeHelper.setStyleClass(buttonAction, configuration, "styleClass", true);
  buttonAction.getStyleClass().add("ep-button");
  String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE, "LEFT");
  buttonAction.setContentDisplay(ContentDisplay.valueOf(displayMode));
  boolean readOnly = configuration.getBooleanProperty("readOnly", false);
  buttonAction.setDisable(readOnly);
  buttonAction.addEventFilter(ActionEvent.ACTION, e -> onAction(buttonAction));
  return buttonAction;
 } else {
  Hyperlink hyperlinkAction = new Hyperlink();
  hyperlinkAction.managedProperty().bind(hyperlinkAction.visibleProperty());
  NodeHelper.setTitle(hyperlinkAction, configuration, controller);
  NodeHelper.setStyleClass(hyperlinkAction, configuration, "styleClass", true);
  IconUtils.setIcon(hyperlinkAction, configuration);
  boolean readOnly = configuration.getBooleanProperty("readOnly", false);
  hyperlinkAction.setDisable(readOnly);
  hyperlinkAction.addEventFilter(ActionEvent.ACTION, e -> onAction(hyperlinkAction));
  return hyperlinkAction;
 }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

private void buildActions() {
 okButton.setFocusTraversable(false);
 okButton.setText(controller.getGLocalised("SAVE_LABEL").toUpperCase());
 cancelButton.setText(controller.getGLocalised("CANCEL_LABEL").toUpperCase());
 cancelButton.setFocusTraversable(false);
 actions.setStyle("-fx-padding: 32 0 0 32; -fx-alignment: CENTER_RIGHT;-fx-spacing:16;");
 actions.getChildren().addAll(NodeHelper.horizontalSpacer(), okButton, cancelButton);
 cancelButton.setOnAction(e -> {
  hide();
 });
 okButton.setOnAction(e -> {
  hide();
  editInputComponent.commitModification();
 });
 editInputComponent.getContent().addEventHandler(KeyEvent.KEY_PRESSED, e -> {
  if (e.getCode() == KeyCode.ENTER) {
   hide();
  }
 });
}

相关文章