swt

JFace TableViewer - Setting font color for all Cells in table

自作多情 提交于 2020-01-05 07:47:12
问题 I have asked a very similar question, but I ended up using images instead of changing the color. I want all the text in the cells to be dark grey. I understand that you have to assign each column. But I do not how to do it. This is one of my columns in my TableViewer. col = new TableViewerColumn(this , SWT.NONE); col.getColumn().setWidth(200); col.getColumn().setText("Printer/Profile"); col.setLabelProvider(new ColumnLabelProvider() { @Override public String getText(Object element) {

How to get the handle of SWT control in Mac 64 bit cocoa enviornment?

我怕爱的太早我们不能终老 提交于 2020-01-05 05:01:13
问题 I have one Eclipse based RCP application in which I need to pass the SWT Control handles to native code to paint something on it. I have the following code to get the handle of any SWT control: public static int getControlHandle(Control c){ int handle = 0; try { if(_isMACOS){ if(_viewField== null) _viewField = Control.class.getDeclaredField("view"); Object view = _viewField.get(c); if(_idField== null) { Class<?>idClass = Class.forName("org.eclipse.swt.internal.cocoa.id"); _idField = idClass

SWT Tree and TreeItem: Remove or change the drawing behavior of the expand/collapse indicator

放肆的年华 提交于 2020-01-05 04:41:10
问题 I'm working in SWT (no JFace), and I'm attempting to customize the behavior of a Tree that I'm using a sidebar. The top-level items in the tree shouldn't be selectable; they're basically headers. Only the children of these items should be selectable. As a result, I would like the UI to behave in a way that indicates this; clicking on one of these top-level items should expand or collapse but shouldn't provide any sort of visual feedback outside of the indicator changing its state and the

eclipse rcp : how to block ui while running a job in background

大憨熊 提交于 2020-01-05 03:36:12
问题 I have a test button in a Dialog, when user click that button, my application will try to connect to a database via JDBC. For some testing cases this job will take a long while to give response to user, network connection timeout for instance. I do this by attaching a listener to that button and connect to database in that listener. when connecting, the user interface will not response until the connecting job is finished. Any user action ocurrs while connecting will take effect after

Java SWT Text control not showing until Shell resize

自古美人都是妖i 提交于 2020-01-05 03:31:25
问题 My attempt here is basically to hot-switch a component while the program is running. If the user presses a button then the control that is a browser turns into a Text control. I use a control to point to the browser and then switch it to point to the Text control(which is drawn offscreen on a non-showing shell) However, I'm having some issues. Currently when the button is pressed the browser disappears but nothing appears in it's place until the shell is resized. Here are the relevant code

Eclipse force handlers to to re-evaluate

本秂侑毒 提交于 2020-01-04 08:16:52
问题 How can I force Eclipse to do a re-evaluation of the activeWhen-conditions of all handlers? Situation: I have defined a command on a TreeViewer. This command has more than one possible handlers. Handlers have defined some conditions to decide whether the handler shall be activated or not. My problem is that there is no re-evaluation of the handler conditions until I de-seclect the item in the tree (e.g. select another item) and select it again. If the selection does not change but the raise

Opening a Word document with .doc extension with Eclipse SWT OleClientSite in Java

两盒软妹~` 提交于 2020-01-04 06:35:37
问题 I'm working on a program that uses the Eclipse SWT OleClientSite (in Windows 7) to open a Word document inside an RCP application. For the past two years, this program has called the following constructor: OleClientSite clientSite = new OleClientSite(oleFrame, SWT.NULL, new File(documentFileName)); Since the latest update to SWT, this constructor now throws an exception when attempting to open Word documents with a ".doc" extension. Word documents with a ".docx" extension are still

Android SDK not working

隐身守侯 提交于 2020-01-04 05:15:34
问题 The Android SDK doesn't open so i tried to open Android.bat to see the errors and I get this Error: The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. Error: Could not find or load main class com.android.sdkmanager.Main Press any key to continue . . . Here is my Environment Variables: ANDROID_SWT: C:\adt-bundle-windows-x86\sdk\tools\lib\x86. JAVA_HOME: C:\Program Files\Java

Running SWT components within a Swing App

妖精的绣舞 提交于 2020-01-04 04:46:06
问题 I was wondering if anybody had any experience trying to run a complex SWT UI hosted inside a Swing component. I've managed to get a very simple demo going but if anyone else has tried and failed / succeeded to do this it'd be great to learn from their experiences. So to reiterate my application is a Swing app I wish to make use of a complex SWT UI component (drag and drop, popup windows and dialogs) - anybody managed this? 回答1: I've used both Swing and SWT, although never in the same

Unable to load image from Jar

时光总嘲笑我的痴心妄想 提交于 2020-01-04 04:30:47
问题 I'm trying to load an image from a Jar File. Here's the line: Image imgTrayIcon = new Image(display, this.getClass().getResourceAsStream("icon.ico")); I've seen many examples using this method but when I try to do so, I get and error saying that my image is invalid. Here's the stack trace: [java] Exception in thread "Thread-0" org.eclipse.swt.SWTException: Invalid image [java] at org.eclipse.swt.SWT.error(SWT.java:4083) [java] at org.eclipse.swt.SWT.error(SWT.java:3998) [java] at org.eclipse