How does a program detect at runtime whether it is running standalone GUI, thin client or with Web Direct 2.0?

Question ID : 106
Created on 2009-09-21 at 4:31 PM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=106



To determine where the user interface is running, whether standalone (Java Swing), thin client or in a web browser (Web Direct 2.0), add the following to your program:

01 GUI-FACTORY-NAME PIC X(44) VALUE SPACES.
   88 IS-JAVA-SWING VALUE SPACES.
   88 IS-WEB-DIRECT-2-0 VALUE
      "com.iscobol.gui.client.zk.GuiFactoryImpl".
   88 IS-CHARACTER VALUE
      "com.iscobol.gui.client.charva.GuiFactoryImpl".

    ACCEPT GUI-FACTORY-NAME
      FROM ENVIRONMENT "guifactory.class".

and then you can test for the UI type using the condition variables. For example, to test for Web Direct 2.0:

    IF IS-WEB-DIRECT-2-0 THEN
       ...
    END-IF.

If IS-JAVA-SWING is true then use the following code to determine whether the Java Swing GUI is running locally or remotely via thin client:

    ACCEPT TERMINAL-ABILITIES FROM TERMINAL-INFO
    IF IS-REMOTE THEN
       ...
    END-IF




Back to Original Question