本文整理汇总了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);
}
示例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);
}
});
}
示例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$
}
示例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();
}
}
示例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);
}
示例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/");
}
示例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);
}
示例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();
}
}
示例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());
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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));
}
}