psdi.util

Class Resolver

  • java.lang.Object
    • psdi.util.Resolver


  • public class Resolver
    extends java.lang.Object
    Take care of locating a resource in the various places it could reside. To establish this, it will use the Locale, User Group and current activity/view/clone the user wishes to use. Resource files may be cached in order to optimize performance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.applet.Applet getApplet()
      return the appet that is running
      Message getMessage(java.lang.String bundle, java.lang.String key)
      Return a message with the specified key from the specified bundle.
      static Resolver getResolver()
      Return the current Resolver for this VM.
      Message getTaggedMessage(java.lang.String bundle, java.lang.String key)
      Called from MXException This message will tag the group and key information also Return a message with the specified key from the specified bundle.
      static boolean isApp()
      Is the class currently running as an application, i.e.
      static void isApp(boolean state)
      Call with true from main to inform other applications that this is an application, not just an applet
      java.io.InputStream resolveDoclink(java.lang.String name)
      Find a doclink image.
      java.io.InputStream resolveImage(java.lang.String name)
      Find an image.
      java.io.InputStream resolveMenu(java.lang.String name)
      Find a menu file
      java.io.InputStream resolveMessage(java.lang.String msg)
      Find a message bundle.
      java.lang.String resolveScreen(java.lang.String name)
      Find a screen file
      java.io.InputStream resolveTextFile(java.lang.String name)
      Find a generic file given the name.
      void setApplet(java.applet.Applet ap)
      Set pointer to applet.
      static void setMapResourceFileName(java.lang.String fileName)
      Sets the map resource filename default is /resources/resource.map : Note : Before calling any resource mapping programmer first has to call this if they do not like the default value.
      void setPath(java.lang.String p) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getResolver

        public static Resolver getResolver()
        Return the current Resolver for this VM. This is done as an optimization as the resolver can cache previous request so that it may be able to run quicker.
      • setPath

        public void setPath(java.lang.String p)
      • setMapResourceFileName

        public static void setMapResourceFileName(java.lang.String fileName)
        Sets the map resource filename default is /resources/resource.map : Note : Before calling any resource mapping programmer first has to call this if they do not like the default value. Once any resouce has been mapped then setting this value will not have any effect because all resources has been loaded in memory
        Parameters:
        fileName -
      • resolveMessage

        public java.io.InputStream resolveMessage(java.lang.String msg)
        Find a message bundle.
      • resolveMenu

        public java.io.InputStream resolveMenu(java.lang.String name)
        Find a menu file
      • resolveScreen

        public java.lang.String resolveScreen(java.lang.String name)
        Find a screen file
      • resolveImage

        public java.io.InputStream resolveImage(java.lang.String name)
        Find an image. IMPORTANT - Unlike other resolver methods, this requires the entire name of the file INCLUDING extension. Images are ALWAYS in the resources/images directory.
      • resolveDoclink

        public java.io.InputStream resolveDoclink(java.lang.String name)
        Find a doclink image. IMPORTANT - Unlike other resolver methods, this requires the entire name of the file INCLUDING extension.
      • resolveTextFile

        public java.io.InputStream resolveTextFile(java.lang.String name)
        Find a generic file given the name. Name parameters includes the file extension.
      • isApp

        public static boolean isApp()
        Is the class currently running as an application, i.e. was it started thru main(). The main method should call isApp(true) for this to work.
      • isApp

        public static void isApp(boolean state)
        Call with true from main to inform other applications that this is an application, not just an applet
      • setApplet

        public void setApplet(java.applet.Applet ap)
        Set pointer to applet. Called in the init() of applet
      • getApplet

        public java.applet.Applet getApplet()
        return the appet that is running
      • getMessage

        public Message getMessage(java.lang.String bundle,
                                  java.lang.String key)
        Return a message with the specified key from the specified bundle. The message returned will always be in base language. This will throw exception if it is called from the client side directly. You have to use MboRemote or MboSetRemote's getMessage() method to retrieve message from the client side.
      • getTaggedMessage

        public Message getTaggedMessage(java.lang.String bundle,
                                        java.lang.String key)
        Called from MXException This message will tag the group and key information also Return a message with the specified key from the specified bundle. The message returned will always be in base language. This will throw exception if it is called from the client side directly. You have to use MboRemote or MboSetRemote's getMessage() method to retrieve message from the client side.