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 Color
Gets the color to use for fields that have changed.static PAppContext
Gets the currentPAppContext
object.static Color
Gets the color to use for fields in an error condition.static Color
Gets the color to use for fields that are required.static PClientServices
Gets a global instance of an appropriatePClientServices
object.static PClientServices
getServices
(Applet app) Gets a global instance of an appropriatePClientServices
object that is called from an applet.static PClientServices
getServices
(JFrame frame, URL props) Gets a global instance of an appropriatePClientServices
object, given a frame and application property file to use.static PClientServices
getServices
(JFrame frame, URL props, String res) Gets a global instance of an appropriatePClientServices
object, given a frame, the application property file, and the application resource file.static void
Initializes the look and feelstatic void
setContext
(PAppContext main) Sets the currentPAppContext
object.static void
setCurrentTheme
(com.jgoodies.looks.plastic.PlasticTheme theme) Sets the current theme with the passed theme.static void
setCustomServices
(PClientServices serv, boolean initContext) Sets a customPClientServices
subclass.
-
Constructor Details
-
PClientContext
public PClientContext()
-
-
Method Details
-
getContext
Gets the currentPAppContext
object. If one doesn't exist, for example, within a test environment, null is returned.- Returns:
- The application context object.
-
setContext
Sets the currentPAppContext
object. This is called by main or thePInfranetApplet
when a main panel that implements thePAppContext
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
- aPAppContext
object
-
getServices
Gets a global instance of an appropriatePClientServices
object.- Returns:
- A globally scoped
PClientServices
object.
-
getServices
Gets a global instance of an appropriatePClientServices
object, 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
PClientServices
object.
-
getServices
Gets a global instance of an appropriatePClientServices
object, 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
PClientServices
object.
-
getServices
Gets a global instance of an appropriatePClientServices
object that is called from an applet.- Parameters:
app
- the applet name- Returns:
- A globally scoped
PClientServices
object.
-
setCustomServices
Sets a customPClientServices
subclass. This is an advanced utility method for users with unique requirements for aPClientServices
object. Call this before any other BAS framework API.- Parameters:
serv
- thePClientServices
object 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
Color
to use to indicate errors.
-
getRequiredColor
Gets the color to use for fields that are required.- Returns:
- A
Color
to use to indicate required data.
-
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
-