Class PClientContext

java.lang.Object
com.portal.bas.PClientContext

public class PClientContext extends Object
PClientContext encapsulates information about the physical structure of the application or applet to run. A client component can use this API to move its display to the top, increase or decrease its size, and so forth as needed, without regard to the actual structure. When the applet or application is created, subclass PClientContext to provide the needed functions as fits the real UI.
Version:
5
Author:
Larry Lynch-Freshner
  • Constructor Details

    • PClientContext

      public PClientContext()
  • Method Details

    • getContext

      public static PAppContext getContext()
      Gets the current PAppContext object. If one doesn't exist, for example, within a test environment, null is returned.
      Returns:
      The application context object.
    • setContext

      public static void setContext(PAppContext main)
      Sets the current PAppContext object. This is called by main or the PInfranetApplet when a main panel that implements the PAppContext interface is loaded. In the case of an application that loads its own panels, this should be called directly by the application shell.
      Parameters:
      main - a PAppContext object
    • getServices

      public static PClientServices getServices()
      Gets a global instance of an appropriate PClientServices object.
      Returns:
      A globally scoped PClientServices object.
    • getServices

      public static PClientServices getServices(JFrame frame, URL props)
      Gets a global instance of an appropriate PClientServices object, given a frame and application property file to use.
      Parameters:
      frame - a frame to use as the underlying window
      props - the application property file to use
      Returns:
      A globally scoped PClientServices object.
    • getServices

      public static PClientServices getServices(JFrame frame, URL props, String res)
      Gets a global instance of an appropriate PClientServices object, given a frame, the application property file, and the application resource file.
      Parameters:
      frame - a frame to use as the underlying window
      props - the application property file to use
      res - the application resource file to use
      Returns:
      A globally scoped PClientServices object.
    • getServices

      public static PClientServices getServices(Applet app)
      Gets a global instance of an appropriate PClientServices object that is called from an applet.
      Parameters:
      app - the applet name
      Returns:
      A globally scoped PClientServices object.
    • setCustomServices

      public static void setCustomServices(PClientServices serv, boolean initContext)
      Sets a custom PClientServices subclass. This is an advanced utility method for users with unique requirements for a PClientServices object. Call this before any other BAS framework API.
      Parameters:
      serv - the PClientServices object to set
      initContext - true if the context should be initialized (this sets up look and feel, for example, the colors to use)
    • getErrorColor

      public static Color getErrorColor()
      Gets the color to use for fields in an error condition.
      Returns:
      A Color to use to indicate errors.
    • getRequiredColor

      public static Color getRequiredColor()
      Gets the color to use for fields that are required.
      Returns:
      A Color to use to indicate required data.
    • getChangedColor

      public static Color getChangedColor()
      Gets the color to use for fields that have changed.
      Returns:
      A Color to use to indicate a changed field.
    • setCurrentTheme

      public static void setCurrentTheme(com.jgoodies.looks.plastic.PlasticTheme theme)
      Sets the current theme with the passed theme.
      Parameters:
      theme -
    • initLookAndFeel

      public static void initLookAndFeel()
      Initializes the look and feel