当前位置: 首页>>代码示例>>Java>>正文


Java Browser.setUrl方法代码示例

本文整理汇总了Java中org.eclipse.swt.browser.Browser.setUrl方法的典型用法代码示例。如果您正苦于以下问题:Java Browser.setUrl方法的具体用法?Java Browser.setUrl怎么用?Java Browser.setUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.browser.Browser的用法示例。


在下文中一共展示了Browser.setUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void start(final IApplicationLifecycle lifecycle) {
    //create the root frame
    final IFrame frame = Toolkit.createRootFrame(BPF.frame("JoToSwt Snipped"), lifecycle);
    frame.setSize(1024, 768);
    frame.setLayout(FillLayout.get());

    //create a regular jo composite
    final IComposite joComposite = frame.add(BPF.composite());

    //get the native ui reference which must be a swt composite
    //because swt SPI impl is used
    final Composite swtComposite = (Composite) joComposite.getUiReference();
    swtComposite.setLayout(new org.eclipse.swt.layout.FillLayout());

    //create a swt browser
    final Browser browser = new Browser(swtComposite, SWT.NONE);
    browser.setUrl("http://www.jowidgets.org/");

    //set the root frame visible
    frame.setVisible(true);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:23,代码来源:JoToSwtSnipped.java

示例2: createPartControl

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	GridLayoutFactory.fillDefaults().numColumns(1).applyTo(parent);
	parent.setLayoutData(new GridData(GridData.FILL_BOTH));
	cmp = new Composite(parent, SWT.BORDER);
	GridLayoutFactory.fillDefaults().numColumns(1).applyTo(cmp);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(cmp);
	
	browser = new Browser(cmp, SWT.NONE);
	browser.setLayoutData(new GridData(GridData.FILL_BOTH));
	browser.setUrl(htmlUrl);

	browser.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDown(MouseEvent e) {
			getSite().getPart().setFocus();
			super.mouseDown(e);
		}
	});
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:21,代码来源:HtmlBrowserEditor.java

示例3: display

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 * Displays the specified url using eclipse SWT browser.
 * 
 * @param report
 *            report report
 * @param format
 *            report format
 * @param browser
 *            SWT browser instance
 * @param servletName
 *            servlet name to viewer report
 * @deprecated
 */
public static void display( String report, String format, Browser browser,
		String servletName )
{
	checkAdapter( );

	startWebApp( DEFAULT_WEBAPP.getName( ), report );
	browser.setUrl( createURL( DEFAULT_WEBAPP.getName( ),
			servletName,
			report,
			format,
			null,
			null,
			null,
			null ) + "&" + random.nextInt( ) ); //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:29,代码来源:WebViewer.java

示例4: IntroComposite

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 * Create the composite.
 * @param parent
 * @param style
 */
public IntroComposite(Composite parent, int style) {
	super(parent, style);
	setLayout(new FillLayout(SWT.HORIZONTAL));
	
	Bundle plugin = Activator.getDefault().getBundle();
	
	try {
		// Cache entire folder
		// (needed in product export, to cache files, so it is possible to
		// reference them)
		URL folder = FileLocator.find(plugin, new Path("html/"), null);
		FileLocator.toFileURL(folder);
		
		IPath relativePagePath = new Path("html/intro.html");
		URL fileInPlugin = FileLocator.find(plugin, relativePagePath, null);
		introUrl = FileLocator.toFileURL(fileInPlugin);
		Browser browser = new Browser(this, SWT.NONE);
		browser.setUrl(introUrl.toString());
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:30,代码来源:IntroComposite.java

示例5: ApiTab

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
public ApiTab(CTabFolder tabFolder)
{
    super(tabFolder, SWT.NONE);
    String userDir = System.getProperty("user.dir");
    File folder = new File(userDir,"api");
    if(!folder.exists()) {
        folder.mkdirs();
    }
    for (String f : new String[] {"index.html","leftbar.html","content.html"}){
        localApiFile(folder,f);   
    }
    setText(" SSDB API ");
    setShowClose(true);
    Browser browser = new Browser(tabFolder, SWT.NONE);
    browser.setLayoutData(new FillLayout());
    String url = new File(folder,"index.html").getPath();
    browser.setUrl(url);  
    this.setControl(browser);
    
    tabFolder.setSelection(this);
}
 
开发者ID:ihaiker,项目名称:SSDBAdmin,代码行数:22,代码来源:ApiTab.java

示例6: createPartControl

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent){
	browser = new Browser(parent, SWT.NONE);
	browser.addLocationListener(new LocationAdapter() {
		
		@Override
		public void changed(LocationEvent arg0){
			String text = getText(arg0.location);
			System.out.println(text);
		}
		
	});
	// browser.setUrl("http://ch.oddb.org");
	browser.setUrl("http://santesuisse.oddb.org/");
	
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:ODDBView.java

示例7: MapGUI

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 * Create the composite.
 * @param parent
 * @param style
 */
public MapGUI(Composite parent, int style, String url) {
	super(parent, style);
	
	Browser browser = new Browser(this, SWT.NONE);
	browser.setUrl(url);
	browser.setBounds(10, 10, 518, 518);

}
 
开发者ID:Celethor,项目名称:CS360proj1,代码行数:14,代码来源:MapGUI.java

示例8: LogComposite

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 * Basic constructor for launching the composite of the LogWindow.
 * @param parent The windows this composite belongs to.
 * @param shell The current Shell.
 * @param display The current Display.
 * @param style The style for this composite.
 */
public LogComposite(LogWindow parent, Shell shell, Display display, int style) {
	// General initialization.
	super(shell, style);
	this.parent = parent;
	this.shell = shell;
	this.display = display;

	// Layout.
	this.setLayout(new FillLayout());

	// Components.
	try {
		Browser logBrowser = new Browser(this, SWT.BORDER);
		logBrowser.setSize(1000, 740);
		logBrowser.setUrl(Globals.getInst().currentLogfile);

		// Listener.
		this.addKeyListener(new EscKeyListener(parent));
		logBrowser.addKeyListener(new EscKeyListener(parent));

		// Finish setting up the composite.
		this.pack();
	} catch (SWTError e) {
		StaticGuiSupport.showMessageBox(shell, "Error",
				"Cannot show the log file. No browser is available.", SWT.OK | SWT.ICON_ERROR);
		parent.doExit();
	}
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:36,代码来源:LogComposite.java

示例9: createPartControl

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(final Composite parent) {
    final BrowserEditorInput input = (BrowserEditorInput) getEditorInput();

    setPartName(input.getName());
    setTitleToolTip(input.getToolTipText());

    parent.setLayout(new FillLayout());

    final Browser browser = new Browser(parent, getBrowserStyle());
    browser.setUrl(input.getURL());
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:13,代码来源:BrowserEditor.java

示例10: createPartControl

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
  feedbackHandlerUrl = FeedbackPreferences.getString(FeedbackPreferences.FEEDBACK_HANDLER__URL);

  browser = new Browser(parent, SWT.NONE);
  browser.setJavascriptEnabled(true);
  browser.setUrl(feedbackHandlerUrl);
}
 
开发者ID:sealuzh,项目名称:PerformanceHat,代码行数:9,代码来源:FeedbackHandlerWebClient.java

示例11: createBrowser

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
protected Browser createBrowser(final Shell shell) {
	final Browser browser = new Browser(shell, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(browser);
	final URL pageUrl = getMapPage(shell);
	browser.setUrl(pageUrl != null ? pageUrl.toString() : "");
	return browser;
}
 
开发者ID:Albertus82,项目名称:JFaceUtils,代码行数:8,代码来源:MapDialog.java

示例12: sendDownload

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
public boolean sendDownload( Shell parentShell, File file ) throws FileNotFoundException, IOException {
    byte[] data = IOUtils.toByteArray(new FileInputStream(file));
    DownloadService service = new DownloadService(data, file.getName());
    service.register();

    final Browser browser = new Browser(parentShell, SWT.NONE);
    browser.setSize(0, 0);
    browser.setUrl(service.getURL());

    return true;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:12,代码来源:DownloadUtils.java

示例13: createWidget

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public Object createWidget(MUIElement element, Object parent) {
	BrowserPart part = (BrowserPart) element;
	String uri = part.getUri();
	final Composite mapComposite = new Composite((Composite) parent,
			SWT.NONE);
	System.out.println(parent.getClass());
	mapComposite.setLayout(new GridLayout(1, false));
	final Browser browser = new Browser(mapComposite, SWT.NONE);
	browser.setUrl(uri);
	GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
	browser.setLayoutData(data);
	return mapComposite;
}
 
开发者ID:scela,项目名称:EclipseCon2014,代码行数:15,代码来源:BrowserPartRenderer.java

示例14: IntroComposite

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 * Create the composite.
 * @param parent
 * @param style
 */
public IntroComposite(Composite parent, int style) {
	super(parent, style);
	setLayout(new FillLayout(SWT.HORIZONTAL));
	
	Bundle plugin = Activator.getDefault().getBundle();
	
	try {
		// Cache entire folder
		// (needed in product export, to cache files, so it is possible to
		// reference them)
		URL folder = FileLocator.find(plugin, new Path("resources/html/"), null);
		FileLocator.toFileURL(folder);
		
		IPath relativePagePath = new Path("resources/html/intro.html");
		URL fileInPlugin = FileLocator.find(plugin, relativePagePath, null);
		introUrl = FileLocator.toFileURL(fileInPlugin);
		Browser browser = new Browser(this, SWT.NONE);
		browser.setUrl(introUrl.toString());
		
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}


}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:32,代码来源:IntroComposite.java

示例15: widgetSelected

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
public void widgetSelected(SelectionEvent e)
{
	Control c = folder.getSelection().getControl();
	if (c instanceof Browser)
	{
		Browser browser = (Browser) c;
		browser.setUrl(map.get(browser));
	}
}
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:10,代码来源:MultiView.java


注:本文中的org.eclipse.swt.browser.Browser.setUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。