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

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

本文整理了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

/**
 * Opens a given topic of the OkapiWiki.
 * @param topic the title of the topic/page.
 */
public static void openWikiTopic (String topic) {
  try {
    // Resolve spaces
    topic = topic.replace(' ', '_');
    //TODO: get the base URL from a properties file
    Util.openURL(new URL(String.format("http://okapiframework.org/wiki/index.php?title=%s", topic)).toString());
  }
  catch ( MalformedURLException e ) {
    e.printStackTrace();
  }
}

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

@Override
protected Event handleEndBatch (Event event) {
  extractor.completeExtraction();
  String finalPath = Util.fillRootDirectoryVariable(params.getOutputPath(), rootDir);
  LOGGER.info("Output: {}", finalPath);
  LOGGER.info("Candidate terms found = {}", extractor.getTerms().size());
  if ( params.getAutoOpen() ) {
    Util.openURL((new File(finalPath)).getAbsolutePath());
  }
  return event;
}

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

@Override
protected Event handleEndBatch (Event event) {
  matcher = null;
  if ( writer != null ) {
    writer.close();
    writer = null;
  }
  if ( prnWriter != null ) {
    prnWriter.close();
    prnWriter = null;
  }
  if ( tmx != null ) {
    tmx.writeEndDocument();
    tmx.close();
    tmx = null;
  }
  Runtime.getRuntime().gc();
  if ( params.isAutoOpen() && ( pathToOpen != null )) {
    Util.openURL((new File(pathToOpen)).getAbsolutePath());
  }
  
  return event;
}

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

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

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

private void generateReport () {
  try {
    startWaiting("Generating report...");
    String rootDir = (qcsPath==null ? null : Util.getDirectoryName(qcsPath));
    session.generateReport(rootDir);
    String finalPath = Util.fillRootDirectoryVariable(session.getParameters().getOutputPath(), rootDir);
    if ( session.getParameters().getAutoOpen() ) {
      Util.openURL((new File(finalPath)).getAbsolutePath());
    }
  }
  catch ( Throwable e ) {
    Dialogs.showError(shell, "Error while generating report.\n"+e.getMessage(), null);
  }
  finally {
    stopWaiting();
  }
}

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

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

相关文章