|
|
This article needs references that appear in reliable third-party publications. Primary sources or sources affiliated with the subject are generally not sufficient for a Wikipedia article. Please add more appropriate citations from reliable sources. (April 2009) |
JFace is defined by the Eclipse project as "a UI toolkit that provides helper classes for developing UI features that can be tedious to implement."[1] It is a layer that sits on top of the raw widget system, and provides classes for handling common UI programming tasks. It brings model view controller programming to the Standard Widget Toolkit.
- Provides Viewer classes that handle the tedious tasks of populating, sorting, filtering, and updating widgets
- Provides Actions to allow users to define their own behavior and to assign that behavior to specific components, e.g. menu items, tool items, push buttons, etc.
- Provides registries that hold Images and Fonts
- Defines standard dialogs and wizards, and defines a framework for building complex interactions with the user
- Its primary goal is to free the developer up, letting the developer focus on the implementation of his or her specific application without having to be concerned with the underlying widget system or solving problems that are common in almost all UI applications.
- A primary concern of the Eclipse group when developing JFace was that under no circumstances did they want to hide the SWT component implementation from the programmer. JFace is completely dependent on SWT, but SWT is not dependent on JFace. Furthermore, the Eclipse Workbench is built on both JFace and SWT; in some instances, it bypasses JFace and accesses SWT directly.
Example
The following is a basic Hello World program using JFace.
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;;
public class HelloWorld extends ApplicationWindow {
public static void main(String[] args) {
new HelloWorld().run();
}
public HelloWorld() {
super(null);
}
public void run() {
setBlockOnOpen(true);
open();
Display.getCurrent().dispose();
}
protected Control createContents(Composite parent) {
Label label = new Label(parent, SWT.CENTER);
label.setText("Hello, World");
return label;
}
}
References
- ^ Eclipse programmer's guide entry on JFace
Bibliography
- Scarpino, Matthew; Holder, Stephen; Ng, Stanford; Mihalkovic, Laurent (November 28, 2004), SWT/JFace in Action: GUI Design with Eclipse 3.0 (1st ed.), Manning Publications, pp. 496, ISBN 1932394273, http://www.manning.com/scarpino/
- Li Guojie, Jackwind (February 11, 2005), Professional Java Native Interfaces with SWT/JFace (1st ed.), Wrox Press, pp. 528, ISBN 0470094591, http://www.wrox.com/WileyCDA/WroxTitle/Professional-Java-Native-Interfaces-with-SWT-JFace.productCd-0470094591.html
- Harris, Robert; Warner, Rob (June 21, 2004), The Definitive Guide to SWT and JFACE (1st ed.), Apress, pp. 684, ISBN 1590593251, http://www.apress.com/book/view/9781590593257
External links
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)