java.lang.Object
user.actions.EmployeeViewHandler
- Direct Known Subclasses:
HRAdminViewHandler
,ITAdminViewHandler
,PayrollAdminViewHandler
Handles the actions and UI interactions for the Employee role.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JButton
Button for navigating to the AttendancePanel.protected AttendancePanel
The AttendancePanel component.protected final DefaultTableCellRenderer
Renderer for formatting dates in table cells.protected DynamicComponents
Handler for dynamic components.protected Employee
The current employee.protected boolean
Flag indicating whether attendance columns have been removed.protected boolean
Flag indicating whether leave history columns have been removed.protected JButton
Button for navigating to the LeavePanel.protected LeavePanel
The LeavePanel component.protected JButton
Button for navigating to the MyProfilePanel.protected MyProfilePanel
The MyProfilePanel component.protected JButton
Button for navigating to the MyPayslipPanel.protected MyPayslipPanel
The MyPayslipPanel component. -
Constructor Summary
ConstructorsConstructorDescriptionEmployeeViewHandler
(Employee employee, EmployeeUI employeeUI) Constructs an EmployeeViewHandler instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
This method refreshes the display of the attendance records in the attendance table.protected void
Display the leave history by clearing existing rows from the table model, hiding specific columns, and adding new records to the table model.protected void
displayPayslip
(String period, int month, int employeeID) Display the payslip information on the UI.protected void
Initialize actions for various buttons and components in the UI.protected void
Initializes the components for the Java class.protected void
Resets the visibility of various pages on the panel.protected void
Show the leave page for a specific employee.protected void
Show the My-Profile page and display the profile.
-
Field Details
-
dateRenderer
Renderer for formatting dates in table cells. -
employee
The current employee. -
myProfilePage
The MyProfilePanel component. -
attendancePage
The AttendancePanel component. -
payslipPage
The MyPayslipPanel component. -
leavePage
The LeavePanel component. -
myProfileBTN
Button for navigating to the MyProfilePanel. -
attendanceBTN
Button for navigating to the AttendancePanel. -
payslipBTN
Button for navigating to the MyPayslipPanel. -
leaveBTN
Button for navigating to the LeavePanel. -
isAttendanceColumnsRemoved
protected boolean isAttendanceColumnsRemovedFlag indicating whether attendance columns have been removed. -
isLeaveHistoryColumnsRemoved
protected boolean isLeaveHistoryColumnsRemovedFlag indicating whether leave history columns have been removed. -
dynamicComponents
Handler for dynamic components.
-
-
Constructor Details
-
EmployeeViewHandler
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
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
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
Display the payslip information on the UI.- Parameters:
period
- the period of the generated payslipmonth
- the month of the generated payslipemployeeID
- the ID of the employee
-
resetPanelVisibility
protected void resetPanelVisibility()Resets the visibility of various pages on the panel.
-