Use rational Application Developer visual editor to achieve swing visualization ...

Source: Internet
Author: User
Tags web services

Using Rational Application Developer visual Editor to implement Swing visual components and data binding

Introduction

The Java™ visual Editor allows users to graphically edit the Java user interface. This functionality is further enhanced in the IBM Rational application Developer for Websphere®software V6. Because V6 supports the rapid binding of visual components to data from different sources, for example, this data can originate from Web services or EJB components. This article describes how to use the excellent features of data binding, using a fast and powerful way to define the user interface of data reading and data writing.

Swing Overview

Like many other parts, the AWT (Abstract window tool) and Swing graphical interface components are included in the Java Basic Class library (JFC), which provides a framework to easily construct a graphical user interface (GUI) that adds rich graphical functionality and interoperability to Java applications. Swing is a versatile general-purpose toolkit that offers a number of very useful features. But for our purposes, here we focus on two important features, because these two features are most important for understanding the binding model and binding operations of the visual editor.

Using Swing's data model

Most Swing components have models that allow you to flexibly decide how to store and retrieve data in your application. Among them, there are two such models in the data binding tool of Rational application Developer (hereinafter referred to as Application Developer), which are document and table models, and let's look at these two models:

Figure 1: Document-blocking model

In the document model (Figure 1), the text component is used to separate data from its data view (called a model), which implements the Javax.swing.text.Document interface and provides the following services:

Contains text. The document stores the text content in a Javax.swing.text.Element object, and can also represent arbitrary text logic structures, such as paragraphs, shared style text, and so on.

Support for text editing is provided through remove (string astring) and insertstring (int position, string astring, AttributeSet anattributeset).

Notifies the document listener of changes to the text and enables the editing listener to undo the changes.

Manage Position objects. When text content is changed, the Position object tracks specific positions in the text.

Enables you to get information about the text, such as its length, and the text fragment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.