Package user.actions

Class EmployeeViewHandler

java.lang.Object
user.actions.EmployeeViewHandler
Direct Known Subclasses:
HRAdminViewHandler, ITAdminViewHandler, PayrollAdminViewHandler

public class EmployeeViewHandler extends Object
Handles the actions and UI interactions for the Employee role.
  • Field Details

    • dateRenderer

      protected final DefaultTableCellRenderer dateRenderer
      Renderer for formatting dates in table cells.
    • employee

      protected Employee employee
      The current employee.
    • myProfilePage

      protected MyProfilePanel myProfilePage
      The MyProfilePanel component.
    • attendancePage

      protected AttendancePanel attendancePage
      The AttendancePanel component.
    • payslipPage

      protected MyPayslipPanel payslipPage
      The MyPayslipPanel component.
    • leavePage

      protected LeavePanel leavePage
      The LeavePanel component.
    • myProfileBTN

      protected JButton myProfileBTN
      Button for navigating to the MyProfilePanel.
    • attendanceBTN

      protected JButton attendanceBTN
      Button for navigating to the AttendancePanel.
    • payslipBTN

      protected JButton payslipBTN
      Button for navigating to the MyPayslipPanel.
    • leaveBTN

      protected JButton leaveBTN
      Button for navigating to the LeavePanel.
    • isAttendanceColumnsRemoved

      protected boolean isAttendanceColumnsRemoved
      Flag indicating whether attendance columns have been removed.
    • isLeaveHistoryColumnsRemoved

      protected boolean isLeaveHistoryColumnsRemoved
      Flag indicating whether leave history columns have been removed.
    • dynamicComponents

      protected DynamicComponents dynamicComponents
      Handler for dynamic components.
  • Constructor Details

    • EmployeeViewHandler

      public EmployeeViewHandler(Employee employee, EmployeeUI employeeUI)
      Constructs an EmployeeViewHandler instance.
      Parameters:
      employee - The employee.
      employeeUI - The EmployeeUI instance.
  • Method Details

    • initComponents

      protected void initComponents()
      Initializes the components for the Java class.
    • initActions

      protected void initActions()
      Initialize actions for various buttons and components in the UI.
    • showMyProfilePage

      protected void showMyProfilePage()
      Show the My-Profile page and display the profile.
    • showLeavePage

      protected void showLeavePage()
      Show the leave page for a specific employee.
    • displayAttendanceRecord

      protected void displayAttendanceRecord() throws AttendanceException
      This method refreshes the display of the attendance records in the attendance table. It clears the existing rows from the table model, hides specific columns from the table, and then adds new rows to the table based on the attendanceRecords data.
      Throws:
      AttendanceException - if there is an issue with the attendance
    • displayLeaveHistory

      protected void displayLeaveHistory() throws LeaveException
      Display the leave history by clearing existing rows from the table model, hiding specific columns, and adding new records to the table model.
      Throws:
      LeaveException - if there is an issue with the leave
    • displayPayslip

      protected void displayPayslip(String period, int month, int employeeID)
      Display the payslip information on the UI.
      Parameters:
      period - the period of the generated payslip
      month - the month of the generated payslip
      employeeID - the ID of the employee
    • resetPanelVisibility

      protected void resetPanelVisibility()
      Resets the visibility of various pages on the panel.