本文整理汇总了Java中org.eclipse.swt.browser.Browser.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java Browser.setSize方法的具体用法?Java Browser.setSize怎么用?Java Browser.setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.browser.Browser
的用法示例。
在下文中一共展示了Browser.setSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
}
示例2: initializeBrowser
import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
private void initializeBrowser(Composite parent){
m_browser = new Browser(parent, SWT.BORDER);
GridData browserGrid = new GridData();
browserGrid.horizontalSpan = 2;
m_browser.setLayoutData(browserGrid);
m_browser.setSize(800, 400);
MainProcessor.instance().displayContent(null);
}
示例3: 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;
}