Java Code Examples for org.eclipse.swt.browser.Browser#addMouseListener()
The following examples show how to use
org.eclipse.swt.browser.Browser#addMouseListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HtmlBrowserEditor.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
@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); } }); }
Example 2
Source File: HtmlBrowserEditor.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
@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); } }); }