Class PlatformControlCenter

    • Field Detail

      • platformaccess

        protected IExternalAccess platformaccess
        The platform access.
      • toolbarvis

        protected java.util.Map<IControlCenterPlugin,​java.lang.Boolean> toolbarvis
        The plugin toolbar visibility.
      • controlcenter

        protected ControlCenter controlcenter
        The global control center.
      • props

        protected Properties props
        The settings of the control center and all plugins.
    • Constructor Detail

      • PlatformControlCenter

        public PlatformControlCenter()
    • Method Detail

      • init

        public IFuture<java.lang.Void> init​(IExternalAccess platformaccess,
                                            ControlCenter controlcenter,
                                            java.lang.String[] plugin_classes)
        Initialize a control center.
      • getPluginComponent

        protected javax.swing.JComponent getPluginComponent​(IControlCenterPlugin pl)
      • addPluginComponent

        protected void addPluginComponent​(IControlCenterPlugin pl,
                                          javax.swing.JComponent comp)
      • dispose

        public IFuture<java.lang.Void> dispose()
        Close all active plugins. Called when the JCC exits.
      • savePlatformProperties

        public IFuture<java.lang.Void> savePlatformProperties()
        Push plugin settings to platform and save platform properties.
      • isPluginVisible

        public boolean isPluginVisible​(IControlCenterPlugin pl)
        Test if a plugin is visible in the toolbar.
        Parameters:
        pl - The plugin.
        Returns:
        True, if is visible.
      • setPluginVisible

        public void setPluginVisible​(IControlCenterPlugin pl,
                                     boolean vis)
        Set the visible state of a plugin.
      • getToolbarPlugins

        public IControlCenterPlugin[] getToolbarPlugins​(boolean vis)
        Get the toolbar plugins that are visible or not visible.
      • getControlCenter

        public ControlCenter getControlCenter()
        Get the global control center.
      • getPluginForName

        public IControlCenterPlugin getPluginForName​(java.lang.String name)
        Find a plugin by name.
        Returns:
        null, when plugin is not found.
      • loadPlugins

        protected IFuture<java.lang.Void> loadPlugins​(Property[] ps,
                                                      int i,
                                                      java.util.List<Tuple2<IControlCenterPlugin,​javax.swing.JComponent>> newpls,
                                                      java.lang.ClassLoader cl)
        Load plugins iteratively.
      • showPlugin

        public void showPlugin​(java.lang.String name)
        Switch to a plugin. Shows the plugin, if available.
        Specified by:
        showPlugin in interface IControlCenter
      • setStatusText

        public void setStatusText​(java.lang.String text)
        Set a text to be displayed in the status bar. The text will be removed automatically after some delay (or replaced by some other text).
        Specified by:
        setStatusText in interface IControlCenter
      • getStatusComponent

        public javax.swing.JComponent getStatusComponent​(java.lang.Object id)
        Get a component from the status bar.
        Specified by:
        getStatusComponent in interface IControlCenter
        Parameters:
        id - Id used for adding a component.
        Returns:
        The component to display.
      • addStatusComponent

        public void addStatusComponent​(java.lang.Object id,
                                       javax.swing.JComponent comp)
        Add a component to the status bar.
        Specified by:
        addStatusComponent in interface IControlCenter
        Parameters:
        id - An id for later reference.
        comp - An id for later reference.
      • removeStatusComponent

        public void removeStatusComponent​(java.lang.Object id)
        Remove a previously added component from the status bar.
        Specified by:
        removeStatusComponent in interface IControlCenter
        Parameters:
        id - The id used for adding the component.
      • displayError

        public void displayError​(java.lang.String errortitle,
                                 java.lang.String errormessage,
                                 java.lang.Exception exception)
        Display an error dialog.
        Specified by:
        displayError in interface IControlCenter
        Parameters:
        errortitle - The title to use for an error dialog (required).
        errormessage - An optional error message displayed before the exception.
        exception - The exception (if any).