Java UI - 1.0

Extension ID

com.castsoftware.swing

What’s new?

See Java UI - 1.0 - Release Notes for more information.

Description

This extension provides support for Java Swing, AWT, SWT and JFace presentation frameworks:

This extension works together with the JEE Analyzer .

Object structure

UI objects

Icon Name Description




Swing UI

One Swing UI object is created for each class inheriting from:

  • javax.swing.JFrame
  • javax.swing.JWindow
  • javax.swing.JDialog
  • javax.swing.JApplet
  • javax.swing.text.EditorKit
  • javax.swing.AbstractCellEditor
  • javax.swing.JComponent

...except for the following classes which inherit from JComponent:

  • javax.swing.plaf.basic.BasicInternalFrameTitlePane
  • javax.swing.Box
  • javax.swing.Box.Filler
  • javax.swing.JInternalFrame.JDesktopIcon
  • javax.swing.JLabel
  • javax.swing.JSeparator
  • javax.swing.JToolTip
  • javax.swing.JViewport
AWT UI

One AWT UI object is created for each class inheriting from:

  • java.awt.Frame
  • other java.awt.xxx classes
SWT UI

One SWT UI object is created for each class inheriting from:

  • org.eclipse.swt.widgets.Dialog
  • org.eclipse.swt.widgets.Widget
JFace UI

One JFace UI object is created for each class inheriting from:

  • org.eclipse.jface.dialogs.Dialog
  • org.eclipse.jface.dialogs.DialogPage
  • org.eclipse.ui.part.WorkbenchPart

Swing, SWT, JFace Event Handler objects

Icon Name Description

Common Event Handler, Swing Event Handler, SWT Event Handler, JFace Event Handler

One event Handler object is created for each method of anonymous classes present as parameter of following calls:

  • addActionListener
  • addMouseListener
  • addFocusListener
  • ...

If the parameter is not an anonymous class, but an instance on a listener, no handler is created, but a link will be created to the methods which represent event handlers in the listener class. Supported listener classes are those provided in swing and awt (in the following packages: javax.swing.event and java.awt.event). Examples:

  • java.awt.event.ActionListener
  • java.awt.event.ChangeListener
  • java.awt.event.ChangeListener
  • ....

The Jive Swing framework is supported, as soon as the corresponding jar file is defined in the classpath.

  • Creates links from UI objects to Event Handler objects.
  • Creates links from UI objects to java methods which represent event handlers (ex: actionPerformed methods).
  • Creates links from Event Handler objects to java methods called by these handlers.
  • Creates links from Swing UI objects to “actionPerformed” java methods of classes representing actions, when such a class instance is passed as parameters of “JButton::JButton()” or “JButton::setAction()”.

In some cases, when a call to a swing listener method as “actionPerformed” for example is too difficult to find precisely (through addActionListener), a post application procedure is done with a specific algorithm searching for calls to constructors of these listener classes. Then a link to the method can be created.

Examples

public class BookingPanel extends javax.swing.JPanel {
    
    private javax.swing.JButton btnSearch;

    private void initComponents() {
       btnSearch = new javax.swing.JButton();
       btnSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchActionPerformed(evt);
            }
        });
    }
}

public class PanneauEditProfilOuvrage extends JPanel
{
  private Box creerToolBar(TablePaletteFiltre table)
  {
    Action action = new ActionMonter(table);
    JButton btn = new JButton(action);
  }
}

Case of a link found by the post application procedure (with calls to constructors):

public class ASTFrame extends JFrame {
    public ASTFrame(String lab, AST r) {
        super(lab);
        JTreeASTPanel tp = new JTreeASTPanel(new JTreeASTModel(r), null);
   }
}

Alt text

Transactions

A CAST Transaction Configuration Center .tccsetup file is provided defining one transaction entry point for all Swing/SWT/JFace UI objects:

Note that the JEE Analyzer extension also provides Java Swing transaction entry points and these overlap with the configuration provided in the Java Swing extension. CAST recommends disabling the Java Swing transaction entry points provided by the JEE Analyzer extension on a case by case basis, where conflicting results are produced.

In what situation should you install this extension?

If your JEE application source code uses Swing library (javax.swing.*), you should install this extension.

Function Point, Quality and Sizing support

Feature

Supported?

Comments

Function Points
(transactions)

(tick) Indicates whether the extension provides support for OMG Function Point counting and Transaction Risk Index.
Quality and Sizing (error) Indicates whether the extension can measure size and whether a minimum set of Quality Rules exist.

AIP Core compatibility

This extension is compatible with:

AIP Core release Supported
8.3.x (tick)

Download and installation instructions

The extension will not be automatically downloaded and installed in CAST Console. If you need to use it, should manually install the extension using the Application - Extensions interface: