本文整理汇总了Java中javafx.scene.control.Hyperlink.setText方法的典型用法代码示例。如果您正苦于以下问题:Java Hyperlink.setText方法的具体用法?Java Hyperlink.setText怎么用?Java Hyperlink.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Hyperlink
的用法示例。
在下文中一共展示了Hyperlink.setText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populate
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
public void populate(Script script) {
this.flow = new TextFlow();
Text name = new Text(script.getName());
name.getStyleClass().add("subtitle");
this.getChildren().add(name);
RootNode node = mdProcessor.parseMarkdown(script.getDescription().toCharArray());
//Text desc = new Text(script.getDescription());
//this.getChildren().add(desc);
node.accept(this.mdToFx);
//add description flow
this.getChildren().add(flow);
final String documentationPage = script.getXProcScript().getHomepage();
if (documentationPage != null && documentationPage.isEmpty() == false) {
Hyperlink link = new Hyperlink();
link.setText("Read online documentation");
link.setOnAction(Links.getEventHander(main.getHostServices(),documentationPage));
this.getChildren().add(link);
}
}
示例2: addFinderLinkRow
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
public void addFinderLinkRow(String label, final String path) {
Hyperlink link = new Hyperlink();
link.setText(label);
link.setTooltip(new Tooltip(path));
link.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
try {
String cmd = PlatformUtils.getFileBrowserCommand() + " " + path;
Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
addRow(link);
}
示例3: showAboutWindow
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
private void showAboutWindow()
{
String appName = Main.appTitle;
String version = Main.releaseVersion;
String website = Main.website;
String email = Main.email;
String copyrightNotice = Main.copyrightNotice;
Alert about = new Alert(AlertType.INFORMATION, "About " + appName);
about.initOwner(getStage());
about.setTitle("About " + appName);
about.setHeaderText(appName + " version " + version);
FlowPane infoPane = generateLabelAndLinkPane("For more information visit", website, Font.getDefault().getSize() + 2);
infoPane.setPadding(new Insets(0, 0, 15, 0));
FlowPane copyright = generateLabelAndLinkPane(copyrightNotice, "mailto:" + email, Font.getDefault().getSize());
Hyperlink mailLink = (Hyperlink) copyright.getChildren().get(1);
mailLink.setText(email);
copyright.setPadding(new Insets(0, 0, 15, 0));
VBox aboutVBox = new VBox();
aboutVBox.getChildren().addAll(infoPane, copyright, getAttributionLinksForAboutDialog());
about.getDialogPane().setContent(aboutVBox);
about.getDialogPane().setPrefWidth(440);
about.showAndWait();
}
示例4: getAttributionLinksForAboutDialog
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
private VBox getAttributionLinksForAboutDialog()
{
FlowPane iconsAttributionPane = generateLabelAndLinkPane("All icons (except for ", "http://icons8.com", Font.getDefault().getSize());
Label labelToAdd = new Label(") are from");
labelToAdd.setGraphic(new ImageView(new Image(applicationIcon16Location)));
labelToAdd.setContentDisplay(ContentDisplay.LEFT);
labelToAdd.setGraphicTextGap(2);
iconsAttributionPane.getChildren().add(1, labelToAdd); //add the label in the middle of the message
FlowPane softwareAttributionPane = generateLabelAndLinkPane("Click", Main.attributionHTMLLocation, Font.getDefault().getSize());
Hyperlink tempLink = (Hyperlink) softwareAttributionPane.getChildren().get(1);
tempLink.setText("here");
softwareAttributionPane.getChildren().add(new Label("to see which software libraries are used in Who What Where."));
VBox vbox = new VBox();
vbox.getChildren().addAll(iconsAttributionPane, softwareAttributionPane);
return vbox;
}
示例5: visit
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
@Override
public void visit(ExpLinkNode node) {
Hyperlink link = new Hyperlink();
StringBuffer buff = new StringBuffer();
printChildren(buff, node);
link.setText(buff.toString());
link.setOnAction(Links.getEventHander(this.parent.getHostServices(), node.url));
parent.addChild(link);
}
示例6: setupLink
import javafx.scene.control.Hyperlink; //导入方法依赖的package包/类
public static Hyperlink setupLink(Hyperlink hyperlink, String text, String url) {
hyperlink.setText(text);
hyperlink.setOnAction(event -> OperatingSystem.browseURI(url));
return hyperlink;
}