Datalayer VS Code Extension - v0.0.4
    Preparing search index...

    Class DatalayerStatusBar

    Manages the Datalayer status bar item.

    This class provides a singleton status bar item that displays the current authentication state and allows quick access to login/logout functionality. The status bar automatically updates when the authentication state changes.

    // In extension activation
    const authProvider = SDKAuthProvider.getInstance(sdk, context);
    const statusBar = DatalayerStatusBar.getInstance(authProvider);

    // Status bar automatically updates when auth state changes
    // No manual updates needed - handled via event listeners

    SDKAuthProvider - for authentication management

    Implements

    • Disposable
    Index

    Methods

    • Dispose of the status bar item.

      Cleans up the VS Code status bar item resource. This method should be called when the extension is deactivated to properly release the status bar resources.

      Returns void

      // In extension deactivate function
      export function deactivate() {
      const statusBar = DatalayerStatusBar.getInstance();
      statusBar.dispose();
      }
    • Get or create the singleton instance of the status bar.

      This method implements the singleton pattern to ensure only one status bar item is created for the extension. The authProvider parameter is required only on first call.

      Parameters

      • OptionalauthProvider: SDKAuthProvider

        The authentication provider (required on first call)

      Returns DatalayerStatusBar

      The singleton instance of DatalayerStatusBar

      Error if authProvider is not provided on first call

      // First call - authProvider required
      const statusBar = DatalayerStatusBar.getInstance(authProvider);

      // Subsequent calls - authProvider optional
      const sameStatusBar = DatalayerStatusBar.getInstance();