FAQ Database Discussion Community


SWT table with fixed height

java,swt
I have a simple SWT table like this, with an initial height of 60px: Table table = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION); GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1); gd_table.heightHint = 60; table.setLayoutData(gd_table); table.setHeaderVisible(true); I'm programmatically adding rows, when a new row is added the height of...

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

java,osx,cocoa,swt
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){...

How to add html code to the table column header in Eclipse RAP

swt,jface,eclipse-rap
I'm trying to add a div to the table column header, but this does not affected. TableColumn column = table.getColumn(columnIndex); column.setData(RWT.MARKUP_ENABLED, Boolean.TRUE); column.setAlignment(SWT.CENTER); column.setWidth(COLUMN_WIDTH); column.setResizable(Boolean.FALSE); column.setText("<div></div>"); ...

Opening multiple windows in e4 locks previous windows

java,swt,rcp,e4
I am building an application with E4 and SWT . For a button click, sometimes a new window(shell) is opened. The problem is when I open a new window, I am unable to use the other windows, in a sense, it's getting locked. Unless I close the latest window, cannot...

Blocking operation in custom SWT component

java,multithreading,concurrency,swt
What is the best way to run long operations within custom SWT components? Objective: I want to build a mail state indicator with SWT. Basically, it should constantly poll a service and display an image depending on the state flag that is returned (for sake of simplicity, lets say MailState.NO_MAILS...

bad performance with SWT Combo in table

java,performance,memory-leaks,combobox,swt
I'm having a performance problem with combos in a table. When I start the application, everything is just fine. I can change the value of the combos and the reaction of the table is ok. But when I clear the table and refill it, it seems that there is a...

RCP or SWT to build eclipse plugin

java,eclipse,eclipse-plugin,swt,eclipse-rcp
I am new to eclipse plugin development. I want to develop a plugin which will generate XML files from the classes present in the workspace. It will have 2-3 UI forms which will take information from user while generating XMLs. From what I have read till now, I think there...

SWT removing margin from Composite

java,layout,swt
When I embedding Composite control inside ViewPart, a vertical margin/padding is added between textbox and button (button is part of another Composite) , as seen on attached picture. How can I remove it? public class View extends ViewPart { public static final String ID = "xyyx.view"; public void createPartControl(Composite parent)...

In what order is Event delivered to Widgets and its Children in SWT

java,user-interface,swt
Say I have a Panel which contains a button. I added a DragMove listener to the Panel so I can drag-move the panel in any part of it. However I do not want the same behavior when I press down the button. Is there a way to do that? In...

SWT - show multiple table items

java,table,swt,tableviewer
Could anybody help me? I have a table in SWT and simply I want to show some table items but the table only shows one item and the others with vertical scroll. I want to show everything, without scrolling. I tried with the option SWT_NO_SCROLL but is not working. I...

Not Responding-While copying files in SWT not in jFace

java,multithreading,file,swt
I have to display the progress bar while copying files. My code is displaying the progress bar. window is not responding while copying files. Here my code: Thread t = new Thread(new Runnable() { @Override public void run() { try { Display.getDefault().asyncExec(new Runnable() { public void run() { try {...

Clipboard access in SWTBot

java,swt,swtbot,system-testing
How to access Clipboard while running SWTBot tests? Following code throws Invalid thread access. Clipboard clipBoard = new Clipboard(SWTUtils.display()); Object object = clipBoard.getContents(TextTransfer.getInstance()); The above code is working when run in the UI Thread. Is this the only way? How to access the clipboard in the SwtBot thread? ...

How to align image to center of table cell (SWT Table) RAP Platform

java,eclipse,swt,rcp,eclipse-rap
I found some solutions for this question, but they are for RCP Platform only. I'm using RAP Platform and I can't find a solution.

Get location of a widget to allow drawing a line from widget a to b

java,widget,swt
Hi I am working on adding a link between 2 classes on a class diagram to show their relation, the class diagram view allows for adding as many classes as the user wants. This is being done in SWT and the classes (which are a square button) are added dynamically...

Eclpse Luna SWT version

eclipse,swt
¿Is there a way to know the version of SWT that it was used to develop a certain version of Eclipse?. I only could find an SWT version on the Plug-ins tab of the Eclipse Installation Details, but I am not sure if that is the SWT used to run...

SWT TreeViewer expand and collaps at the same time when SWT.FULL_SELECTION is set

java,treeview,swt,jface
I have implemented a TreeViewer as followed and added a double click listener to it. This double click listener is supposed to expand/collapse a node. treeViewer = new TreeViewer(component, SWT.BORDER | SWT.MULTI ); treeViewer.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent e) { final IStructuredSelection selection = (IStructuredSelection) e .getSelection(); if (selection...

SWT FileDialog with java.lang.ClassNotFoundException

java,eclipse-plugin,swt
In my java program I'm trying to create a FileDialog to save files. But I'm getting this error. Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.FileDialog cannot be found by xxx.xxx.maintenance_1.0.0 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328) at...

Eclipse RCP - JFace dialog doesn't show buttons

java,swt,eclipse-rcp,jface
I'm trying to create a custom dialog with a TableViewer inside it. It looks good as Test/Preview but when I actually run my app the buttons at the bottom disappear. Test/preview when running from inside WindowBuilder looks like this (at the bottom): When running in the app it looks like...

Is it possible to put FormLayout into GridLayout?

java,swt
I am trying to put a FormLayout composite into a GridLayout grid, but i get an exception. Am i doing something wrong or is it just not possible? Here is my code: import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell;...

How to make child composite fill parent in swt

java,swt
Here is my code: public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); Composite childComposite = new Composite(shell, SWT.BORDER); childComposite.setLayout(new GridLayout(2, false)); Text text1 = new Text(childComposite, SWT.NONE); Text text2 = new Text(childComposite, SWT.NONE ); Label label = new Label(shell,...

Find specific item in SWT Tree

java,eclipse,swt,jface
I have a JFACE Treeviewer (with underlying SWT Tree). Tree contain multiple lines and multiple levels. I want to be able to find specific tree node (compare by text label), epand to it's level and select the item. The main problem that i can't loop over TreeItems becasue tree loads...

Get current line when some previous lines was collapsed in my own eclipse editor

java,eclipse,eclipse-plugin,swt,text-editor
Im trying to get the current line of keyboard cursor. StyledText styledText = (StyledText) getAdapter(Control.class); styledText.addCaretListener(event -> { try { IDocument document = getDocumentProvider().getDocument(getEditorInput()); // This is the current line int currentLine = document.getLineOfOffset(event.caretOffset); } catch (BadLocationException e) { } }); But the method getLineOfOffset doesn't work when some previous...

Resizing swt-table without forcing their scrollbars

java,eclipse,swt
following code gives me a construct like in the picture-link below. For instance I have one main group with 3 groups inside. Every group has a table with 3 columns and a minimum width of 200. If you resize the composite, the tables and groups resizes as well. But if...

Programatically trigger DataBinding execution on Slider Selection

java,swt,eclipse-rcp,jface,e4
I have a Databinding between a Widget (Slider) and a Model (int value) in my E4 Application. If I start the Application and move the Slider, the Model value gets updated properly, so the Databinding works. But if I set the Slider Selection via the setSelection method, the Databinding isn´t...

using Composites with Shell for java in eclipse with maven

java,eclipse,maven,dependencies,swt
I have a java maven project in eclipse that is using some Composites, however I am having trouble when creating a main method to launch my widgets. I added the following dependency: <dependency> <groupId>org.eclipse.rap</groupId> <artifactId>org.eclipse.rap.rwt</artifactId> <version>3.0.0-M5</version> </dependency> And this is my main method (where MainWindow is my composite) public static...

Java's SWT: Setting the size of Group hides its widgets

java,swt
I want to set a Group with some widgets on it in a GridLayout. I also want the size of the group component to be of fixed size (250x250) and the widgets on it to accommodate (evenly spaced inside it in two columns). But when I set the size of...

SWT selection event after deleting selection

java,swt
I'm making a simple menu to delete items on a tree. However, after deleting the items, the tree does not receive a selection event, therefore, the code in the listener does not execute (the listener, in the full code, updates a part of the UI). I have simplified the code...

SWT StackLayout topControl apparently not working

java,layout,swt
I am testing a simple SWT StackLayout example to learn how it works but things are not working as I expected. I created a StackLayout with two buttons on them, both set to cycle the top control between the two of them five times when they are selected, with a...

Layout setting for a jface Table

java,user-interface,checkbox,swt,jface
I created a CheckboxTableViewer to show a list of stuff as shown in figure below. The problem are the scrollbars of the table are not working as it should. May be I am missing some layout parameters for the table? And here is the code: public class TableViewerClass { CheckboxTableViewer...

Save doesn't get enabled on SWT EditorPart when cell is modified in TableViewer

java,swt,jface,rcp,tableviewer
I'm using a TableViewer in my class which extends EdiotrPart, TableViewer has one editable column which has ComboBoxCellEditor. When I modify the column to select a value from ComboBoxCellEditor, the save button doesn't get enabled until a tab key is pressed, or when the focus is moved to a different...

Disable “Detached”-Action in SWT - “Wrong parent”-Exception

java,swt,eclipse-rcp
Im working in a project, with a Eclipse SWT-Application. On the tabs of all views there are the default-actions, for example the "Detached"-Action that takes the tab and creates a detached window for it. In our case, this leads to the following exception: Widget has the wrong parent java.lang.IllegalArgumentException: Widget...

How to set some data object to jFace TableViewer row

java,swt,jface
Currently, i rework my code , because i want to use mvc and jface. Native SWT provides the possibility to add some Objects to a SWT-TableItem by using the function .setData(..): TableItem item = new TableItem(table, SWT.NONE, 1); item.setData(someObject) Is there a chance to do this in my new created...

Java SWT ScrolledForm Background Color

java,background,swt
I am having an issue with a ScrolledForm. I am trying to change the background and foreground colour for a Label defined in the body of the ScrolledForm, however it doesn't seem to be working. In my code snippet, I would like lblWhat to have a black background and white...

Mouse Events on Application Window

java,eclipse-plugin,swt,eclipse-rcp,e4
I've an eclipse e4 application. I'm trying to run some code say xyz() when the window is resized. The issue is that while resizing the resize listener is called multiple times and I want to call xyz() only once after the user has done resizing. The only way that I...

Is there a bug in the ProgressMonitorDialog constructor?

java,swt,jface
When I go to create a new instance of a ProgressMonitorDialog, it ignores the internal shell style and setBlockOnOpen. I'm not even sure how/why this would be happening. The close button in the title bar does not work (which I consider a bug), but the cancel button works fine. Is...

Java SWT : Badge Notifications

java,swt,swt-awt
I have a desktop based UI application written in Java SWT running on windows. I want to add a button on the UI screen whose behaviour should be similar to the badges on an iphone or facebook notifications as shown in the images below. The number on the badge will...

Is there a way to remove the sort after an SWT Table is sorted?

java,swt,tableviewer
I have a Table and TableViewer that are set up to take a ViewerComparator: this.viewer.setComparator( this.comparator ); Now I am looking at my table. I click on a column header. The table sorts on that row. I click on that column header again and it sorts in the other direction....

How to get image from plugin internal resources?

java,eclipse,eclipse-plugin,swt
I'm trying to get an image file from my plugin resources using SWT Image Image image=new Image(device,"icons/imagename.png"); The icons folder is in the classpath of the plugin but I still get an IOException. Can you help me indicating what is the correct way of accessing an Image resource from internal...

PathMustExists and FileMustExists in SWT FileDialog

java,swt,filedialog
To date I only used Swing to build graphical user interfaces but now I also want to make myself familiar with the Standard Widget Toolkit. I already read the documentation and built a simple app. My problem is now to use the FileDialog component. I did the following code: FileDialog...

SWT ScrolledComposite Does Not Scroll for Big Composites

java,swt
We have a ScrolledComposite with lots and lots of child composites. For whatever reason, it won't scroll past about 30,000 pixels. Here a snippet to show the problem. At least at this PC the last button I'm able to scroll to is #66. public class ScrollBug { public static void...

Does PlatformUI.createDisplay() ensure creation of Display object through UI thread?

java,user-interface,thread-safety,swt,eclipse-rcp
How should I ensure creation of Display object through UI Thread only? Does PlatformUI.createDisplay() ensure creation of Display object through UI thread?...

Get rid of the extra line in my SWT ComboBoxCellEditor?

java,eclipse,swt,jface,inline-editing
My SWT ComboBoxCellEditor has an extra line at the bottom. Is there any way to get rid of it? It's there no matter how many elements I have....

Always show the file path in FilteredResourcesSelectionDialog

eclipse,eclipse-plugin,swt,eclipse-rcp,jface
In the FilteredResourcesSelectionDialog, some items show the file path beside them in grey color while others don"t show the path. Why does this happen and how do I make sure that the file paths are always shown?...

Sort SWT Table with ViewerComparator never calls compare

java,swt,jface
I have a SWT Table with 3 columns, which should be sortable by the user. I checked stackoverflow and other sites, based on that I am now able to click the column header, the asc/desc symbol shows up, but all the data in the table gets removed and the compare...

Sizing a message box in SWT (Eclipse Platform API)

java,swt
I have to display a message box on some action, I am able to do that but the message dialog box appears smaller in size.Is there any way to increase the size of the message box in java? here is my code: Display.getDefault().syncExec(new Runnable () { @Override public void run()...

Can SWTBot recognize Action Buttons?

java,junit,swt,eclipse-rcp,swtbot
I have an RCP Application with a ViewPart that has a toolbar with some Actions on it. These Actions are put on the toolbar by the system as simple Buttons with an icon and a tooltip. The Action looks like this: public class MyAction extends Action { public static final...

How to make SWT Table in CheckboxTableViewer scrollable?

java,swt,jface
I couldn't find any answers for this special case (using CheckboxTableViewer), so I hope it's not a duplicate. I have the following createPartControl() in an Eclipse view (3.x). I'm trying to display two buttons and a checkable table in a GridLayout, as below ------------------- | Button | Button | -------------------...

Java (Eclipse) WindowBuilder setting maximum dimensions

java,eclipse,swt,fixed,dimensions
I have built a window application using the SWT WindowBuilder in Eclipse. I want the window to be a set size whilst the application is running. This means that I do not want the user to be able to resize the window e.g. disable window resizing and if that is...

importing files as link to eclipse project using java

java,file,eclipse-plugin,swt,rcp
okay guys this is a problem I've currently used hours and hours of research and haven't found a solution yet. my eclipse plugin needs files imported as link to the current project. the current approach is to drag and drop the file from explorer and use the following settings: I...

How to show addicional information popup in auto-complete using IContentAssistProcessor

java,eclipse,eclipse-plugin,swt,editor
I created a custom eclipse editor (AbstractDecoratedTextEditor) and I implemented an auto-complete feature using IContentAssistProcessor. In the class thats extends IContentAssistProcessor, I overrided the method computeCompletionProposals that returns a list of ICompletionProposal. But when the auto-complete dialog is running, I cant show the additional information in yellow dialog like in...

Get current line text when some previous lines was collapsed

java,eclipse,eclipse-plugin,swt,text-editor
Im trying to get the text beginning of the current line to the mouse cursor. ITextSelection textSelection= (ITextSelection) textEditor.getSelectionProvider().getSelection(); IRegion lineInfo = null; int offsetCurrentCursor = textSelection.getOffset(); int offsetLine; // THIS IS THE VALUE THAT I WANT try { int lineNumber = document.getLineOfOffset(offsetCurrentCursor); lineInfo = document.getLineInformation(lineNumber); offsetLine = lineInfo.getOffset(); }...

How to draw lines between SWT TreeItems

java,swt
I need to write an editor with two Trees, where user can map nodes from one tree to another. The biggest challenge is to draw connection line between TreeItems. Are there any samples that I can use? There is the link for JDeveloper XSD Mapper tree view https://technology.amis.nl/wp-content/uploads/images/xsdMapper.jpg...

Eclipse PDE: Programmatically detect opened dialog and close it

eclipse,swt,eclipse-rcp,jface,eclipse-pde
On Eclipse Luna, I select a server and click the Start button on Servers view, then the server (for example Tomcat8) will get started. If something is wrong during the start-up process, a dialog will be populated to display the error messages (for example time-out). The dialog is modeless in...

Invalid Thread Access

java,eclipse,multithreading,swt,eclipse-rcp
The create View Control Class public void createPartControl(Composite parent) { //viewer = new TableViewer(parent, SWT.MULTI| SWT.V_SCROLL); //viewer.setContentProvider(new ViewContentProvider()); //viewer.setLabelProvider(new ViewLabelProvider()); // Provide the input to the ContentProvider //viewer.setInput(new String[] {"One", "Two", "Three"}); //Display display=new Display(); parent.getShell().setText("A dialog box with no buttons at all press 'ESC' to close"); final Shell shell...

StackLayout in WizardDialog and varying multiline Text with fixed height and dynamically showed scrollbar

java,layout,swt,jface,wizard
I am working on a wizard, which should have an error composite showed on the top of controls if an error occurs. This composite contains a Text listing all errors and two Labels: above and below this component. The Label below the error list can be omitted. Dependent on the...

Table.getItem returns wrong item only in RHEL6

java,table,swt,rhel6
I've a weird issue, I've a table with 2 columns and 3 rows each cell text can be edited at run time, when I edit the cell in the 3rd row second column I get the upper cell modified too with the same text this only occurs on redhat6 ....

Java SWT: show paintings in tooltip

java,image,swt,tooltip
I want to set tooltip for StyledText in Java SWT. The idea is to show information for the text where the mouse clicks. Up to now I can only show text in the tooltip, but I want the whole tooltip to be an image, which is painted using drawing methods...

Embed SWT Composite into C# application

java,c#,swt,ole
I've got a Java application that uses SWT as its widget toolkit. I've also got a Windows C# application. I'd like a way to draw an SWT Composite into this C# application. I can think of two ways to do this: Handles: Since SWT is based on the native windowing...

File Selection from List in a Wizard page

eclipse,user-interface,eclipse-plugin,swt,jface
I have a Wizard page which gets a list of IFile. I want to show the user the list and select one file from the list. Then the Wizard returns the selected file. Is there a standard file chooser that I can use instead of building from scratch in the...

Plugin view icon not displaying properly

java,swt,eclipse-plugin
I am stuck with this weird issue, where the icon of my custom plugin view is not getting displayed. However when the view is minimized, the icon can be viewed properly (see the screenshot, the icon is displayed properly in the minimized side bar). All other image icons (in the...

SWT Text Widgets in StackLayout—Can't adjust height when switching top control

java,layout,swt
I have a SWT Composite in a JFace Dialog. On one row of the composite I have a Group with 4 buttons stacked vertically. Next to it is a Text widget which needs to toggle back and forth, by user input, between being multi and single-line. I have two different...

SWT Table only first column selected

java,table,swt
I currently have a populated SWT table with the following styles: SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL used SWT.FULL_SELECTION to get the whole line selected if clicked. but using table.getSelection() only returns the first column. I don't have any tableviewer or something else set. where did I...

Information about System.getProperty(“eclipse.commands”) to assert if JUnits tests are being run as a plug-in JUnit

java,eclipse,unit-testing,junit,swt
I have a function in my JUnit test class ValidateConfig.java which asserts if the test is being run as a plug-in JUnit (function has been mentioned below) and throws an IllegatStateException if it is not. I would like to know how this works, what does the parameter in the call...

How do I stop a custom Thead in SWT application?

java,multithreading,swt,dispose
How do I stop a custom Thread when I exit my SWT application? MyThread runs in an infinite loop, until a certain condition becomes true: class MyThread extends Thread { @Override public void run() { do { // Do stuff... } while (!this.isInterrupted() && otherCondition); } In my SWT application...

JFace - Change font color in ToolBarManager

java,swt,eclipse-rcp,jface
I have an application using a ToolBarManager and I need to change the font color of a button. ICoolBarManager coolBar = ... IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle()); MyAction myAction = new MyAction(); myAction.setText("I need this text in other color"); //this is my button's description at the toolbar toolBar.add(myAction); coolBar.add(new ToolBarContributionItem(toolBar,...

Select/mark specific word in SWT Textfield

java,text,widget,swt
I've got an SWT Textfield with some text which is added automatically. Now I want to select a specific phrase in the text automatically, so that the user could replace this without the manual selection. But all I've found in the api is the selectAll() method, which works but selects...

GWT Designer. Does it work with later versions?

eclipse,google-app-engine,gwt,swt,xulrunner
I'm starting a project in Eclipse Luna using GWT and GAE. I wanted to ask you if it is possible to run the GWT Designer(to make UI graphically) in GWT SDK 2.6 version. UIBinder works fine, I mean the xml way. But when I try to make some UI with...

Opening the Windows 8 touch keyboard

java,windows,keyboard,swt,on-screen-keyboard
Does somebody know how open the "windows 8 touch keyboard" from an SWT application? I want to open the "touch keyboard" when the SWT input get focus, like other native applications do. Perhaps there is a particular "style" to use, when instantiating the Text class? Something like: text = new...

Java SWT - Transparent background on canvas?

java,canvas,swt
Is it possible to fill a rectangle and an oval over a drawn image and having the oval being a "window" to the image behind it? e.gc.drawImage(//...); e.gc.setBackground(//black); e.gc.fillRectangle(//over the image); e.gc.setBackground(//SWT.TRANSPARENT?); e.gc.fillOval(somewhere on the canvas); this snippet obviously isn't working for me, but can this even be achieved with...

I can't find class OwnerDrawLabelProvider in Jface jars and field SWT.PaintItem

java,eclipse,swt,jface
I try to use code example from this answer: How to align image to center of table cell (SWT Table) But I can't find class in jar: org.eclipse.jface.viewers.OwnerDrawLabelProvider I am using next jar: org.eclipse.rap.jface-2.3.1.20140819-1926.jar I also tried to find field SWT.PaintItem in next org.eclipse.rap.rwt-2.3.1.20140909-1638.jar What am I doing wrong?...

synchronize modification between SWT table and TextEditor

table,eclipse-plugin,swt,text-editor,jface
I'm facing a problem and want to ask for a solution. I'm working on an eclipse plugin project, in which an editor for a type of resource file is required. The resource file has similar structure like csv file. My idea is to provide user the option to edit this...

Eclipse RCP: How and when to correctly unsubscribe a Composite from EventBroker?

java,swt,eclipse-rcp
In the constructor of my custom composite (inherited from SWT Composite), I register myself as an EventHandler to the Eclipse IEventBroker. To unsubscribe upon disposal, I had overridden the dispose method where I unsubscribe myself. But I now noticed that this unsubscription is not happening, indeed the dispose method is...

open and save button in java SWT

java,user-interface,swt
I do some assignments and I don't know how to start making save and open button. I'm using SWT and my app is going to read and write in XML file. I make methods for that but now problem is open existing file and save existing file. If you can...

Display some part of text in bold and some part in italic in swt label

java,swt,jface
I have to show some warning message to the user like "If you restore data the updated changes will be lost, So recheck once" In german language also I have to same string with bold and italic. In both languages the dialog height and width should be same public class...

Generate SQLite data as button (SWT)

java,user-interface,button,grid,swt
I need to generate buttons from SQLite data, but on 100% size like this image: The problem is that my main layout is absolute :( TabFolder tabFolder = new TabFolder(shell, SWT.NONE); //tabFolder.setLayout(new GridLayout()); tabFolder.setBounds(10, 319, 740, 342); TabItem tbtmPizzas = new TabItem(tabFolder, SWT.NONE); tbtmPizzas.setText("Members"); Composite composite = new Composite(tabFolder, SWT.NONE);...

how to add tooltip entries for items in eclipse swt combo list

eclipse,swt
The exact already asked question to what I'd like to do is: how to add tooltip on the entries and not the combo.... I cannot use a CCombo. JoeYo said that he solved it by using a DefaultToolTip class on the Combo, but he didn't elaborate. Can anyone, (@JoeYo hopefully)...

Does SWT FillLayout support laying controls of uneven width horizontally?

java,layout,swt
I would like to build a horizontal buttonbar using FillLayout. However, the layout displays the buttons with even width. I know that I can use GridLayout to accomplish my goal. However, I would like to know if the FillLayout can achieve the same.

Differentiating between a CheckboxTreeViewers CheckStateListener and Selection Listener

java,swt,jface
I am trying to programmatically determine when a user has clicked a checkbox in a CheckboxTreeViewer vs when they have clicked on the actual object in the tree (i.e. the item displayed directly to the right of the checkbox) To determine when a checkbox is checked/unchecked I use a CheckStateListener....

Elapsed time column - how to refresh only one part of StructuredViewer

swt,eclipse-rcp,jface
I have a StructuredViewer (in this example a TreeViewer with columns) that refreshes its interior through some callbacks I don't want to get into, by calling setInput() and refresh() on it when the callbacks occur. I need to introduce a Time Elapsed cell that will need to refresh every second,...

SWT CTabFolder doesn't display when running from eclipse

eclipse,tabs,swt,windowbuilder
I am creating an app using WindowBuilder in eclipse 4.4.2. I've added CTabFolders and corresponding CTabItems. The tabs are displayed properly when Click the preview button(Quickly test/preview the window without compiling or running it) in windowbuilder. Screen Shot===> http://i.imgur.com/Sx9TQrL.jpg But the real problem is when I run the app,the tabs...

SWT window becomes unresponsive while updating progressbar from a thread

java,multithreading,swt
I am writing an java swt application to process the server log files and generate a excel sheet with some analytics and I have no issues doing that. The problem arises when I try to update the progress bar. Here is a basic flow of the code. The user selects...

Invalid thread access exception while updating textfield

java,multithreading,swt,thread-exceptions
I'm trying to update a textfield which belongs to another class using a runnable thread, but I'm getting 'invalid thread access' exception. My code is: Thread t2 = new Thread () { public void run () { System.out.println("t2 thread içindeyim."); try { String sql = " RESTORE DATABASE Genius3"+ "...

Java's SWT: GC will not draw simple rectangle on a canvas, but will draw it on an image

java,swt
I can't get the GC (graphic context) object to draw a simple rectangle on a canvas, and I can't figure out what am I missing... Consider this simple code snippet: public class MainWindow { private Display display; private Shell shell; public static void main(String args[]) { MainWindow mw=new MainWindow(); mw.render();...

how to output a string in non-static jtextField?

java,user-interface,swt
I'm new to java and want to output my text file into a textfield/textarea in java gui I first read my whole file into one string (file is not big) then when I try to setText() it . i get non-static ... error; I searched about it but didn't get...

org.eclipse.swt.SWTException: Invalid thread access from HandledContributionItem

eclipse,multithreading,eclipse-plugin,swt
I know there are lots of such questions here and most of them are answered. But the answers just won't solve my case. I'm working on an eclipse plugin project, have a customized project type which can be either run or debugged. I have implemented the run and debug function...

Eclipse RCP: How to listen to CheckboxTableViewer selection in other view

java,swt,eclipse-rcp,jface
I have an Eclipse RCP with a view whose Control is a CheckboxTableViewer. I'd like to use the WorkbenchPage's SelectionService (for reasons of loose coupling) to react to check/uncheck actions within the view in an editor. So I do getSite().setSelectionProvider(myTableViewer); in the view's createPartControl() method. Also, I create a listener...

XULRunner error in Eclipse / SWT

java,eclipse,swt,xulrunner
I'm trying to run the Enhanced JavaScript Bridge example found here. I created a new project, and added a reference to SWT via: Project(right-click)-->Properties-->Libraries-->Add Variable-->Configure Variable-->New However I cannot get this project to run. The error I get depends on what SWT library I'm referencing: org.eclipse.swt.win32.win32.x86_64_3.103.2.v20150203-1351.jar: Error is Could not...