net.sf.okapi.common.Util.openURL()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(258)

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

Util.openURL介绍

[英]Opens the specified page in a web browser (Java 1.5 compatible).

This is based on the public domain class BareBonesBrowserLaunch from Dem Pilafian at (www.centerkey.com/java/browser)
[中]在web浏览器中打开指定页面(兼容Java 1.5)。
这是基于Dem Pilafian的公共域类BareBonesBrowserLaunch的({www.centerkey.com/java/browser

代码示例

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

  1. /**
  2. * Opens a given topic of the OkapiWiki.
  3. * @param topic the title of the topic/page.
  4. */
  5. public static void openWikiTopic (String topic) {
  6. try {
  7. // Resolve spaces
  8. topic = topic.replace(' ', '_');
  9. //TODO: get the base URL from a properties file
  10. Util.openURL(new URL(String.format("http://okapiframework.org/wiki/index.php?title=%s", topic)).toString());
  11. }
  12. catch ( MalformedURLException e ) {
  13. e.printStackTrace();
  14. }
  15. }

代码示例来源:origin: net.sf.okapi.steps/okapi-step-termextraction

  1. @Override
  2. protected Event handleEndBatch (Event event) {
  3. extractor.completeExtraction();
  4. String finalPath = Util.fillRootDirectoryVariable(params.getOutputPath(), rootDir);
  5. LOGGER.info("Output: {}", finalPath);
  6. LOGGER.info("Candidate terms found = {}", extractor.getTerms().size());
  7. if ( params.getAutoOpen() ) {
  8. Util.openURL((new File(finalPath)).getAbsolutePath());
  9. }
  10. return event;
  11. }

代码示例来源:origin: net.sf.okapi.steps/okapi-step-translationcomparison

  1. @Override
  2. protected Event handleEndBatch (Event event) {
  3. matcher = null;
  4. if ( writer != null ) {
  5. writer.close();
  6. writer = null;
  7. }
  8. if ( prnWriter != null ) {
  9. prnWriter.close();
  10. prnWriter = null;
  11. }
  12. if ( tmx != null ) {
  13. tmx.writeEndDocument();
  14. tmx.close();
  15. tmx = null;
  16. }
  17. Runtime.getRuntime().gc();
  18. if ( params.isAutoOpen() && ( pathToOpen != null )) {
  19. Util.openURL((new File(pathToOpen)).getAbsolutePath());
  20. }
  21. return event;
  22. }

代码示例来源:origin: net.sf.okapi.steps/okapi-step-gttbatchtranslation

  1. Util.openURL("http://translate.google.com/toolkit/workbench?did="+docId);

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui

  1. private void generateReport () {
  2. try {
  3. startWaiting("Generating report...");
  4. String rootDir = (qcsPath==null ? null : Util.getDirectoryName(qcsPath));
  5. session.generateReport(rootDir);
  6. String finalPath = Util.fillRootDirectoryVariable(session.getParameters().getOutputPath(), rootDir);
  7. if ( session.getParameters().getAutoOpen() ) {
  8. Util.openURL((new File(finalPath)).getAbsolutePath());
  9. }
  10. }
  11. catch ( Throwable e ) {
  12. Dialogs.showError(shell, "Error while generating report.\n"+e.getMessage(), null);
  13. }
  14. finally {
  15. stopWaiting();
  16. }
  17. }

代码示例来源:origin: net.sf.okapi.steps/okapi-step-rainbowkit

  1. Util.openURL("file:///"+reportPath);

相关文章