Java 类javafx.scene.control.Hyperlink 实例源码

项目:marathonv5    文件:RFXHyperlinkButtonTest.java   
@Test public void click() {
    Hyperlink button = (Hyperlink) getPrimaryStage().getScene().getRoot().lookup(".hyperlink");
    LoggingRecorder lr = new LoggingRecorder();
    Platform.runLater(new Runnable() {
        @Override public void run() {
            RFXButtonBase rfxButtonBase = new RFXButtonBase(button, null, null, lr);
            Point2D sceneXY = button.localToScene(new Point2D(3, 3));
            PickResult pickResult = new PickResult(button, sceneXY.getX(), sceneXY.getY());
            Point2D screenXY = button.localToScreen(new Point2D(3, 3));
            MouseEvent me = new MouseEvent(button, button, MouseEvent.MOUSE_PRESSED, 3, 3, sceneXY.getX(), screenXY.getY(),
                    MouseButton.PRIMARY, 1, false, false, false, false, true, false, false, false, false, false, pickResult);
            rfxButtonBase.mouseButton1Pressed(me);
        }
    });
    List<Recording> recordings = lr.waitAndGetRecordings(1);
    Recording select = recordings.get(0);
    AssertJUnit.assertEquals("click", select.getCall());
    AssertJUnit.assertEquals("", select.getParameters()[0]);
}
项目:NoMoreOversleeps    文件:JavaFxHelper.java   
public static Hyperlink createHyperlink(final String string)
{
    Hyperlink hyperlink = new Hyperlink(string);
    hyperlink.setPadding(new Insets(0, 0, 0, 1));
    hyperlink.setOnAction(new EventHandler<ActionEvent>()
    {
        @Override
        public void handle(ActionEvent event)
        {
            try
            {
                DesktopHelper.browse(string);
            }
            catch (Throwable e)
            {
                e.printStackTrace();
            }
        }
    });
    return hyperlink;
}
项目:can4eve    文件:TestAppGUI.java   
@Test
public void testExceptionHelp() throws Exception {
  App app = App.getInstance(OBDMain.APP_PATH);
  String exception = "java.net.BindException:Address already in use (Bind failed)";
  ExceptionHelp ehelp = app.getExceptionHelpByName(exception);
  assertNotNull(ehelp);
  FlowPane fp = new FlowPane();
  Label lbl = new Label(I18n.get(ehelp.getI18nHint()));
  Hyperlink link = new Hyperlink(ehelp.getUrl());

  fp.getChildren().addAll(lbl, link);
  SampleApp sampleApp = new SampleApp("help", fp);
  final Linker linker = sampleApp;
  link.setOnAction((evt) -> {
    linker.browse(link.getText());
  });
  sampleApp.show();
  sampleApp.waitOpen();
  Thread.sleep(SHOW_TIME);
  sampleApp.close();
}
项目:audiomerge    文件:OperationPage.java   
private void mergeFailed(Exception exception) {
    Platform.runLater(() -> {
        Text text = new Text(
                String.format("Merging failed.\nProblem: %s\nIf you think this is a bug, please report it here:",
                        exception.getMessage()));
        text.setWrappingWidth(CONTENT_WIDTH);
        text.setFill(Color.WHITE); // XXX: Ugly workaround because CSS doesn't work

        Hyperlink link = buildBugReportLink(exception);
        FlowPane content = new FlowPane(text, link);

        ThemedAlert alert = new ThemedAlert(AlertType.ERROR);
        alert.getDialogPane().setContent(content);
        alert.showAndWait();
        System.exit(1);
    });
}
项目:audiomerge    文件:OperationPage.java   
private Hyperlink buildBugReportLink(Exception exception) {
    Hyperlink link = new Hyperlink(BUG_REPORT_LINK);
    String body;
    try {
        Throwable cause = exception.getCause();
        // XXX: Can we include whole stack trace? URL length limitations? Privacy issues?
        body = URLEncoder.encode(String.format("*Message:* `%s`\n*Cause:* `%s`", exception.getMessage(),
                cause == null ? "(null)" : cause.getClass().getCanonicalName()), "UTF-8");
    } catch (UnsupportedEncodingException e) {
        System.err.println("Failed to build body argument for bug reporting URL");
        e.printStackTrace();
        body = "";
    }
    String args = "?body=" + body;
    link.setOnAction(event -> directoryOpener.accept(BUG_REPORT_LINK + args));
    return link;
}
项目:Gargoyle    文件:BigTextView.java   
/**
 * 리스트뷰를 클릭했을때 이벤트
 * @작성자 : KYJ
 * @작성일 : 2017. 7. 25. 
 * @param e
 */
public void lvFindRsltOnMouseClick(MouseEvent e) {
    FindModel selectedItem = lvFindRslt.getSelectionModel().getSelectedItem();
    if (selectedItem != null) {
        this.pagination.setCurrentPageIndex(selectedItem.getPage());

        List<Hyperlink> collect = IntStream.iterate(0, a -> a + 1).limit(selectedItem.getLines().size()).mapToObj(idx -> {
            Line line = selectedItem.getLines().get(idx);

            Hyperlink hyperlink = new Hyperlink(String.format("%d", line.getLine()));
            hyperlink.setOnAction(ev -> {
                CPagenationSkin skin = (CPagenationSkin) pagination.getSkin();
                SimpleTextView view = (SimpleTextView) skin.getCurrentPage();
                view.getHelper().moveToLine(line.getLine(), line.getStartCol() - 1, line.getEndCol() - 1);

            });
            return hyperlink;

        }).collect(Collectors.toCollection(LinkedList::new));

        this.fpLines.getChildren().setAll(collect);

    }
}
项目:pattypan    文件:CreateFilePane.java   
private void showOpenFileButton() {
  Hyperlink link = new Hyperlink(Util.text("create-file-open"));
  TextFlow flow = new TextFlow(new WikiLabel("create-file-success"), link);
  flow.setTextAlignment(TextAlignment.CENTER);
  addElement(flow);
  link.setOnAction(ev -> {
    try {
      Desktop.getDesktop().open(Session.FILE);
    } catch (IOException ex) {
      LOGGER.log(Level.WARNING, 
          "Cannot open file: {0}",
          new String[]{ex.getLocalizedMessage()}
      );
    }
  });

  nextButton.linkTo("StartPane", stage, true).setText(Util.text("create-file-back-to-start"));
  nextButton.setVisible(true);
}
项目:pattypan    文件:CheckPane.java   
private void setContent() {
  addElement("check-intro", 40);

  Session.FILES_TO_UPLOAD.stream().map(uploadElement -> {
    String name = uploadElement.getData("name");
    Hyperlink label = new Hyperlink(name);

    label.setTooltip(new Tooltip(name));
    label.setOnAction(event -> {
      setDetails(uploadElement, label);
    });
    return label;
  }).forEach(label -> {
    fileListContainer.getChildren().add(label);
  });

  addElementRow(10,
          new Node[]{new WikiScrollPane(fileListContainer).setWidth(250), new WikiScrollPane(detailsContainer)},
          new Priority[]{Priority.SOMETIMES, Priority.SOMETIMES}
  );

  setDetails(Session.FILES_TO_UPLOAD.get(0), (Hyperlink) fileListContainer.getChildren().get(0));

  prevButton.linkTo("LoadPane", stage);
  nextButton.linkTo("LoginPane", stage);
}
项目:arma-dialog-creator    文件:LanguageSelectionPane.java   
public LanguageSelectionPane(@Nullable Language defaultPreviewLanguage) {
    super(10, 10);
    this.defaultLanguage = defaultPreviewLanguage;
    setToKey(null);
    chosenLanguageObserver.addListener(new ValueListener<Language>() {
        @Override
        public void valueUpdated(@NotNull ValueObserver<Language> observer, @Nullable Language oldValue, @Nullable Language newValue) {
            for (Hyperlink hyperlink : links) {
                if (hyperlink.getUserData().equals(newValue)) {
                    hyperlink.setStyle(LanguageSelectionPane.SELECTED_LINK_STYLE);
                } else {
                    hyperlink.setStyle("");
                }
            }
        }
    });
}
项目:arma-dialog-creator    文件:LanguageSelectionPane.java   
private void addLanguage(@NotNull Language language) {
    if (containsLanguage(language)) {
        return;
    }
    Hyperlink hyperlinkLanguage = new Hyperlink(language.getName());
    links.add(hyperlinkLanguage);
    links.sort(hyperlinkComparator);
    hyperlinkLanguage.setUserData(language);
    hyperlinkLanguage.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            hyperlinkLanguage.setVisited(false);
            chosenLanguageObserver.updateValue(language);
        }
    });

    getChildren().clear();
    getChildren().addAll(links);

}
项目:openjfx-8u-dev-tests    文件:DialogTest.java   
@Test(timeout = 300000)
public void alertWithExpandableContentTest() throws Throwable {
    Wrap<? extends Node> button = parent.lookup(Button.class, new ByText<Button>(BUTTON_SHOW_EXP_TEXT)).wrap();
    for (StageStyle s : StageStyle.values()) {
        Wrap<? extends Node> styleToggleButton = parent.lookup(ToggleButton.class, new ByText<ToggleButton>(s.toString())).wrap();
        click(styleToggleButton, InputType.MOUSE);
        for (String c : content) {
            Wrap<? extends Node> contentToggleButton = parent.lookup(ToggleButton.class, new ByText<ToggleButton>(c)).wrap();
            click(contentToggleButton, InputType.MOUSE);
            click(button, InputType.MOUSE);
            Thread.sleep(DEFAULT_DELAY);
            SceneDock sd = new SceneDock();
            click(sd.asParent().lookup(Hyperlink.class, new ByText<Hyperlink>("Show Details")).wrap(), InputType.MOUSE);
            // checkScreenshot("alertWithExpandableContentTest" + s + "_" + c + "Test", scene);
            Thread.sleep(DEFAULT_DELAY);
            closeDialogWindowByClickingButton("OK");
            throwScreenshotError();
        }
    }
}
项目:openjfx-8u-dev-tests    文件:HyperliksTest.java   
/**
 * Test of user input processing
 */
@ScreenshotCheck
@Test(timeout = 300000)
public void hyperlinkActionTest() throws InterruptedException {
    openPage(Pages.Action.name());
    try {
        Thread.sleep(1000); // ugly workaround to be removed ASAP
    } catch (InterruptedException ex) {
    }
    Parent<Node> parent = getScene().as(Parent.class, Node.class);
    Wrap<? extends Hyperlink> label = parent.lookup(Hyperlink.class, new ByID<Hyperlink>(IDs.Target.name())).wrap();
    final Wrap<? extends Hyperlink> hyperlink = parent.lookup(Hyperlink.class, new ByID<Hyperlink>(IDs.Hyperlink.name())).wrap();
    hyperlink.mouse().click();
    label.waitProperty(Wrap.TEXT_PROP_NAME, HyperlinkApp.HYPER_LINK_IS_FIRED);
    assertTrue(new GetAction<Boolean>() {
        @Override
        public void run(Object... os) throws Exception {
            setResult(hyperlink.getControl().isVisited());
        }
    }.dispatch(Root.ROOT.getEnvironment()));
}
项目:Undertailor    文件:Launcher.java   
Hyperlink generateHyperlink(String text, String url, String imagePath) {
    Hyperlink link = new Hyperlink(text);
    InputStream imageStream = Undertailor.class.getResourceAsStream("/assets/" + imagePath);
    if (imageStream != null) {
        ImageView img = new ImageView(new Image(imageStream));
        img.setFitHeight(24);
        img.setFitWidth(24);

        link.setGraphic(img);
        link.setGraphicTextGap(8D);
    }

    link.setOnMouseReleased(event -> {
        DesktopLauncher.instance.getHostServices().showDocument(url);
    });

    return link;
}
项目:bunkr    文件:AboutWindow.java   
@Override
public void initControls()
{
    this.projectRepoLabel = new Label("Project Repository");
    this.projectRepoValue = new Hyperlink("https://github.com/AstromechZA/bunkr");
    this.versionLabel = new Label("Version");
    this.versionValue = new Label(Version.versionString);
    this.compatVersionLabel = new Label("Compatible Version");
    this.compatVersionValue = new Label(Version.compatibleVersionString);
    this.gitCommitDateLabel = new Label("Git Commit Date");
    this.gitCommitDateValue = new Label(Version.gitDate);
    this.gitCommitHashLabel = new Label("Git Commit Hash");
    this.gitCommitHashValue = new Label(Version.gitHash);
    this.buildDateLabel = new Label("Build Date");
    this.buildDateValue = new Label(Version.builtDate);
}
项目:blackmarket    文件:ItemDialog.java   
public ItemDialog(ExileToolsHit item) {
    super(AlertType.INFORMATION);
    setTitle(item.getInfo().getFullName());
    setHeaderText("");

    String json = new GsonBuilder().setPrettyPrinting().create()
            .toJson(item.getHitJsonObject());

    TextArea textArea = new TextArea(json);
    textArea.setEditable(true);
    textArea.setWrapText(false);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMinWidth(650);
    textArea.setMinHeight(550);

    String shopUrl = "https://www.pathofexile.com/forum/view-thread/" + item.getShop().getThreadid();
    Hyperlink shopLink = new Hyperlink(shopUrl);
    shopLink.setOnAction(e -> openLink(shopUrl));

    getDialogPane().setContent(new VBox(textArea, shopLink));
    initModality(Modality.NONE);
}
项目:WhoWhatWhere    文件:GUIController.java   
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;
}
项目:manami    文件:HyperlinkBuilder.java   
/**
 * @param title
 * @param url
 * @return
 * @since 2.10.0
 */
public static Hyperlink buildFrom(final String title, final String url) {
    final Hyperlink ret = new Hyperlink(title);
    ret.setOnMouseClicked(mouseEvent -> {
        if (mouseEvent.getButton().equals(MouseButton.PRIMARY)) {
            try {
                final Desktop desktop = getDesktop();
                desktop.browse(new URI(url));
            } catch (final Exception e) {
                log.error("An error occurred trying to open the infolink in the default browser: ", e);
                showExceptionDialog(e);
            }
        }
    });
    return ret;
}
项目:manami    文件:SearchResultsController.java   
/**
 * Creates a GUI component for the title.
 *
 * @param anime
 *            {@link Anime} to show.
 * @return A {@link Hyperlink} that has the title as text and the info link
 *         as target.
 */
protected Hyperlink getTitleComponent(final MinimalEntry anime) {
    final Hyperlink title = new Hyperlink(anime.getTitle());
    title.setFont(Font.font(24.0));
    title.setOnMouseClicked(mouseEvent -> {
        if (mouseEvent.getButton().equals(MouseButton.PRIMARY)) {
            try {
                final Desktop desktop = java.awt.Desktop.getDesktop();
                desktop.browse(new URI(anime.getInfoLink().getUrl()));
            } catch (final Exception e) {
                log.error("An error occurred trying to open the infolink in the default browser: ", e);
                showExceptionDialog(e);
            }
        }
    });
    return title;
}
项目:LogFX    文件:StartUpView.java   
public StartUpView( HostServices hostServices,
                    Stage stage,
                    Consumer<File> openFile ) {
    VBox box = new AboutLogFXView( hostServices ).createNode();

    String metaKey = FxUtils.isMac() ? "⌘" : "Ctrl+";

    Hyperlink link = new Hyperlink( String.format( "Open file (%sO)", metaKey ) );
    link.getStyleClass().add( "large-background-text" );
    link.setOnAction( ( event ) -> new FileOpener( stage, openFile ) );

    Text dropText = new Text( "Or drop files here" );
    dropText.getStyleClass().add( "large-background-text" );

    StackPane fileDropPane = new StackPane( dropText );
    fileDropPane.getStyleClass().add("drop-file-pane");

    FileDragAndDrop.install( fileDropPane, openFile );

    box.getChildren().addAll( link, fileDropPane );
    getChildren().addAll( box );
}
项目:bluemarlin    文件:BottomPane.java   
public BottomPane() {
    Hyperlink bottomLabel = new Hyperlink("http://bluemarlinexile.github.io/");
    bottomLabel.setOnAction(e -> {
        try {
            SwingUtil.openUrlViaBrowser(bottomLabel.getText());
        } catch (Exception e1) {
            e1.printStackTrace();
        }
    });

    Label indexerLastUpdateText = new Label("Indexer Last Update: ");
    Label indexerLastUpdateValueText = new Label();
    indexerLastUpdateValueText.textProperty().bind(lastIndexUpdateService.messageProperty());
    indexerLastUpdateText.textProperty().bind(lastIndexUpdateService.countdownProperty());

    getChildren().addAll(bottomLabel, new HBoxSpacer(), indexerLastUpdateText, indexerLastUpdateValueText);

    lastIndexUpdateService.setOnSucceeded(e -> lastIndexUpdateService.restart());
    lastIndexUpdateService.setOnFailed   (e -> lastIndexUpdateService.restart());
    lastIndexUpdateService.restart();
}
项目:OCRaptor    文件:SearchResult.java   
/**
 *
 *
 * @param fileEntry
 * @param contentSearch
 * @param nodesToAdd
 * @param idToShow
 *
 * @throws Exception
 */
private void addBrowser(final FileEntry fileEntry, final List<Node> nodesToAdd) throws Exception {
  // TODO: text
  final Hyperlink fulltextButton = new Hyperlink(g.getText("SEARCH_RESULT.SHOW_FULLTEXT"));
  fulltextButton.setStyle("-fx-font-size:15px");
  Platform.runLater(new Runnable() {
    @Override
    public void run() {
      addTooltip(fulltextButton, g.getText("SEARCH_RESULT.SHOW_FULLTEXT_TOOLTIP"), -50, 35);
    }
  });

  // ------------------------------------------------ //

  fulltextButton.setOnAction(new EventHandler<ActionEvent>() {
    @Override
    public void handle(ActionEvent event) {
      outTransition();
      executeWorker(saveToXhtmlWorker(fileEntry));
    }
  });

  // ------------------------------------------------ //
  nodesToAdd.add(fulltextButton);
  nodesToAdd.add(new Text("  "));
}
项目:OCRaptor    文件:SearchResult.java   
/**
 *
 *
 * @param fileEntry
 * @param nodesToAdd
 *
 * @throws Exception
 */
private void addDirectoryButton(final FileEntry fileEntry, final List<Node> nodesToAdd)
    throws Exception {
  Hyperlink openDirButton = new Hyperlink(g.getText("SEARCH_RESULT.SHOW_FILE"));
  openDirButton.setStyle("-fx-font-size:15px");
  // addImageIcon(openDirButton, Icon.FOLDER_OPEN, 0);
  openDirButton.setOnAction(new EventHandler<ActionEvent>() {
    @Override
    public void handle(ActionEvent event) {
      outTransition();
      inTransitionAsWorker(1000);
      executeWorker(openFileWorker(fileEntry.getPath(), true, 1));
    }
  });
  nodesToAdd.add(openDirButton);
  nodesToAdd.add(new Text("  "));

  Platform.runLater(new Runnable() {
    @Override
    public void run() {
      Thread.currentThread().setName(Config.APP_NAME + "JavaFX: Open dir tooltip");
      addTooltip(openDirButton, g.getText("SEARCH_RESULT.OPEN_DIR_TOOLTIP"), -50, 35);
    }
  });
}
项目:LesPatternsDuSwag    文件:StartSplashStage.java   
public StartSplashStage(Window owner) {
    initModality(Modality.WINDOW_MODAL);
    initOwner(owner);
    initStyle(StageStyle.UTILITY);

    Text windowTitle = new Text("LPDS Parking");
    Hyperlink openLink = new Hyperlink("Open scenario");
    Hyperlink newLink = new Hyperlink("New scenario");
    Hyperlink exitLink = new Hyperlink("Exit");

    windowTitle.setFont(Font.font("Arial", FontWeight.BOLD, 14));
    exitLink.setOnAction(event -> setResult(0));
    openLink.setOnAction(event -> setResult(1));
    newLink.setOnAction(event -> setResult(2));

    VBox vbox = new VBox(windowTitle, newLink, openLink, exitLink);
    vbox.setPadding(new Insets(10));
    vbox.setSpacing(8);

    for (Node node : vbox.getChildren())
        VBox.setMargin(node, new Insets(0, 0, 0, 8));

    setScene(new Scene(vbox));
    sizeToScene();
}
项目:pipeline-gui    文件:ScriptInfoHeaderVBox.java   
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);
        }
}
项目:pipeline-gui    文件:GridPaneHelper.java   
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);
}
项目:interval-music-compositor    文件:UpdateCheckDialog.java   
private Node checkForUpdateOnStartupCheckbox() {
  HBox result = new HBox(15);
  result.paddingProperty().setValue(new Insets(10, 0, 0, 0));

  CheckBox checkBox = new CheckBox();
  checkBox.selectedProperty().bindBidirectional(userPreferences.searchUpdateAtStartupProperty());
  result.getChildren().add(checkBox);

  Label label = new Label(bundle.getString("ui.about.update.message.checkOnStartup"));
  label.getStyleClass().add("legend");
  result.getChildren().add(label);

  Hyperlink preferencesLink = new Hyperlink(bundle.getString("ui.menu.file.preferences"));
  preferencesLink.setOnAction((actionEvent) -> new PreferencesWindow(bundle, userPreferences, applicationData).show());
  preferencesLink.getStyleClass().add("legend");
  result.getChildren().add(preferencesLink);

  return result;
}
项目:interval-music-compositor    文件:UpdateCheckDialog.java   
private Node checkForUpdateOnStartupCheckbox() {
  HBox result = new HBox(15);
  result.paddingProperty().setValue(new Insets(10, 0, 0, 0));

  CheckBox checkBox = new CheckBox();
  checkBox.selectedProperty().bindBidirectional(userPreferences.searchUpdateAtStartupProperty());
  result.getChildren().add(checkBox);

  Label label = new Label(bundle.getString("ui.about.update.message.checkOnStartup"));
  label.getStyleClass().add("legend");
  result.getChildren().add(label);

  Hyperlink preferencesLink = new Hyperlink(bundle.getString("ui.menu.file.preferences"));
  preferencesLink.setOnAction((actionEvent) -> new PreferencesWindow(bundle, userPreferences, applicationData).show());
  preferencesLink.getStyleClass().add("legend");
  result.getChildren().add(preferencesLink);

  return result;
}
项目:jvarkit    文件:NgsStage.java   
/** create a hyperlink to javadoc, used in 'help' sections of javascript */
  protected Hyperlink javadocFor(final Class<?> clazz) {
String name=clazz.getName();

int dollar=name.indexOf("$");
if(dollar!=-1) name=name.substring(0,dollar);
String url;

if(name.contains("htsjdk"))
    {   
    url="https://samtools.github.io/htsjdk/javadoc/htsjdk/"+name.replace(".", "/")+".html";
    }
else if(name.startsWith("java"))
    {   
    url="https://docs.oracle.com/javase/8/docs/api/"+name.replace(".", "/")+".html";
    }
else
    {
    url="https://github.com/lindenb/jvarkit/blob/master/src/main/java/"+name.replace(".", "/")+".java";
    }
    return createHyperLink(clazz.getName(),url);
    }
项目:marathonv5    文件:HyperlinkSample.java   
public HyperlinkSample() {
    super(400,100);
    ImageView iv = new ImageView(ICON_48);
    VBox vbox = new VBox();
    vbox.setSpacing(5);
    vbox.setAlignment(Pos.CENTER_LEFT);

    Hyperlink h1 = new Hyperlink("Hyperlink");
    Hyperlink h2 = new Hyperlink("Hyperlink with Image");
    h2.setGraphic(iv);

    vbox.getChildren().add(h1);
    vbox.getChildren().add(h2);
    getChildren().add(vbox);
}
项目:marathonv5    文件:HyperlinkSample.java   
public HyperlinkSample() {
    super(400,100);
    ImageView iv = new ImageView(ICON_48);
    VBox vbox = new VBox();
    vbox.setSpacing(5);
    vbox.setAlignment(Pos.CENTER_LEFT);

    Hyperlink h1 = new Hyperlink("Hyperlink");
    Hyperlink h2 = new Hyperlink("Hyperlink with Image");
    h2.setGraphic(iv);

    vbox.getChildren().add(h1);
    vbox.getChildren().add(h2);
    getChildren().add(vbox);
}
项目:OneClient    文件:AboutPane.java   
@Override
public void onStart() {
    stuffBox.prefWidthProperty().bind(Main.mainController.contentBox.widthProperty());
    stuffBox.prefHeightProperty().bind(Main.mainController.contentBox.heightProperty());
    if (credits.getChildren().isEmpty()) {
        String yearString = "2017";
        int year = Calendar.getInstance().get(Calendar.YEAR);
        if (year > 2017) {
            yearString += "-" + year;
        }
        Text text = new Text("©" + yearString + " - HEARTH PROJECT");
        text.setStyle("-fx-fill: #FFFFFF; -fx-font-family:  'Lato', sans-serif; -fx-font-size: 12;");
        Hyperlink hyperlink = new Hyperlink("http://hearthproject.uk/");
        hyperlink.setStyle("-fx-text-fill: #FFFFFF; -fx-font-family:  'Lato', sans-serif; -fx-font-size: 12;");
        hyperlink.setOnAction(e -> openHearthSite());
        hyperlink.focusTraversableProperty().setValue(false);
        Text creditsText = new Text("\nCredits:");
        creditsText.setStyle("-fx-fill: #FFFFFF; -fx-font-family:  'Lato', sans-serif; -fx-font-size: 14; -fx-font-weight: bold");
        credits.getChildren().addAll(text, hyperlink, creditsText);
        addCredit("modmuss50 - Lead Developer", "https://twitter.com/modmuss50");
        addCredit("Prospector - UX Manager", "https://twitter.com/ProfProspector");
        addCredit("primetoxinz - Various Contributions", "https://github.com/primetoxinz");
        addCredit("loading.io - Splash Loading .gif", "https://loading.io/");
        addCredit("Yannick - Home, About, Download, Instances, and Update icons", "https://www.flaticon.com/authors/yannick");
        addCredit("Gregor Cresnar - Package icon", "https://www.flaticon.com/authors/gregor-cresnar");
        addCredit("Egor Rumyantsev - Settings icon", "https://www.flaticon.com/authors/egor-rumyantsev");
        addCredit("Icomoon - Log Out icon", "https://www.flaticon.com/authors/icomoon");
    }
}
项目:OneClient    文件:AboutPane.java   
public void addCredit(String credit, String url) {
    Hyperlink hyperlink = new Hyperlink(credit);
    hyperlink.setStyle("-fx-text-fill: #FFFFFF; -fx-font-family:  'Lato', sans-serif; -fx-font-size: 12;");
    hyperlink.setOnAction((actionEvent) -> OperatingSystem.browseURI(url));
    hyperlink.focusTraversableProperty().setValue(false);
    credits.getChildren().add(hyperlink);
}
项目:file-transfer    文件:AboutPane.java   
private void createWindow() {
    HBox contactHBox = new HBox();
    contactHBox.setAlignment(Pos.CENTER);
    Hyperlink website = new Hyperlink(PAGE_LINK);
    website.setOnAction(event -> new HtmlPage(PAGE_LINK).show());
    contactHBox.getChildren().addAll(new Label("Please visit us at"), website);
    getChildren().addAll(new Label("Version 2.0"), contactHBox);
    setAlignment(Pos.CENTER);
    setSpacing(0);
}
项目:pattypan    文件:ChooseColumnsPane.java   
/**
 * Adds checkboxes with wikitemplate fields.
 *
 * @param templateName name of wikitemplate
 * @return true, if template exists
 */
private boolean showTemplateFields(String templateName) {
  Template template = Settings.TEMPLATES.get(templateName);

  Hyperlink docLink = new Hyperlink(Util.text("choose-columns-template-doc"));
  docLink.setMinHeight(25);
  docLink.setOnAction(event -> {
    Util.openUrl("https://commons.wikimedia.org/wiki/Template:" + template.name + "/doc");
  });

  templateDescContainer.getChildren().clear();
  templateDescContainer.getChildren().add(new HBox(10,
          new WikiLabel("{{" + template.name + "}}").setClass("header").setAlign("left"),
          docLink
  ));
  templateDescContainer.getChildren().add(new WikiLabel("choose-columns-template-intro").setAlign("left").setHeight(70));

  HBox headersContainer = new HBox(10);
  headersContainer.getChildren().addAll(
          new WikiLabel("choose-columns-fields-name").setClass("bold").setWidth(200, 495).setHeight(35),
          new WikiLabel("choose-columns-radio-buttons").setClass("bold").setWidth(150).setHeight(35),
          new WikiLabel("choose-columns-value").setClass("bold").setWidth(50, 500).setHeight(35));
  templateDescContainer.getChildren().add(headersContainer);

  for (TemplateField tf : template.variables) {
    templateDescContainer.getChildren().add(tf.getRow());
  }
  return true;
}
项目:pattypan    文件:CheckPane.java   
/**
 * Shows details of selected file
 *
 * @param ue
 */
private void setDetails(UploadElement ue, Hyperlink label) {

  WikiLabel title = new WikiLabel(ue.getData("name")).setClass("header").setAlign("left");
  WikiLabel path = new WikiLabel(ue.getData("path")).setAlign("left");
  Hyperlink pathURL = new Hyperlink(ue.getData("path"));
  Hyperlink preview = new Hyperlink(Util.text("check-preview"));
  WikiLabel wikitext = new WikiLabel(ue.getWikicode()).setClass("monospace").setAlign("left");

  prevLabel.getStyleClass().remove("bold");
  prevLabel = label;
  prevLabel.getStyleClass().add("bold");

  preview.setOnAction(event -> {
    try {
      Util.openUrl(Session.WIKI.getProtocol() + Session.WIKI.getDomain() + "/wiki/Special:ExpandTemplates"
              + "?wpRemoveComments=true"
              + "&wpInput=" + URLEncoder.encode(ue.getWikicode(), "UTF-8")
              + "&wpContextTitle=" + URLEncoder.encode(ue.getData("name"), "UTF-8"));
    } catch (UnsupportedEncodingException ex) {
      Logger.getLogger(CheckPane.class.getName()).log(Level.SEVERE, null, ex);
    }
  });

  pathURL.setOnAction(event -> {
    Util.openUrl(ue.getData("path"));
  });

  detailsContainer.getChildren().clear();

  if (ue.getData("path").startsWith("https://") || ue.getData("path").startsWith("http://")) {
    detailsContainer.getChildren().addAll(title, pathURL, preview, wikitext);
  } else {
    detailsContainer.getChildren().addAll(title, path, getScaledThumbnail(ue.getFile()), preview, wikitext);
  }
}
项目:lernplattform-crawler    文件:AboutAlert.java   
private Node getHyperlinkLine() {
    FlowPane hyperlinkContainer = new FlowPane();
    Hyperlink hyperlink = getHyperlink();
    Label description = new Label(BUNDLE.getString("menu.about.getSource"));
    hyperlinkContainer.getChildren().addAll(description, hyperlink);
    hyperlinkContainer.setAlignment(Pos.CENTER);
    return hyperlinkContainer;
}
项目:arma-dialog-creator    文件:LanguageSelectionPane.java   
private void removeLanguage(@NotNull Language language) {
    Hyperlink remove = null;
    for (Hyperlink hyperlink : links) {
        if (hyperlink.getUserData() == language) {
            remove = hyperlink;
            break;
        }
    }
    if (remove != null) {
        links.remove(remove);
        getChildren().remove(remove);
    }
}
项目:arma-dialog-creator    文件:LanguageSelectionPane.java   
private boolean containsLanguage(@NotNull Language language) {
    for (Hyperlink hyperlink : links) {
        if (hyperlink.getUserData().equals(language)) {
            return true;
        }
    }
    return false;
}
项目:photometric-data-retriever    文件:HyperlinkCellFactory.java   
@Override
public TableCell<S, Hyperlink> call(TableColumn<S, Hyperlink> arg) {
    return new TableCell<S, Hyperlink>() {
        @Override
        protected void updateItem(Hyperlink item, boolean empty) {
            setGraphic(item);
        }
    };
}
项目:openjfx-8u-dev-tests    文件:HyperlinkApp.java   
@Override
protected Scene getScene() {
    return new LabeledsApp.LabeledScene() {

        @Override
        protected Labeled getTestedLabeled() {
            return new Hyperlink();
        }
    };
}