コード例 #1
0
 @Override
 public void setCourseDetails(CourseFinderCourseDetails... details) {
   iDetails = details;
   int tabIndex = 0;
   for (CourseFinderCourseDetails detail : iDetails) {
     ScrollPanel panel = new ScrollPanel(detail.asWidget());
     panel.setStyleName("unitime-ScrollPanel-inner");
     panel.getElement().getStyle().setWidth(780, Unit.PX);
     panel.getElement().getStyle().setHeight(200, Unit.PX);
     iCourseDetailsTabPanel.add(panel, detail.getName(), true);
     Character ch = UniTimeHeaderPanel.guessAccessKey(detail.getName());
     if (ch != null) iTabAccessKeys.put(ch, tabIndex);
     tabIndex++;
   }
   selectLastTab();
 }
コード例 #2
0
 protected void updateCourseDetails() {
   if (iCourses.getSelectedRow() < 0
       || iCourses.getRows() == null
       || iCourses.getRows().length == 0) {
     if (iDetails != null)
       for (CourseFinderCourseDetails detail : iDetails) {
         detail.setValue(null);
       }
     AriaStatus.getInstance().setHTML(ARIA.courseFinderNoCourse());
   } else {
     WebTable.Row row = iCourses.getRows()[iCourses.getSelectedRow()];
     String courseName = MESSAGES.courseName(row.getCell(0).getValue(), row.getCell(1).getValue());
     if ("false".equals(row.getId()))
       courseName =
           MESSAGES.courseNameWithTitle(
               row.getCell(0).getValue(), row.getCell(1).getValue(), row.getCell(2).getValue());
     for (CourseFinderCourseDetails detail : iDetails) detail.setValue(courseName);
     String title = row.getCell(3).getValue();
     String note = row.getCell(4).getValue();
     if (title.isEmpty()) {
       if (note.isEmpty()) {
         AriaStatus.getInstance()
             .setHTML(
                 ARIA.courseFinderSelected(
                     1 + iCourses.getSelectedRow(),
                     iCourses.getRowsCount(),
                     row.getCell(0).getValue(),
                     row.getCell(1).getValue()));
       } else {
         AriaStatus.getInstance()
             .setHTML(
                 ARIA.courseFinderSelectedWithNote(
                     1 + iCourses.getSelectedRow(),
                     iCourses.getRowsCount(),
                     row.getCell(0).getValue(),
                     row.getCell(1).getValue(),
                     note));
       }
     } else {
       if (note.isEmpty()) {
         AriaStatus.getInstance()
             .setHTML(
                 ARIA.courseFinderSelectedWithTitle(
                     1 + iCourses.getSelectedRow(),
                     iCourses.getRowsCount(),
                     row.getCell(0).getValue(),
                     row.getCell(1).getValue(),
                     title));
       } else {
         AriaStatus.getInstance()
             .setHTML(
                 ARIA.courseFinderSelectedWithTitleAndNote(
                     1 + iCourses.getSelectedRow(),
                     iCourses.getRowsCount(),
                     row.getCell(0).getValue(),
                     row.getCell(1).getValue(),
                     title,
                     note));
       }
     }
   }
 }