Class DesignerContextProxy

  • All Implemented Interfaces:
    ClientContext, CommonContext, DesignerContext

    public class DesignerContextProxy
    extends java.lang.Object
    implements DesignerContext
    This is used for parts of the designer that hold onto a DesignerContext, even though every time you load a project a new designer context is made. So, this context can be permanent, and we just switch out the inner context delegate.
    • Constructor Detail

      • DesignerContextProxy

        public DesignerContextProxy()
    • Method Detail

      • getProjectName

        @Nonnull
        public java.lang.String getProjectName()
        Description copied from interface: ClientContext
        The name of the project this client will be / is running
        Specified by:
        getProjectName in interface ClientContext
      • getEventBus

        public com.google.common.eventbus.EventBus getEventBus()
        Description copied from interface: CommonContext
        This is a generic event bus that can be used by any part of Ignition within a single scope (jvm)
        Specified by:
        getEventBus in interface CommonContext
      • getUIEventBus

        public com.google.common.eventbus.EventBus getUIEventBus()
        Description copied from interface: ClientContext
        This event bus schedules event notification on the swing EDT. This is opposed to the event bus found on CommonContext.getEventBus(), which schedules event notification on a background thread.
        Specified by:
        getUIEventBus in interface ClientContext
      • getNamedQueryManager

        public NamedQueryManager getNamedQueryManager()
        Description copied from interface: ClientContext
        Returns the appropriate named query rpc for the context. In the gateway and client, we only want to use named queries that have been saved. In the designer, we want to use the current version so that reports and bindings can be seen and used for testing before the project is saved.
        Specified by:
        getNamedQueryManager in interface ClientContext
        Returns:
        The correct NamedQueryManager implementation for the scope.
      • addBeanInfoSearchPath

        public void addBeanInfoSearchPath​(java.lang.String packageName)
        Description copied from interface: DesignerContext
        Adds the given fully-qualified path name to the Introspector's BeanInfo search path. BeanInfos can be important for not only visual beans, but for controlling serialization.
        Specified by:
        addBeanInfoSearchPath in interface DesignerContext
        Parameters:
        packageName - fully-qualified path name. Not null.
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.lang.String property,
                                              java.beans.PropertyChangeListener pcl)
        Specified by:
        addPropertyChangeListener in interface ClientContext
      • exportResources

        public void exportResources​(java.util.Collection<ResourcePath> resourceIds)
        Description copied from interface: DesignerContext
        Shows the project export window (after doing a commit) with the given resource IDs checked.
        Specified by:
        exportResources in interface DesignerContext
        Parameters:
        resourceIds - Collection of ProjectResourceIds. Not null, but may be empty.
      • createSerializer

        public XMLSerializer createSerializer()
        Description copied from interface: DesignerContext
        Creates a new XML serializer that has been configured by all installed modules for custom serialization delegates
        Specified by:
        createSerializer in interface DesignerContext
        Returns:
        Not null.
      • getDefaultDatasourceName

        public java.lang.String getDefaultDatasourceName()
        Description copied from interface: ClientContext
        Returns the current project's default datasource name
        Specified by:
        getDefaultDatasourceName in interface ClientContext
      • getAuthProfileName

        public java.lang.String getAuthProfileName()
        Description copied from interface: ClientContext
        Returns the current project's user source
        Specified by:
        getAuthProfileName in interface ClientContext
      • registerClientPermissions

        public void registerClientPermissions​(java.util.Map<java.lang.String,​java.lang.String> bundleMap)
        Description copied from interface: DesignerContext
        Register id-bundlekey pairs to limit client permissions
        Specified by:
        registerClientPermissions in interface DesignerContext
        Parameters:
        bundleMap - Map of ids to bundlekeys. Not null.
      • canEditResourceProtection

        public boolean canEditResourceProtection()
        Description copied from interface: DesignerContext
        Checks whether or not the current logged in user can edit the protection bits of project resources.
        Specified by:
        canEditResourceProtection in interface DesignerContext
      • getFrame

        public java.awt.Frame getFrame()
        Description copied from interface: DesignerContext
        Returns the owning frame of the designer. Handy for dialog parents
        Specified by:
        getFrame in interface DesignerContext
      • getRootPaneContainer

        public javax.swing.RootPaneContainer getRootPaneContainer()
        Description copied from interface: ClientContext
        Returns the RootPaneContainer that is currently the owner of the client
        Specified by:
        getRootPaneContainer in interface ClientContext
      • getTagPollRate

        public int getTagPollRate()
        Description copied from interface: ClientContext
        Returns the rate at which Tags should be polled for updates
        Specified by:
        getTagPollRate in interface ClientContext
      • getStatusBar

        public StatusBar getStatusBar()
        Description copied from interface: DesignerContext
        The StatusBar at the bottom of the Designer can be used to display temporary messages and for adding always-present little components that appear in the bottom-right
        Specified by:
        getStatusBar in interface DesignerContext
        Returns:
        Not null.
      • createDeserializer

        public XMLDeserializer createDeserializer()
        Description copied from interface: CommonContext
        Returns an instance of the XMLDeserializer that can be used to deserialize project resources. Note that this is the only safe way to obtain an instance of XMLDeserializer, because the context will pass the new deserializer around to all loaded modules, giving them a chance to initialize any custom deserialization deletes on it first.
        Specified by:
        createDeserializer in interface CommonContext
      • deserialize

        public java.lang.Object deserialize​(byte[] data,
                                            org.apache.log4j.Logger log)
                                     throws SerializationException
        Description copied from interface: ClientContext
        Convenience function to deserialize a gzipped byte array into a single object. If multiple objects are found, they will be discarded. Warnings are logged to the given logger. If data is null or empty, null is returned.
        Specified by:
        deserialize in interface ClientContext
        Throws:
        SerializationException
      • addPropertyEditor

        public void addPropertyEditor​(java.lang.Class<? extends AbstractPropertyEditorPanel> pageClass)
        Description copied from interface: DesignerContext

        Adds a property editor page that will be incorporated into the Designer's project property editing system. This class will be instantiated the first time that the property editor is displayed, and must have either a nullary constructor or a constructor that takes a DesignerContext.

        The Property Editing framework is designed around the idea that modules will store properties in opaquely xml-serialized project resources which can be uniquely identified by their module ID and resource type. The property editing UI will handle the de/serialization and project syncing tasks so that the property editor pages can simply focus on UI.

        Specified by:
        addPropertyEditor in interface DesignerContext
      • getDockingManager

        public com.jidesoft.docking.DockingManager getDockingManager()
        Description copied from interface: DesignerContext
        Returns the JIDE DockingManager for the Designer
        Specified by:
        getDockingManager in interface DesignerContext
      • getToolbarManager

        public com.jidesoft.action.DockableBarManager getToolbarManager()
        Description copied from interface: DesignerContext
        Returns the JIDE dockable toolbar manager
        Specified by:
        getToolbarManager in interface DesignerContext
      • getProject

        public DesignableProject getProject()
        Description copied from interface: ClientContext
        Returns the project that this client is running. Note that this may be null before the client is fully logged in and started, because the context is created before the project is downloaded.
        Specified by:
        getProject in interface ClientContext
        Specified by:
        getProject in interface DesignerContext
      • getModule

        public java.lang.Object getModule​(java.lang.String id)
        Description copied from interface: CommonContext
        Returns the hook class for another module, used for modules that deal with each other's models. Example: The reporting plugin's designer hook uses this to get FactoryPMI's palette.
        Specified by:
        getModule in interface CommonContext
      • getModules

        public java.util.List<ModuleInfo> getModules()
        Description copied from interface: ClientContext
        Retrieve the list of all modules currently loaded in this context
        Specified by:
        getModules in interface ClientContext
      • getEdgeEditions

        public java.util.List<EdgeEdition> getEdgeEditions()
        Description copied from interface: CommonContext
        Returns a list of currently available Edge editions (either licensed or in trial). Does not check if any required modules are installed and running.
        Specified by:
        getEdgeEditions in interface CommonContext