Class StudentCourseTabbedPane

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, SwingConstants

public class StudentCourseTabbedPane extends DynamicTabbedPane<StudentQuotationsPanel> implements PropertyChangeListener
Since:
1.0 6 janv. 2009
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • StudentCourseTabbedPane

      public StudentCourseTabbedPane(Student student, Collection<Course> availableCourses, boolean dynamicallyExpandable)
      Parameters:
      dynamicallyExpandable -
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • setStudent

      public void setStudent(Student student)
    • getNewTabTitle

      public String getNewTabTitle()
      Specified by:
      getNewTabTitle in class DynamicTabbedPane<StudentQuotationsPanel>
      Returns:
      the text shown on the new tab
    • getNewTabView

      public StudentQuotationsPanel getNewTabView()
      Description copied from class: DynamicTabbedPane
      The implementation of getNewTabView must provides an instance of a <T> component to show when the new tab will be selected.
      Specified by:
      getNewTabView in class DynamicTabbedPane<StudentQuotationsPanel>
      Returns:
      <T> component to associate to the new tab
    • openTab

      public StudentQuotationsPanel openTab(Course course)
    • getLastCourse

      protected Course getLastCourse() throws Exception
      Throws:
      Exception
    • onOpenNewTab

      public StudentQuotationsPanel onOpenNewTab()
      Description copied from class: DynamicTabbedPane
      Override this method if you want other things to happen when opening a new tab.
      The override method may be like that :
        public StudentQuotationsPanel onOpenNewTab() {
        StudentQuotationsPanel studentQuotationsPanel = null;
        if (availableCourses == null || availableCourses.size() < 1) {
              JOptionPane.showMessageDialog(this, getLocalized("student.noCourse2Add")
                              + student.toString() + ".", getLocalized("course.add"),
                              JOptionPane.INFORMATION_MESSAGE);
        
        } else {
              Course course = (Course) JOptionPane.showInputDialog(this,
                              getLocalized("student.selectCourse2Add"), getLocalized("course.add"),
                              JOptionPane.PLAIN_MESSAGE,
                              BrolImagesEduCotation.COURSE_LOGO.getIcon(),
                              availableCourses.toArray(new Course[0]), null);
              if (course != null) {
                      startTab(course);
              }
        }
        return studentQuotationsPanel;
        }
        
      Overrides:
      onOpenNewTab in class DynamicTabbedPane<StudentQuotationsPanel>
      Returns:
      null if selection failed or canceled, T object otherwise
    • onCloseTab

      protected void onCloseTab(int index)
      Description copied from class: DynamicTabbedPane
      Removes the tab at the specified index
      Overrides:
      onCloseTab in class DynamicTabbedPane<StudentQuotationsPanel>
      Parameters:
      index - position of the tab to close