swt

How to get HTML from the browser in SWT after setting the URL

若如初见. 提交于 2019-12-22 10:10:10
问题 I have tried using String html = browser.getText(); But I am getting this error Exception in thread "main" org.eclipse.swt.SWTException: Failed to change Variant type result = -2147352571 at org.eclipse.swt.ole.win32.OLE.error(Unknown Source) at org.eclipse.swt.ole.win32.Variant.getAutomation(Unknown Source) at org.eclipse.swt.browser.IE.getText(Unknown Source) at org.eclipse.swt.browser.Browser.getText(Unknown Source) I have read this bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id

JFace ColumnWeigthData causes parent to grow

空扰寡人 提交于 2019-12-22 09:45:42
问题 I got an Eclipse RCP app and want to use dynamic column size in a TableViewer using ColumnWeigthData as ColumnLayoutData . Problem is that the parent form ( ScrolledForm in example code) grows a few pixels whenever I layout the table. To reproduce you can run the example and open/close the Section a few times. On every close the section gets wider. Why does it do this and how can I make it stop? package com.test; import org.eclipse.jface.layout.TableColumnLayout; import org.eclipse.jface

SWT layout problem - padding for labels possible?

时光毁灭记忆、已成空白 提交于 2019-12-22 09:02:59
问题 I am using GridLayout in my SWT GUI app. I have the following GridData defined for each grid cell. The grid cell itself is just a label. GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; gridData.grabExcessVerticalSpace = true; gridData.heightHint = 25; gridData.widthHint = 25; gridData.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER; gridData.verticalIndent = 10; And I create each lable element like this - Label l

SWT: single vs. multiple displays

拈花ヽ惹草 提交于 2019-12-22 08:48:36
问题 SWT is designed to support multiple Display instances, each one with its own event loop. For what purpose this is useful or required? Isn't one Display instance (e.g. Display.getDefault() sufficient? 回答1: The docs for the Display class says "Applications which are built with SWT will almost always require only a single display". The Display instance is closely tied to the UI thread, and has certain restrictions on it in order to allow the SWT event model to work on top of the native UI event

Making composite focusable in SWT

眉间皱痕 提交于 2019-12-22 02:32:07
问题 Is it possible to create a focusable composite in SWT? I'm catching all keyboard events via Display filter, but there are some problems when the focus is on the tree or list - GTK+'s default action is to search in the contents of the control. What I want to do is to mix SWT and AWT with focusable AWT component. I managed to make the AWT widget unfocusable and I added Display filter to make the AWT component receiving keyboard events (but not directly), even when it's not focused. But there

Rename a treeViewer Node with SWT

假如想象 提交于 2019-12-22 00:27:12
问题 I have a treeViewer on which I have to implement editing for renaming that should be able to be invoked in two ways: by the F2 key by a single mouse click if a node is selected. More ever as Windows allows folder rename. For this, I have used ICellModifier , but it has not given the expected result. By the following code, I have achieved point number 2 though it is creating a problem for opening the editor on a double click if a node is selected. The main concern is to allow the F2 key for

Tooltip in other colums with Java SWT?

狂风中的少年 提交于 2019-12-21 23:52:15
问题 I have a table with 4 columns. I try to integrate a ToolTip for all cells of the third column. With my Code the ToolTip only appears for the cells of the first column. This is my Code: protected void checkAction() throws Exception { System.out.println("Start Test"); //Erstellen einer neuen Shell final Shell shell = new Shell(); shell.setSize(280, 300); shell.setText("Testtabelle"); //Erstellen einer neuen Tabelle final Table table = new Table(shell, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION

Java SWT TreeViewer with one column that needs to be StyledText

こ雲淡風輕ζ 提交于 2019-12-21 21:20:05
问题 I have a TreeViewer used in an eclipse plugin that uses a content provider and a label provider that implements all of ( ITableLabelProvider , IFontProvider , IColorProvider ). But I need one of the columns of the table it creates to hold "links" - underlined blue text that when clicked causes some popup to open. I guess what I want to do is cause that single column to hold styled text and not just text, and attach a listener to the items in that column of the tree, but I couldn't figure out

Java based Swing Browser should support JavaScript

断了今生、忘了曾经 提交于 2019-12-21 20:49:19
问题 In my company, I am implementing a java based html browser. I found a lot of tools to generate complete browsers only in Swing which are looking like Mozilla. But I was not able to find a browser which supports JavaScript. The browser I will implement should execute JavaScript inside the HTML sides. Do you know of a tool that supports this? Or do you know of a parser which pairs the javascript to something I can use inside the html browser? I know that the eclipse plugins can handle

Eclipse XWT in production?

坚强是说给别人听的谎言 提交于 2019-12-21 20:35:32
问题 Have anybody used Eclipse XWT in non-trivial (e.g. something more complex then tutorial) environment? I don't think Eclipse4 uses it by itself. Does it really have any advantages over SWT? 回答1: XWT is a declarative UI framework. It allows you to model your UI. You don't need to write code to instantiate, design, layout and data-bind your SWT widgets. Instead a XML based description file is used to build the UI. Take a look at the example from the XWT FAQ: http://wiki.eclipse.org/E4/XWT#Layout