Class NavbarController

java.lang.Object
ui.controller.NavbarController

public class NavbarController extends Object
Controller for the navigation bar. Handles navigation between pages and updates the active button state.
  • Constructor Details

    • NavbarController

      public NavbarController()
  • Method Details

    • setOnNavigate

      public void setOnNavigate(Consumer<Page> onNavigate)
      Sets the navigation callback.
      Parameters:
      onNavigate - the callback for navigating to a page
    • setActivePage

      public void setActivePage(Page page)
      Highlights the navbar button corresponding to the given page.
      Parameters:
      page - the currently active page
    • goHome

      public void goHome()
      Navigates to the home page.
    • goToSignIn

      public void goToSignIn()
      Navigates to the sign in page or profile page depending on authentication state.
    • goToOrganizations

      public void goToOrganizations()
      Navigates to the organizations page.
    • updateAuthButton

      public void updateAuthButton()
      Updates the sign in button text based on the user's authentication state. Shows "My Profile" if signed in, "Sign In" otherwise.
    • hideNavbar

      public void hideNavbar()
      Hides the navbar.
    • showNavbar

      public void showNavbar()
      Shows the navbar.