本文整理匯總了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;
}