Exemplo n.º 1
0
 public void addNewCourseSelector() {
   for (int i = 0; i < 15; i++) {
     if (!courseList.get(i).getCourseSelector().isAttached()) {
       courseSelectorWrapper.insert(
           courseList.get(i).getCourseSelector(), courseSelectorWrapper.getWidgetCount() - 1);
       courseList.get(i).setCourseLabel(courseSelectorWrapper.getWidgetCount() - 1);
       break;
     }
   }
 }
  private void moveItemDown(VerticalPanel vertialPanel, Widget widget) {
    int index = vertialPanel.getWidgetIndex(widget);

    if (widget instanceof SortColumnWidget && index == vertialPanel.getWidgetCount() - 1) return;
    else if (widget instanceof DisplayColumnWidget && index == vertialPanel.getWidgetCount() - 2)
      return;

    vertialPanel.remove(widget);
    vertialPanel.insert(widget, index + 1);
  }
 @Override
 public void setTabs(CourseFinderTab... tabs) {
   iTabs = tabs;
   if (iTabs.length == 1) {
     if (iTabs[0].asWidget() instanceof VerticalPanel) {
       VerticalPanel vp = (VerticalPanel) iTabs[0].asWidget();
       while (vp.getWidgetCount() > 0) {
         Widget w = vp.getWidget(0);
         vp.remove(w);
         iDialogPanel.add(w);
       }
     } else {
       iDialogPanel.add(iTabs[0].asWidget());
     }
   } else {
     iTabPanel = new UniTimeTabPanel();
     int tabIndex = 0;
     for (CourseFinderTab tab : iTabs) {
       iTabPanel.add(tab.asWidget(), tab.getName(), true);
       Character ch = UniTimeHeaderPanel.guessAccessKey(tab.getName());
       if (ch != null) iTabAccessKeys.put(ch, tabIndex);
       tabIndex++;
     }
     iTabPanel.selectTab(0);
     iDialogPanel.add(iTabPanel);
   }
   for (final CourseFinderTab tab : iTabs) {
     tab.addValueChangeHandler(
         new ValueChangeHandler<String>() {
           @Override
           public void onValueChange(ValueChangeEvent<String> event) {
             if (event.getSource().equals(tab)) selectTab(tab);
             else tab.setValue(event.getValue());
             iFilter.setValue(event.getValue());
           }
         });
     tab.addSelectionHandler(
         new SelectionHandler<String>() {
           @Override
           public void onSelection(SelectionEvent<String> event) {
             iFilter.setValue(event.getSelectedItem());
             hide();
             SelectionEvent.fire(CourseFinderDialog.this, getValue());
           }
         });
     tab.addResponseHandler(
         new ResponseHandler() {
           @Override
           public void onResponse(ResponseEvent event) {
             if (event.isValid()) {
               CourseFinderTab selected = getSelectedTab();
               if (selected != null && selected.isCourseSelection() && selected.getValue() != null)
                 return;
               selectTab(tab);
             }
           }
         });
   }
 }
  private List<Parameter> getCurrentParameters() {
    List<Parameter> parameters = new ArrayList<Parameter>();

    for (int i = 0; i < parametersPanel.getWidgetCount(); i++) {
      HorizontalPanel entry = (HorizontalPanel) parametersPanel.getWidget(i);
      parameters.add(new Parameter(getParameterKey(entry), getParameterValue(entry)));
    }
    return parameters;
  }
  private void refreshParameters() {
    getSelectedConfiguration().clearParameters();

    for (int i = parametersPanel.getWidgetCount() - 1; i >= 0; i--) {
      HorizontalPanel entry = (HorizontalPanel) parametersPanel.getWidget(i);
      String key = getParameterKey(entry);

      if (mustDiscardParameter(key)) removeParameter(entry);
      else getSelectedConfiguration().addParameter(new Parameter(key, getParameterValue(entry)));
    }
  }
Exemplo n.º 6
0
 public void addNewCourseSelector(String course, float tariff, int graduation) {
   System.out.println("LALALAL" + course + "," + tariff + "," + graduation);
   int temp2 = 0;
   for (int i = 0; i < 10; i++) {
     if (!courseList.get(i).getCourseSelector().isAttached()) {
       createMemberPanel.insert(
           courseList.get(i).getCourseSelector(), createMemberPanel.getWidgetCount() - 1);
       temp2 = i;
       break;
     }
   }
 }
  public List<SortField> getSortFields() {

    List<SortField> sortFields = new ArrayList<SortField>();

    int count = sortPanel.getWidgetCount();
    for (int i = 1; i < count; i++) {
      DisplayColumnWidget displayColumnWidget = dispColMap.get(sortPanel.getWidget(i));
      sortFields.add(
          new SortField(displayColumnWidget.getName(), displayColumnWidget.getSortOrder()));
    }

    return sortFields;
  }
  public List<DisplayField> getDisplayFields() {

    List<DisplayField> displayFields = new ArrayList<DisplayField>();

    int count = columnPanel.getWidgetCount();
    for (int i = 1; i < count; i++) {
      Widget widget = columnPanel.getWidget(i);
      if (widget instanceof DisplayColumnWidget) {
        DisplayColumnWidget displayColumnWidget = (DisplayColumnWidget) widget;
        displayFields.add(
            new DisplayField(
                displayColumnWidget.getName(),
                displayColumnWidget.getText(),
                displayColumnWidget.getAggregateFunction(),
                displayColumnWidget.getDataType()));
      }
    }

    return displayFields;
  }
Exemplo n.º 9
0
 public void removeLastCourseSelector() {
   courseSelectorWrapper.remove(courseSelectorWrapper.getWidgetCount() - 2);
 }
Exemplo n.º 10
0
  private void clearConditions() {
    while (columnPanel.getWidgetCount() > 1) columnPanel.remove(columnPanel.getWidget(1));

    while (sortPanel.getWidgetCount() > 1) sortPanel.remove(sortPanel.getWidget(1));
  }