Questions tagged [jface]

Use this tag for questions about JFace which is a Java application framework based on SWT. The goal of JFace is to provide a set of reusable components that make it easier to write a Java-based GUI application.

is a UI toolkit that provides helper classes for developing UI features that can be tedious to implement. operates above the level of a raw widget system. It includes classes for handling common UI programming tasks such as:

Viewers: Handle the drudgery of populating, sorting, filtering, and updating widgets.

Actions and contributions (Deprecated): Introduce semantics for defining user actions and specifying where to make them available.

Image and font registries: Provide common patterns for handling UI resources.

Dialogs and wizards: Define a framework for building complex interactions with the user.

Field assist: Provides classes that help guide the user in choosing appropriate content for fields in dialogs, wizards, or forms.

frees you up to focus on the implementation of your specific plug-in's function, rather than focusing on the underlying widget system or solving problems that are common in almost any UI application.

Eclipse is based upon the user interface toolkit . provides classes and frameworks which simplify common use cases. does not hide the API. Therefore knowledge is still required.

All JFace classes are in packages starting with org.eclipse.jface and are in the org.eclipse.jface plugin.

Useful Links:

1700 questions
10
votes
1 answer

TreeViewer to GridTreeViewer: bridge between existing ITreeContentProviders and "lazy" ObservableListTreeContentProvider

TL;DR Based on Thomas Schindl's article JFace-Viewer and Eclipse Databinding with > 10.000 Objects (which suggests a very good idea), I'd like to convert a regular TreeViewer + multiple ITreeContentProvider implementations to Nebula's GridTreeViewer…
Sk8erPeter
  • 6,899
  • 9
  • 48
  • 67
10
votes
4 answers

Where can I download the javadoc for swt(Only)

Does anyone know where I can download the javadoc files for Swt and/or JFace? I do not want the api docs for the rest of Eclipse. I found a place where the docs are available for reading online but I really need them on my local computer.
MTilsted
  • 5,425
  • 9
  • 44
  • 76
10
votes
1 answer

JFace TableViewer vs TreeViewer - performance

Did anybody else notice that there is a huge performance difference between a TreeViewer and a TableViewer (TreeViewer is much faster). I have a Table containing CellEditors (with EditingSupport) with about 30 columns and when I'm scrolling it,…
Lori
  • 562
  • 5
  • 24
10
votes
2 answers

Saving TreeViewer state before setInput()

I'm trying to save JFace TreeViewer expansion state to refresh it after calling setInput() method. I tried getExpandedElements, setExpandedElements, getExpandedTreePaths, setExpandedTreePaths methods of TreeViewer but it doesn't work. Object[]…
penguru
  • 4,342
  • 11
  • 46
  • 56
10
votes
4 answers

How best to use ViewerFilter on a TreeViewer?

I am applying a ViewerFilter to a tree of a few branches, but mostly leaves. The filter really applies to the leaves, using properties within the leaf. All branches are left untouched so that their leaves can appear. However I would like to filter…
Martin Cowie
  • 2,788
  • 7
  • 38
  • 74
9
votes
1 answer

SWT event propagation

I'm trying to detect click events on a Composite control that contains a number of other composites. I tried: topComposite.addMouseListener(new MouseListener() { ... @Override public void mouseUp(MouseEvent arg0) { …
bcoughlan
  • 25,987
  • 18
  • 90
  • 141
9
votes
4 answers

Make JFace Window blink in taskbar or get users attention?

I wonder someone has any idea how to solve this: In my Java Eclipse plugin there are some processes which take some time. Therefore the user might minimize the window and let the process run in the background. Now, when the process is finished, I…
Gnark
  • 4,080
  • 7
  • 33
  • 44
9
votes
1 answer

Lazy and Deferred TreeViewer questions

I have actually two questions but they are kind of related so here they go as one... How to ensure garbage collection of tree nodes that are not currently displayed using TreeViewer(SWT.VIRTUAL) and ILazeTreeContentProvider? If a node has 5000…
Svilen
  • 1,377
  • 1
  • 16
  • 23
8
votes
2 answers

How should I display a validation error detected by an ICellEditorValidator?

I have a TableViewer with an ICellModifier which seems to work fine. I set an ICellEditorValidator on one of the cell editors, though, and I can't get it to behave the way I would like. Here's my abbreviated code: cellEditors[1] = new…
Adam Crume
  • 15,614
  • 8
  • 46
  • 50
8
votes
1 answer

How to get cursor position in an eclipse TextEditor

I have been trying to get the line number and column number of the cursor position in a jface TextEditor. I tried the function getCursorPosition(). But on printing this it shows just a "?". Please note that I need the line number and column number…
Smitha
  • 81
  • 1
  • 2
8
votes
3 answers

How listen for check box in JFace Table Viewer

I am using a Table Viewer with check boxes as following: final TableViewer legendViewer = new TableViewer(parent, SWT.CHECK); What is THE solution to listen to check boxes selection/unselection in this viewer ? Thanks in advance, Manu
Manuel Selva
  • 18,554
  • 22
  • 89
  • 134
8
votes
3 answers

org.eclipse.swt.SWTException: "Widget is disposed" from table refresh

The app is an Eclipse 3.6 based RCP (so jface version 3.5.2) running on windows 7. I have a custom View class that contains a TableViewer and calls refresh() on it. Sometimes, but not very often it results in the stack trace below. It's called from…
Alb
  • 3,601
  • 6
  • 33
  • 38
8
votes
2 answers

JFace/SWT: Change the labels for buttons in InputDialog

I want to create an InputDialog with custom labels for the OK/Cancel buttons. I'm using org.eclipse.jface.dialogs.InputDialog. I tried to override the button creation method: @Override protected void createButtonsForButtonBar(Composite parent)…
leonbloy
  • 73,180
  • 20
  • 142
  • 190
8
votes
2 answers

Why do we need ContentProviders for JFace Viewers (TableViewers specifically)?

I have always wondered why we exactly need ContentProviders for JFace TableViewers? I know that getElements() method of a ContentProvider class will return an Array or Collection of Objects which corresponds to rows on the table and getElements will…
Sangli
  • 373
  • 4
  • 20
8
votes
3 answers

Set Size of JFace Wizard

I am building an Eclipse RCP application and am having trouble on settings the size of a JFace Wizard.
Ohanes Dadian
  • 625
  • 1
  • 9
  • 17