當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。