org.eclipse.swt.browser.Browser.setUrl()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(222)

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

Browser.setUrl介绍

[英]Begins loading a URL. The loading of its content occurs asynchronously.
[中]开始加载URL。其内容的加载以异步方式进行。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private void home() {
 wBrowser.setUrl( homeURL != null ? homeURL : url );
}

代码示例来源:origin: pentaho/pentaho-kettle

private void print() {
 String printURL = wBrowser.getUrl();
 if ( printURL.startsWith( PREFIX ) ) {
  printURL = printURL.replace( PREFIX, PRINT_PREFIX );
  fromPrint = true;
  wBrowser.setUrl( printURL );
 } else {
  wBrowser.execute( PRINT_SCRIPT );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

browser.setUrl( url );
lastNavigateURL = url;

代码示例来源:origin: pentaho/pentaho-kettle

public void createDialog( String title, String url, int options, Image logo ) {
 Shell parent = getParent();
 display = parent.getDisplay();
 dialog = new Shell( parent, options );
 dialog.setText( title );
 dialog.setImage( logo );
 dialog.setSize( width, height );
 dialog.setLayout( new FillLayout() );
 try {
  browser = new Browser( dialog, SWT.NONE );
  browser.setUrl( url );
  browser.addCloseWindowListener( new CloseWindowListener() {
   @Override
   public void close( WindowEvent event ) {
    Browser browser = (Browser) event.widget;
    Shell shell = browser.getShell();
    shell.close();
   }
  } );
 } catch ( Exception e ) {
  MessageBox messageBox = new MessageBox( dialog, SWT.ICON_ERROR | SWT.OK );
  messageBox.setMessage( "Browser cannot be initialized." );
  messageBox.setText( "Exit" );
  messageBox.open();
 }
 setPosition();
 dialog.open();
}

代码示例来源:origin: pentaho/pentaho-kettle

browser.setUrl( stringUrl );
} else {
 browser.setText( stringUrl );

代码示例来源:origin: pentaho/pentaho-kettle

browser.setUrl( url );

代码示例来源:origin: pentaho/pentaho-kettle

fdBrowser.left = new FormAttachment( 0, 0 );
wBrowser.setLayoutData( fdBrowser );
wBrowser.setUrl( url );

代码示例来源:origin: org.eclipse/org.eclipse.help.ui

public void showURL(String url) {
  if (browser != null && url != null) {
    browser.setUrl(url);
  }
}

代码示例来源:origin: eclipse-color-theme/eclipse-color-theme

private void updateDetails(ColorTheme theme) {
  if (theme == null)
    themeDetails.setVisible(false);
  else {
    authorLabel.setText("Created by " + theme.getAuthor());
    String website = theme.getWebsite();
    if (website == null || website.length() == 0)
      websiteLink.setVisible(false);
    else {
      websiteLink.setText("<a>" + website + "</a>");
      for (Listener listener : websiteLink.getListeners(
          SWT.Selection))
        websiteLink.removeListener(SWT.Selection, listener);
      setLinkTarget(websiteLink, website);
      websiteLink.setVisible(true);
    }
    String id = theme.getId();
    Browser browser = getBrowser();
    if (browser != null)
      browser.setUrl(
        "http://www.eclipsecolorthemes.org/static/themes/java/"
        + id + ".html");
    themeDetails.setVisible(true);
    authorLabel.pack();
    websiteLink.pack();
  }
}

代码示例来源:origin: openaudible/openaudible

@Override
  public void task() {
    try {
      browser.browser.setUrl(url);
      waitForCallback(task);
    } catch (Throwable th) {
      logger.error("error getPage:" + url, th);
    }
  }
});

代码示例来源:origin: org.eclipse/org.eclipse.jst.pagedesigner

public synchronized void loadFile(File file) {
  if (_browser == null) {
    return;
  }
  _file = file;
  String s = "file:" + file.getAbsolutePath();
  _browser.setUrl(s);
  return;
}

代码示例来源:origin: org.xworker/xworker_swt

public void run(){
    Browser browser = (Browser) actionContext.get("browser");
    if(isWebControl){
      browser.setUrl(GlobalConfig.getWebUrl() + "do?sc=" + url);
    }else{
      browser.setUrl(url);
    }
    layout("browserComposite");
  }
});

代码示例来源:origin: org.xworker/xworker_swt

public static void openValueUrl(Browser valueText, String url, boolean isOuterUrl){
  World world = World.getInstance();
    if(isOuterUrl){
    valueText.setUrl(url);
  }else{
    Thing globalCfg = world.getThing("_local.xworker.config.GlobalConfig");
    valueText.setUrl(globalCfg.getString("webUrl") + url);
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.help.ui

public void displayUrl(String url) {
  browser.setUrl(url);
  shell.setMinimized(false);
  shell.forceActive();
}
private void displayURLExternal(WindowEvent e) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.intro

public void staticStandbyStateChanged(boolean standby) {
  AbstractIntroPage homePage = getModel().getHomePage();
  AbstractIntroPage standbyPage = getModel().getStandbyPage();
  if (standbyPage == null)
    standbyPage = homePage;
  if (standby)
    browser.setUrl(standbyPage.getUrl());
  else
    browser.setUrl(homePage.getUrl());
}

代码示例来源:origin: org.xworker/xworker_swt

public static void openUrl(ActionContext actionContext){
    Thing self = actionContext.getObject("self");
    
    Browser browser = (Browser) self.doAction("getBrowser", actionContext);
    String url = (String) self.doAction("getUrl", actionContext);
    
    if(browser != null && url != null){
      browser.setUrl(url);
    }else{
      logger.info("browser or url is null, action=" + self.getMetadata().getPath());
    }
  }
}

代码示例来源:origin: org.xworker/xworker_swt

public static void setValue(ActionContext actionContext){
  Thing self = (Thing) actionContext.get("self");
  
  final Browser browser = (Browser) self.getAttribute("browser");
  //设置浏览器应该显示的内容
  String value = (String) actionContext.get("value");
  String url = GlobalConfig.getThingDescUrl(value);
  browser.setUrl(url);
}

代码示例来源:origin: org.xworker/xworker_swt

public static void setThing(ActionContext actionContext){
    //World world = World.getInstance();
    Browser browser = (Browser) actionContext.get("browser");
    Thing thing = (Thing) actionContext.get("thing");
    if(thing != null){
      String webUrl = XWorkerUtils.getThingDescUrl(thing);
        browser.setUrl(webUrl);
    }else{
      browser.setText("Thing not exists");
    }
  }
}

代码示例来源:origin: org.xworker/xworker_swt

public static void setThing(ActionContext actionContext){
    Thing thing = actionContext.getObject("thing");
    Browser browser = actionContext.getObject("browser");
    
    if(thing != null){
      browser.setUrl(XWorkerUtils.getThingDescUrl(thing));
    }else{
      browser.setText("Thing is null");
    }
  }
}

代码示例来源:origin: org.xworker/xworker_swt

public static void selection(ActionContext actionContext) throws OgnlException{
    World world = World.getInstance();
    Event event = (Event) actionContext.get("event");
    
    Thing globalCfg = world.getThing("_local.xworker.config.GlobalConfig");
    String name = (String) Ognl.getValue("name",event.item.getData());
    String url = globalCfg.getString("webUrl") + "do?sc=xworker.ide.worldExplorer.swt.http.ClassDoc/@clsDoc&className=" + name;
    ((Browser) actionContext.get("browser")).setUrl(url);

    actionContext.getScope(0).put("selectedClassName", name);
  }
}

相关文章