Class ProxyComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class ProxyComponent extends JComponent
Component for configuring network proxies. There are some static methods for the case where a GUI will not be used, and for configuring the location of entries in the preference database. The classes ProxyDialog and ProxyMenuItem are the ones a GUI will typically use (usually just the menu item as it will handle everything).

The resource org/bzdev/swing/proxyconf/lpack/ProxyComponent.html and its 'dark mode' equivalent org/bzdev/swing/proxyconf/lpack/ProxyComponent.dm.html contain HTML pages that can be used for documentation (these pages uses HTML 3.2 because that is the version supported by a JEditorPane). Both pages depend on the sresource URL scheme, which indicates that the resource is located on the application's class path. If used, org.bzdev.protocols.Handlers.enable() must be called.

See Also:
  • Method Details

    • setPrefNodeName

      public static void setPrefNodeName(String prefname)
      Set the name of the preference node for proxies.
      Parameters:
      prefname - the name of the preference node; null for the default (ProxyInfo.DEFAULT_PREF_NODE).
    • setProxies

      public static void setProxies(ProxyInfo info)
      Set proxies. This is intended for cases in which a GUI will not be used.
      Parameters:
      info - proxy-configuration data; null implies that no data is provided
    • createDialog

      public static ProxyDialog createDialog(Container immediate, String title, boolean modal, Object object)
      Create a dialog box containing a proxy component.
      Parameters:
      immediate - a descendant (or child) of the Frame or Dialog that owns the dialog to be created
      title - the string to display in the dialog's title bar
      modal - specifies whether dialog blocks user input to other top-level windows when shown. If true, the modality type property is set to Dialog.DEFAULT_MODALITY_TYPE, otherwise the dialog is modeless
      object - either the previous ProxyDialog that was created or a ProxyInfo object defining how the proxies should be configured with null indicating the values stored as preferences under the node whose name is ProxyInfo.DEFAULT_PREF_NODE
      Returns:
      the dialog