World Library  
Flag as Inappropriate
Email this Article

JFace

Article Id: WHEBN0006549284
Reproduction Date:

Title: JFace  
Author: World Heritage Encyclopedia
Language: English
Subject: Eclipse technology, Eclipse Foundation, UI data binding, Model–view–presenter, Koneki
Collection: Articles with Example Java Code, Eclipse Software, Eclipse Technology
Publisher: World Heritage Encyclopedia
Publication
Date:
 

JFace

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."[3] The Standard Widget Toolkit (SWT) is an open source widget toolkit for Java designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.

Contents

  • Structure 1
  • Example 2
  • See also 3
  • References 4
  • Bibliography 5
  • External links 6

Structure

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.

  1. Provides Viewer classes that handle the tedious tasks of populating, sorting, filtering, and updating widgets
  2. 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.
  3. Provides registries that hold Images and Fonts
  4. Defines standard dialogs and wizards, and defines a framework for building complex interactions with the user
  5. 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.
  6. 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;
  }
}

See also

References

  1. ^ a b "Tualatin Mountains".  
  2. ^ a b "Tualatin Mountains". PeakBagger.com. Retrieved June 20, 2011. 
  3. ^ Eclipse programmer's guide entry on JFace

Bibliography

  •  
  • "Tualatin Mountains".  
  • "Tualatin Mountains". PeakBagger.com. Retrieved June 20, 2011. 

External links

  • Wiki JFace
  • Rich clients with the SWT and JFace
  • Using the Eclipse GUI outside the Eclipse Workbench, Part 1: Using JFace and SWT in stand-alone mode, by Adrian Emmenis
  • Using the Eclipse GUI outside the Eclipse Workbench, Part 2: Using the JFace image registry, by Adrian Emmenis
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.