Class ModuleApp

All Implemented Interfaces:
EventListener, IClassInstantiationAtResolve, IClientCachePreload, IClientCacheResource, IGProp<GProp<?>[]>, IPropCnr, Cloneable

This Module Applications settings that defines the behavior of the application and contains its settings.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • ModuleApp

      public ModuleApp()
      Creates the applications properties without a name. The name must be set in all cases using the setPropertyAtom call.
    • ModuleApp

      public ModuleApp(Atom propertyAtom)
      Creates the applications properties with the specified name.
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
  • Method Details

    • addPredefinedProps

      protected void addPredefinedProps() throws PropException
      Adds the predefined properties for this container. This method is called once just after construction of the property container and sometimes population of it.

      The method should add properties to create or get reference to using the maybeAddProp method. When the PropCnr instance is cloned, the method getPredefinedProps() is called in order for the subclass to be able to retrieve the new instances to these properties, if stored in instance variables.

      Subclasses must override this method to do the appropriate initialization, as this method does nothing for the PropCnr class implementation.

      Overrides:
      addPredefinedProps in class PropCnr
      Throws:
      PropException - for property exceptions.
    • getPredefinedProps

      protected void getPredefinedProps()
      Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.

      The method should get reference to using the getProp(...) methods. This allows the subclass to be able to retrieve the new instances to the properties created during addPredefinedProps() if stored in instance variables.

      Subclasses must override this method to do the appropriate initialization, as this method does nothing for the PropCnr class implementation.

      Overrides:
      getPredefinedProps in class PropCnr
    • clone

      public ModuleApp clone()
      Clones the ModuleApp.
      Overrides:
      clone in class PropCnr
    • getName

      public String getName()
      Gets the name of the application using the default language code.
      Returns:
      The application name, or null if not defined.
    • getName

      public String getName(String languageCode)
      Gets the name of the application using the specified language code.
      Parameters:
      languageCode - The language code, or null for the default language code.
      Returns:
      The potentially localized application name (default text table or none is used when the languageCode is null). The application name may be null if not defined.
    • getNameKString

      public KString getNameKString()
      Gets the name of the application as a KString.
      Returns:
      The application name, or null if not defined. The name may be localized using the text tables.
    • getDescription

      public String getDescription()
      Gets the description of the application using the default language code.
      Returns:
      The application name, or null if not defined.
    • getDescription

      public String getDescription(String languageCode)
      Gets the description of the application using the specified language code.
      Parameters:
      languageCode - The language code, or null for the default language code.
      Returns:
      The potentially localized application description (default text table or none is used when the languageCode is null). The application description may be null if not defined.
    • getDescriptionKString

      public KString getDescriptionKString()
      Gets the description of the application as a KString.
      Returns:
      The application description, or null if not defined. The description may be localized using the text tables.
    • getTextTable

      public TextTable getTextTable()
      Gets the text table that is assigned to the app. In case the application is localized, then you can get text tables for a particular language code, or all, from this instance.
      Returns:
      The text table for the application, or null if none is set.
    • getTextTable

      public TextTable getTextTable(String languageCode) throws LanguageException
      Gets the text table used for a particular language code defined in the app. In the case the language code is mapped to another language, that text table will be returned.
      Parameters:
      languageCode - The language code, or null for the default language.
      Returns:
      The text table for the application, or null if none is set.
      Throws:
      LanguageException - If the languageCode is unknown.
    • isAppLocalized

      public boolean isAppLocalized()
      Gets the setting if this is a localized application, i.e. has support to be displayed in different languages, thus has support uses multiple text tables. This is known by checking the text tables derived text tables and their language codes, and so on. But this is not an optimal solution because it requires computation.
      Returns:
      The configured setting by the app developer if this app supports localization. If so, the text table should have derived text tables for all defined language codes. Errors and warnings will be displayed to the app developer if there is a mismatch of the localization settings and defined language codes.
    • getVSReference

      public VSReference getVSReference(Atom refAtom)
      Gets the VSReference that is initially used as start-up for the application.
      Specified by:
      getVSReference in interface IGProp<GProp<?>[]>
      Overrides:
      getVSReference in class PropCnr
      Parameters:
      refAtom - The property asking for the VSReference.
      Returns:
      The instance of the VSReference or null if unassigned. The returned instance could also be a VSParticipant and should therefore be processed accordingly.
    • createVSReference

      public VSReference createVSReference(Atom refAtom, PropCnr[] returnParent)
      Creates a VSReference instance from the container or any parent containers. The method is used in the Designer to create a VirtualSpace connection for VSRelativeReference to look up the VSReference instance in order to resolve the relative path to the target property.

      This method needs to be overridden by subclasses of PropCnr that has a VSReference as property, and *SHOULD* match getVSReference(Atom).

      The default is to re-target the call to the parent container, and if the root, a folder or a file property is reached, null is returned.

      Overrides:
      createVSReference in class PropCnr
      Parameters:
      refAtom - The property asking for the VSReference.
      returnParent - An array of PropCnr [1] that will be filled in with the parent property of the VSRefernce.
      Returns:
      The instance of the VSReference or null if unassigned. The returned instance could also be a VSParticipant and should therefore be processed accordingly.

      For this method, it's a VSReference.

    • getInitialVSComponent

      public VSComponent getInitialVSComponent()
      Gets the component that initially should have focus, or be called (if VSAction is returned).
      Returns:
      The initial focus or action to call, null for none.
    • getAppSessionFocusProvider

      public IAppSessionFocusProvider getAppSessionFocusProvider()
      Gets the class implementing the interface for application focus provider.
      Returns:
      The instance providing custom focus processing, or null for none (i.e. only default processing).
    • getSelectorReference

      public SelectorReference getSelectorReference()
      Gets the selector reference.
    • isSelectorSelected

      public boolean isSelectorSelected(EnvProps envProps)
      Verifies if the Module Application (project) is selected or not.
      Parameters:
      envProps - The Client Properties for the Client connections.
      Returns:
      true if selected or no selector is defined, false if unselected or the reference is not resolved.
    • getConfiguredLanguages

      public AppLanguages getConfiguredLanguages()
      Gets the configured languages for the Module application.
      Returns:
      The application languages to use.
    • invalidatePossibleThemes

      public void invalidatePossibleThemes()
      Method to invalidate the computed possible themes.
    • computePossibleThemes

      public GThemes computePossibleThemes()
      Lengthy helper function to compute the possible themes for a module application.

      Once calculated in the server, the value never changes. In the designer, it needs recomputing only when a new panels are added, moved, removed, has theme changes or folders changed/removed with theme masks.

      Returns:
      The return value is a mask of the possible themes.
    • getDefaultThemes

      public GThemes getDefaultThemes()
      Gets the default themes to use for desktop and mobile.
      Returns:
      The theme mask, potentially excluding desktop or mobile!
    • getApplicationThemes

      public GThemes getApplicationThemes()
      Gets the application themes to use for desktop and mobile that are supported.
      Returns:
      The theme mask, generally both desktop and mobile, never null.
    • getIconBitmapReference

      public ImageReference getIconBitmapReference()
      Gets the reference to the app icon bitmap.
      Returns:
      The image reference, or null if not defined.
    • getIconBitmap

      public IImageTarget getIconBitmap()
      Gets the app icon bitmap.
      Returns:
      The image, or null if not defined or not of correct format (in case of incorrect format, a warning message is logged).
    • getIconSVGReference

      public ImageReference getIconSVGReference()
      Gets the reference to the app icon SVG.
      Returns:
      The image reference, or null if not defined.
    • getIconSVG

      public IImageTarget getIconSVG()
      Gets the app icon SVG.
      Returns:
      The image, or null if not defined or not of correct format (in case of incorrect format, a warning message is logged).
    • getIconBackgroundColor

      public GColor getIconBackgroundColor()
      Gets the icon background color, optionally used for SVG icons and/or PNG transparent images.reference to the app icon bitmap.
      Returns:
      The color, or null if not defined.
    • getTileColor

      public GColor getTileColor()
      Gets the tile color for Windows (8) Start menu.
      Returns:
      The color, or null if not defined.
    • getThemeColor

      public GColor getThemeColor()
      Gets the theme color for Safari on macOS and iOS.
      Returns:
      The color, or null if not defined.
    • getCSSAssetReferences

      public CSSAssetReferences getCSSAssetReferences()
      Gets the CSS asset file references property used to defined custom CSS, to be loaded for the entire app.
      Returns:
      The CSSAssetReferences instance, or null for none.
    • sendCustomCSS

      public void sendCustomCSS(IPropMgrInfoProvider infoProvider, ITransactionCreator transCreator, ITransactionSender sender)
      Send custom CSS to client upon start.
      Parameters:
      transCreator - The creator of send transactions.
      sender - Sends client transactions.
    • getCacheOperation

      public int getCacheOperation()
      Gets the cache value.
      Returns:
      The cache value: 0=no cache, 1=on-first-use (default), 2=preload.
    • isCachedOnClient

      public boolean isCachedOnClient()
      Returns if the resource (font, image, etc) is to be cached on the client side or not.
      Specified by:
      isCachedOnClient in interface IClientCacheResource
      Returns:
      true to cache font (default), or false for client session use only.
    • isCachePreloaded

      public boolean isCachePreloaded()
      Returns if the resource (font, image, etc) is to be cached on the client side when the application starts or not.
      Specified by:
      isCachePreloaded in interface IClientCacheResource
    • getPreloadClientCacheResources

      public PreloadClientCacheResource[] getPreloadClientCacheResources(IClientSessionGyro clientGyro)
      Returns the list of resources that are required on the client side in the preload-to-cache mechanism.
      Specified by:
      getPreloadClientCacheResources in interface IClientCachePreload
      Parameters:
      clientGyro - The client gyro engine.
      Returns:
      An array with the resources required.
    • isAvailableForPhones

      public boolean isAvailableForPhones()
      Checks if app is available for iiziRun Phones.
      Returns:
      true (default) if available, false otherwise.
    • isAvailableForTablets

      public boolean isAvailableForTablets()
      Checks if app is available for iiziRun Tablets.
      Returns:
      true (default) if available, false otherwise.
    • isAvailableForBrowsers

      public boolean isAvailableForBrowsers()
      Checks if app is available for iiziApp Browsers.
      Returns:
      true (default) if available, false otherwise.
    • verify

      public boolean verify(PropVerification verification)
      Verifies this property container. The check performed is the extension of classes and that no circular reference is present.
      Specified by:
      verify in interface IGProp<GProp<?>[]>
      Overrides:
      verify in class PropCnr
      Parameters:
      verification - The property verification class.
      Returns:
      true if verification should proceed, false if disposed of and verification should not take place.