Package com.portal.bas
Class PClientContext
java.lang.Object
com.portal.bas.PClientContext
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorGets the color to use for fields that have changed.static PAppContextGets the currentPAppContextobject.static ColorGets the color to use for fields in an error condition.static ColorGets the color to use for fields that are required.static PClientServicesGets a global instance of an appropriatePClientServicesobject.static PClientServicesgetServices(Applet app) Gets a global instance of an appropriatePClientServicesobject that is called from an applet.static PClientServicesgetServices(JFrame frame, URL props) Gets a global instance of an appropriatePClientServicesobject, given a frame and application property file to use.static PClientServicesgetServices(JFrame frame, URL props, String res) Gets a global instance of an appropriatePClientServicesobject, given a frame, the application property file, and the application resource file.static voidInitializes the look and feelstatic voidsetContext(PAppContext main) Sets the currentPAppContextobject.static voidsetCurrentTheme(com.jgoodies.looks.plastic.PlasticTheme theme) Sets the current theme with the passed theme.static voidsetCustomServices(PClientServices serv, boolean initContext) Sets a customPClientServicessubclass.
-
Constructor Details
-
PClientContext
public PClientContext()
-
-
Method Details
-
getContext
Gets the currentPAppContextobject. If one doesn't exist, for example, within a test environment, null is returned.- Returns:
- The application context object.
-
setContext
Sets the currentPAppContextobject. This is called by main or thePInfranetAppletwhen a main panel that implements thePAppContextinterface is loaded. In the case of an application that loads its own panels, this should be called directly by the application shell.- Parameters:
main- aPAppContextobject
-
getServices
Gets a global instance of an appropriatePClientServicesobject.- Returns:
- A globally scoped
PClientServicesobject.
-
getServices
Gets a global instance of an appropriatePClientServicesobject, given a frame and application property file to use.- Parameters:
frame- a frame to use as the underlying windowprops- the application property file to use- Returns:
- A globally scoped
PClientServicesobject.
-
getServices
Gets a global instance of an appropriatePClientServicesobject, given a frame, the application property file, and the application resource file.- Parameters:
frame- a frame to use as the underlying windowprops- the application property file to useres- the application resource file to use- Returns:
- A globally scoped
PClientServicesobject.
-
getServices
Gets a global instance of an appropriatePClientServicesobject that is called from an applet.- Parameters:
app- the applet name- Returns:
- A globally scoped
PClientServicesobject.
-
setCustomServices
Sets a customPClientServicessubclass. This is an advanced utility method for users with unique requirements for aPClientServicesobject. Call this before any other BAS framework API.- Parameters:
serv- thePClientServicesobject to setinitContext- true if the context should be initialized (this sets up look and feel, for example, the colors to use)
-
getErrorColor
Gets the color to use for fields in an error condition.- Returns:
- A
Colorto use to indicate errors.
-
getRequiredColor
Gets the color to use for fields that are required.- Returns:
- A
Colorto use to indicate required data.
-
getChangedColor
Gets the color to use for fields that have changed.- Returns:
- A
Colorto 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
-