> List of tutorials for developing a Fat-Client in Java

Index – Advanced Java-Fat-Client development

Code for Class JS_ProjAssist_CommandCenter__ActionHandler

* For this document and all references (links) please obey the hints and regulations concerning copyright, disclaimer and trademarks.

  • The owner of this web-site (www.javascout.biz) is not responsible for the content of web-sites linked within this document or linked within other documents of www.javascout.biz.

  • If this document or other documents of this web-site (www.javascout.biz) infringes your rights or you think that rights of others (third parties) are infringed, please inform the author.
    An e-mail can be sent by clicking onto the 'hungry mailbox' in the upper right corner.

Last revision of this document:
2006-09-01

This is document contains the code for Class JS_ProjAssist_CommandCenter__ActionHandler.
This class contains methods that can be called when an action (button-click, mouse-click, change of text, etc) occurs.
For easy 'cut and paste' ;-)

package js_projassist.clientframes;

import java.awt.event.*;
import js_projassist.clientframes.*;

/**
 *
 * @author
kurt@javascout.biz
 * @date 2006-09-01
 *
 * @description
 * Methods to process 'events' that occur in
 * the Command Center for the Fat-Client-Application.
 * Methods in this class are all defined as 'static' as there are no persistant variables.
 * Defining the methods as 'static' has the advantage,
 * that the class does not have to be 'constructed'.
 
*
 * @change-log
 * when          who          why
 * --------------------------------------------------------
 *
 */

public class JS_ProjAssist_CommandCenter__ActionHandler
{
/*
 * -------------------------------
 * Method to handle Actions that were triggered by clicking onto JButtons. */
    
protected static void handleEvent(JS_ProjAssist_CommandCenter parmCC,
                                      ActionEvent parmActionEvent){
/*
 * Get the ActionCommand that was attached to the JButton. */
      String cmd = parmActionEvent.getActionCommand()
;
/* Check which button was clicked and call the appropriate method. */
      if (cmd.equals("btn_Continue")) {
        openBusinessTask(parmCC);
      }
    }

/*
 * -------------------------------
 * Method to get the selected code for the Business Task out of the entry-field
 * and call the frame with the chosen Business Task. */
    
private static void openBusinessTask(JS_ProjAssist_CommandCenter parmCC){
/* 
 * Get the internal code using a combined method that also fills the parameter-fields.
 * Instead of the parameter-fields, 'null'-values are passed to signal the method
 * just to return the internal code. */
      String strInternalCode =
        parmCC.structJSBS_XML_Tasks.processParameterFields(parmCC.get_txt_Code(),
                                                           null, null, null, null, null, null)
;
/* Check which button was clicked and call the appropriate method. */
      if (strInternalCode.equals("P")) {
        JS_ProjAssist_Project frm_JS_ProjAssist_Project = new JS_ProjAssist_Project(parmCC);
        frm_JS_ProjAssist_Project.setVisible(true);
      }
    }

}