Exemplo n.º 1
0
  private ButtonPanel createButtonPanel() {
    final Button customizeButton = new Button("");
    customizeButton.setVisible(_isDashboardEditor);
    customizeButton.addStyleDependentName("ImageButton");
    customizeButton.setTitle("Customize timeline");
    customizeButton.addStyleName("CustomizeButton");
    customizeButton.addClickHandler(new CustomizeTimelineHandler(_service, this));

    final Button copyButton = new Button("");
    copyButton.setVisible(_isDashboardEditor);
    copyButton.addStyleDependentName("ImageButton");
    copyButton.setTitle("Copy timeline");
    copyButton.addStyleName("CopyButton");
    copyButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            TimelinePanel copyPanel =
                new TimelinePanel(_tenant, _service, null, _timelineGroupPanel, _isDashboardEditor);
            copyPanel.setTimelineDefinition(_timelineDefinition);
            _timelineGroupPanel.add(copyPanel);
          }
        });

    final ButtonPanel buttonPanel = new ButtonPanel();

    buttonPanel.add(_header);
    buttonPanel.add(customizeButton);
    buttonPanel.add(copyButton);
    buttonPanel.add(_saveButton);
    buttonPanel.add(_deleteButton);

    return buttonPanel;
  }
Exemplo n.º 2
0
 private void showPlayGameElements(ContactInfo contact) {
   startGameLabel.setVisible(true);
   startGameButton.setVisible(true);
   cancelStartGameButton.setVisible(true);
   if (contact.getTurn().equals(""))
     startGameLabel.setText(messages.startGameQuestion(contact.getName()));
   else startGameLabel.setText(messages.continueGameQuestion(contact.getName()));
 }
 public void showError(String title, String message) {
   dialogBox.setText(title);
   errorLabel.setText(message);
   closeButton.setVisible(true);
   errorLabel.setStyleName("serverResponseLabelError");
   dialogBox.center();
 }
  /**
   * Page widgets.
   *
   * @param cellTree the cell tree
   */
  public void createPageView(CellTree cellTree) {
    this.cellTree = cellTree;
    mainPanel.setStyleName("div-wrapper"); // main div

    SimplePanel leftPanel = new SimplePanel();
    leftPanel.getElement().setId("leftPanel_SimplePanel");
    leftPanel.setStyleName("div-first bottomPadding10px"); // left side div which will  have tree

    SimplePanel rightPanel = new SimplePanel();
    rightPanel.getElement().setId("rightPanel_SimplePanel");
    rightPanel.setStyleName("div-second"); // right div having tree creation inputs.

    VerticalPanel treePanel = new VerticalPanel();
    treePanel.getElement().setId("treePanel_VerticalPanel");
    HorizontalPanel expandCollapse = new HorizontalPanel();
    expandCollapse.getElement().setId("expandCollapse_HorizontalPanel");
    expandCollapse.setStyleName("leftAndTopPadding");
    expandCollapse.setSize("100px", "20px");
    buttonExpand.setStylePrimaryName("expandAllButton");
    buttonCollapse.setStylePrimaryName("collapseAllButton");
    buttonExpand.setTitle("Expand All (Shift +)");
    buttonCollapse.setTitle("Collapse All (Shift -)");
    expandCollapse.add(buttonExpand);
    expandCollapse.add(buttonCollapse);
    buttonExpand.setFocus(true);
    buttonCollapse.setVisible(true);

    treePanel.add(expandCollapse);
    treePanel.add(cellTree);
    leftPanel.add(treePanel);

    SimplePanel bottomSavePanel = new SimplePanel();
    bottomSavePanel.getElement().setId("bottomSavePanel_SimplePanel");
    bottomSavePanel.setStyleName("div-first buttonPadding");
    VerticalPanel vp = new VerticalPanel();
    HorizontalPanel savePanel = new HorizontalPanel();
    savePanel.getElement().setId("savePanel_VerticalPanel");
    savePanel.add(new SpacerWidget());
    //		savePanel.add(errorMessageDisplay);
    vp.add(successMessageDisplay);
    //		saveBtn.setTitle("Ctrl+Alt+s");
    savePanel.add(saveBtn);
    validateBtn.setTitle("Validate");
    savePanel.add(validateBtn);
    vp.add(warningMessageDisplay);
    vp.add(savePanel);
    bottomSavePanel.add(vp);

    SimplePanel errPanel = new SimplePanel();
    errPanel.getElement().setId("errPanel_SimplePanel");
    errPanel.add(errorMessageDisplay);
    mainPanel.add(errPanel);
    mainPanel.add(leftPanel);
    mainPanel.add(rightPanel);
    mainPanel.add(bottomSavePanel);
    focusPanel.addKeyDownHandler(this);
    focusPanel.addFocusHandler(this);
    cellTreeHandlers();
  }
 @UiHandler("saveBtn")
 public void saveClass(ClickEvent event) {
   String score = Long.toString(miniScore);
   saveLblText.setVisible(true);
   saveBtn.setVisible(false);
   saveEnabled(false);
   saveBtn.addStyleName(CssTokens.DISABLED);
   getUiHandlers().updateClass(score);
 }
  @Override
  protected void handleResponse(Response response) {
    WEStatus status = new WEStatus(response);
    boolean root = false;

    if (status.getStat() == WEStatus.STATUS_SUCCESS) {
      section_btn.setVisible(true);
    }
  }
 public void showInfo(String title, String message) {
   dialogBox.setText(title);
   errorLabel.setText(message);
   errorLabel.setStyleName("infoText");
   closeButton.setVisible(false);
   dialogBox.center();
   new Timer() {
     public void run() {
       dialogBox.hide();
     }
   }.schedule(2000);
 }
 public QuestionResponseDialog(Long questionId) {
   super();
   this.questionId = questionId;
   // Set the dialog box's caption.
   setText(TEXT_CONSTANTS.questionResponses());
   setAnimationEnabled(true);
   setGlassEnabled(true);
   currentAnswers = new ArrayList<QuestionAnswerStoreDto>();
   changedAnswers = new HashMap<Long, QuestionAnswerStoreDto>();
   currentTextboxes = new ArrayList<TextBox>();
   cursorArray = new ArrayList<String>();
   statusLabel = new Label();
   surveyInstanceSvc = GWT.create(SurveyInstanceService.class);
   nextButton = new Button(TEXT_CONSTANTS.next());
   nextButton.setVisible(true);
   currentPage = 0;
   nextButton.addClickHandler(this);
   previousButton = new Button(TEXT_CONSTANTS.previous());
   previousButton.setVisible(false);
   previousButton.addClickHandler(this);
   paginationPanel = new HorizontalPanel();
   paginationPanel.add(previousButton);
   paginationPanel.add(nextButton);
   dataGrid = new Grid();
   contentPanel = new VerticalPanel();
   contentPanel.add(statusLabel);
   contentPanel.add(dataGrid);
   doneButton = new Button(TEXT_CONSTANTS.done());
   saveButton = new Button(TEXT_CONSTANTS.save());
   saveButton.addClickHandler(this);
   saveButton.setEnabled(false);
   clearButton = new Button(TEXT_CONSTANTS.discardChanges());
   clearButton.addClickHandler(this);
   clearButton.setEnabled(false);
   contentPanel.add(doneButton);
   doneButton.addClickHandler(this);
   setWidget(new ScrollPanel(contentPanel));
   loadResponses();
   setPopupPosition(Window.getClientWidth() / 5, Window.getClientHeight() / 5);
 }
Exemplo n.º 9
0
  @Override
  public void onRemoteStreamedReceived(MediaStream remoteStream) {
    remoteVideo.setMediaStream(remoteStream);
    remoteVideo.play();
    remoteVideo.addStyleName("remoteVideo");
    remoteVideo.addStyleName("fullscreen");
    remoteVideo.addStyleName("zoom-in");

    localVideo.removeStyleName("fullscreen");
    localVideo.removeStyleName("zoom-in");
    shrinkLocalVideo();
    connectButton.setVisible(false);
  }
Exemplo n.º 10
0
  public void addText(String TextoBoton) {

    //		if (!TextoBoton.isEmpty()
    //				&& TextoBoton.length() > 2) {
    Button btnNewButton_1 = new Button("<img src=\"Users.gif\">" + TextoBoton);
    btnNewButton_1.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            Button sourceB = ((Button) event.getSource());
            verticalPanel_1.remove(sourceB);
            if (verticalPanel_1.getWidgetCount() == 0) SaveNewUsers.setVisible(false);
          }
        });
    btnNewButton_1.addMouseDownHandler(
        new MouseDownHandler() {
          public void onMouseDown(MouseDownEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonPush");
          }
        });
    btnNewButton_1.addMouseOutHandler(
        new MouseOutHandler() {
          public void onMouseOut(MouseOutEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonTOP");
          }
        });
    btnNewButton_1.addMouseOverHandler(
        new MouseOverHandler() {
          public void onMouseOver(MouseOverEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonTOPOver");
          }
        });
    btnNewButton_1.setStyleName("gwt-ButtonTOP");
    btnNewButton_1.setText(TextoBoton);
    btnNewButton_1.setHTML("<img src=\"Users.gif\">" + TextoBoton);
    verticalPanel_1.add(btnNewButton_1);
    btnNewButton_1.setSize("100%", "100%");
    SaveNewUsers.setVisible(true);
    //		} else
    //			Window.alert("The User need to be a valid reference");
  }
Exemplo n.º 11
0
  public void showRewardsItem(RewardsItemClient rewardsItem, boolean isItemStore) {
    if (rewardsItem.getFrequency() != null) {
      // 显示出下次颁奖时间
      nextRewardsTime
          .getElement()
          .getParentElement()
          .getParentElement()
          .removeClassName(CssStyleConstants.hidden);
      // 把开始时间设成只读
      // startTime.setEnabled(false);

    }
    if (isItemStore == false) { // 维护按钮的状态
      saveStore.setVisible(false);
      backStore.setVisible(false);
      save.setVisible(true);
      back.setVisible(true);
    } else {
      backStore.setVisible(true);
      saveStore.setVisible(true);
      save.setVisible(false);
      back.setVisible(false);
    }
    rewardsName.setText(rewardsItem.getName());
    rewardsDefinition.setText(rewardsItem.getDefinition());
    standard.setText(rewardsItem.getStandard());
    rewardsUnit = rewardsItem.getRewardsUnit();

    showJudgeInfo(rewardsItem); // 显示要修改的提名人
    startTime.setValue(rewardsItem.getStartTime());
    nextRewardsTime.setValue(rewardsItem.getNextTime());
    nextPublicTime.setValue(rewardsItem.getNextPublishTime());
    peopleSizeLimit.setValue(StringUtil.valueOf(rewardsItem.getSizeLimit()));
    rewardsFrom.setValue(StringUtil.valueOf(rewardsItem.getRewardsFrom()));
    tmday.setValue(StringUtil.valueOf(rewardsItem.getTmdays()));
    tmdays.setValue(StringUtil.valueOf(rewardsItem.getTmdays()));
    totalJF.setValue(StringUtil.valueOf(rewardsItem.getTotalJF()));
    expectTime.setValue(rewardsItem.getNextTime());
    nextPublicTime.setValue(rewardsItem.getNextPublishTime());
    showFrequencyInfo(rewardsItem.getFrequency());
    autoCbx.setValue(rewardsItem.isAuto(), true);
    if (rewardsItem.isAuto() == false) // 隐藏提名
    chooseBtns
          .getElement()
          .getParentElement()
          .getParentElement()
          .removeClassName(CssStyleConstants.hidden);
    else
      chooseBtns
          .getElement()
          .getParentElement()
          .getParentElement()
          .addClassName(CssStyleConstants.hidden);
    specialCbx.setValue(rewardsItem.isHasSpecialCondition(), true);
    if (SpecialCondition.birth == rewardsItem.getCondition()) {
      birthRadio.setValue(true);
    } else {
      birthRadio.setValue(false);
    }
    if (rewardsItem.isPeriodEnable() == true) {
      moretimes.setValue(true, true);
    } else {
      onetimes.setValue(true, true);
    }
  }
Exemplo n.º 12
0
  private void init() {
    staffArea = new OrganizationSpecialTextArea();
    staffAreaPanel.add(staffArea); // 提名人面板
    startTime.setFormat(new DateBox.DefaultFormat(dateFormat));
    // 隐藏周期性
    expectTime.setEnabled(true);
    tmdays.setEnabled(true);
    nextRewardsTime.setEnabled(false);
    tmday.setEnabled(false);
    setting.setEnabled(false);
    autoCbx.setEnabled(false);
    nextPublicTime.setEnabled(false);
    specialCbx.setEnabled(false);
    birthRadio.setEnabled(false);
    backStore.setVisible(false);
    //	settingText.getElement().getParentElement().getParentElement().getParentElement().addClassName(CssStyleConstants.hidden);
    nextRewardsTime.setFormat(new DateBox.DefaultFormat(dateFormat));
    nextPublicTime.setFormat(new DateBox.DefaultFormat(dateFormat));
    expectTime.setFormat(new DateBox.DefaultFormat(dateFormat));
    // sub.setText("我的奖项");
    // title.setText("创建奖项");
    // settingText.setText("每1天一次");
    birthRadio.getElement().addClassName(CssStyleConstants.hidden);
    // 周期性选择
    onetimes.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
              // settingText.getElement().getParentElement().getParentElement().getParentElement().addClassName(CssStyleConstants.hidden);
              // expectTime.getElement().getParentElement().getParentElement().getParentElement().removeClassName(CssStyleConstants.hidden);
              expectTime.setEnabled(true);
              tmdays.setEnabled(true);

              nextRewardsTime.setEnabled(false);
              tmday.setEnabled(false);
              setting.setEnabled(false);
              autoCbx.setEnabled(false);
              nextPublicTime.setEnabled(false);
              specialCbx.setEnabled(false);
              birthRadio.setEnabled(false);

              nextRewardsTime.setValue(null);
              tmday.setValue(null);
              autoCbx.setValue(null);
              nextPublicTime.setValue(null);
              specialCbx.setValue(null);
              birthRadio.setValue(null);
              settingText.setText("");
              frequency = null;
            } else {
              // settingText.getElement().getParentElement().getParentElement().getParentElement().removeClassName(CssStyleConstants.hidden);
              // expectTime.getElement().getParentElement().getParentElement().getParentElement().addClassName(CssStyleConstants.hidden);
              expectTime.setEnabled(false);
              tmdays.setEnabled(false);
              expectTime.setValue(null);
              tmdays.setValue(null);

              nextRewardsTime.setEnabled(true);
              tmday.setEnabled(true);
              setting.setEnabled(true);
              autoCbx.setEnabled(true);
              nextPublicTime.setEnabled(true);
              specialCbx.setEnabled(true);
              birthRadio.setEnabled(true);
            }
          }
        });
    moretimes.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
              expectTime.setEnabled(false);
              tmdays.setEnabled(false);
              expectTime.setValue(null);
              tmdays.setValue(null);

              nextRewardsTime.setEnabled(true);
              tmday.setEnabled(true);
              setting.setEnabled(true);
              autoCbx.setEnabled(true);
              nextPublicTime.setEnabled(true);
              specialCbx.setEnabled(true);
              birthRadio.setEnabled(true);
              // settingText.getElement().getParentElement().getParentElement().getParentElement().removeClassName(CssStyleConstants.hidden);
              // expectTime.getElement().getParentElement().getParentElement().getParentElement().addClassName(CssStyleConstants.hidden);
            } else {
              expectTime.setEnabled(true);
              tmdays.setEnabled(true);

              nextRewardsTime.setEnabled(false);
              tmday.setEnabled(false);
              setting.setEnabled(false);
              autoCbx.setEnabled(false);
              nextPublicTime.setEnabled(false);
              specialCbx.setEnabled(false);
              birthRadio.setEnabled(false);
              nextRewardsTime.setValue(null);
              tmday.setValue(null);
              autoCbx.setValue(null);
              nextPublicTime.setValue(null);
              specialCbx.setValue(null);
              birthRadio.setValue(null);
              settingText.setText("");
              // settingText.getElement().getParentElement().getParentElement().getParentElement().addClassName(CssStyleConstants.hidden);
              // expectTime.getElement().getParentElement().getParentElement().getParentElement().removeClassName(CssStyleConstants.hidden);
            }
          }
        });
    // 特殊条件
    specialCbx.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {

          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
              birthRadio.setValue(true, true);
              birthRadio.getElement().removeClassName(CssStyleConstants.hidden);
            } else {
              birthRadio.setValue(false, true);
              birthRadio.getElement().addClassName(CssStyleConstants.hidden);
            }
          }
        });

    // 生日奖
    birthRadio.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
              FrequencyClient frequecny = getFrequencyObj();
              if (frequecny == null
                  || frequecny instanceof WeekFrequencyClient
                  || frequecny instanceof YearFrequencyClient) {
                Window.alert("生日奖必须为每日或每月,已重设为每天一次");
                DayFrequencyClient daily = new DayFrequencyClient();
                daily.setInterval(1);
                showFrequencyInfo(daily);
              }
            } else {
              showFrequencyInfo(null);
            }
          }
        });

    // 自动颁奖
    autoCbx.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {

          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
              nextPublicTime.setEnabled(false);
              chooseBtns.setEnabled(false);
              //					chooseBtns.getElement().getParentElement()//隐藏提名
              //					.getParentElement()
              //					.addClassName(CssStyleConstants.hidden);
              //					nextPublicTime.getElement().getParentElement()
              //							.getParentElement()
              //							.addClassName(CssStyleConstants.hidden);
            } else {
              //					chooseBtns.getElement().getParentElement()//隐藏提名
              //					.getParentElement()
              //					.removeClassName(CssStyleConstants.hidden);
              //					nextPublicTime.getElement().getParentElement()
              //							.getParentElement()
              //							.removeClassName(CssStyleConstants.hidden);
              nextPublicTime.setEnabled(true);
              chooseBtns.setEnabled(true);
            }
          }
        });
    // 只能输入数字
    peopleSizeLimit.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(ValueChangeEvent<String> event) {
            if (event.getValue() != null && !event.getValue().equals("")) {
              try {
                Integer.parseInt(event.getValue());
              } catch (Exception e) {
                peopleSizeLimit.setValue("");
              }
            }
          }
        });
    totalJF.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(ValueChangeEvent<String> event) {
            if (event.getValue() != null && !event.getValue().equals("")) {
              try {
                Integer.parseInt(event.getValue());
              } catch (Exception e) {
                totalJF.setValue("");
              }
            }
          }
        });
    rewardsFrom.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(ValueChangeEvent<String> event) {
            if (event.getValue() != null && !event.getValue().equals("")) {
              try {
                Integer.parseInt(event.getValue());
              } catch (Exception e) {
                rewardsFrom.setValue("");
              }
            }
          }
        });
    tmdays.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(ValueChangeEvent<String> event) {
            if (event.getValue() != null && !event.getValue().equals("")) {
              try {
                Integer.parseInt(event.getValue());
              } catch (Exception e) {
                tmdays.setValue("");
              }
            }
          }
        });
    tmday.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(ValueChangeEvent<String> event) {
            if (event.getValue() != null && !event.getValue().equals("")) {
              try {
                Integer.parseInt(event.getValue());
              } catch (Exception e) {
                tmday.setValue("");
              }
            }
          }
        });
  }
  private void populateData(final List<QuestionAnswerStoreDto> data) {
    dataGrid.clear(true);
    updateSaveButtonStatus(false);
    if (data != null && data.size() > 0) {
      statusLabel.setVisible(false);
      dataGrid.resize(data.size() + 2, 3);
      loadHeaderRow();
      for (int i = 0; i < data.size(); i++) {
        final int idx = i;
        dataGrid.setWidget(i + 1, 0, new Label(data.get(i).getSurveyInstanceId().toString()));
        TextBox temp = new TextBox();
        temp.setText(data.get(i).getValue());
        currentTextboxes.add(temp);
        temp.addChangeHandler(
            new ChangeHandler() {

              @Override
              public void onChange(ChangeEvent event) {
                String oldVal = data.get(idx).getValue();
                String newVal = ((TextBox) event.getSource()).getValue();
                if (!newVal.trim().equals(oldVal)) {
                  dataGrid.getCellFormatter().setStyleName(idx + 1, 1, EDITED_ROW_CSS);
                  // create a new copy of the answer so we don't
                  // overwrite the old value
                  QuestionAnswerStoreDto newAnswer = new QuestionAnswerStoreDto();
                  newAnswer.setKeyId(data.get(idx).getKeyId());
                  newAnswer.setArbitratyNumber(data.get(idx).getArbitratyNumber());
                  newAnswer.setCollectionDate(data.get(idx).getCollectionDate());
                  newAnswer.setType(data.get(idx).getType());
                  newAnswer.setQuestionID(data.get(idx).getQuestionID());
                  newAnswer.setValue(newVal.trim());
                  newAnswer.setSurveyId(data.get(idx).getSurveyId());
                  newAnswer.setSurveyInstanceId(data.get(idx).getSurveyInstanceId());
                  newAnswer.setOldValue(data.get(idx).getValue());
                  changedAnswers.put(newAnswer.getKeyId(), newAnswer);

                } else {
                  dataGrid.getCellFormatter().setStyleName(idx + 1, 1, "");
                  changedAnswers.remove(data.get(idx).getKeyId());
                }
                if (changedAnswers.size() > 0) {
                  updateSaveButtonStatus(true);
                } else {
                  updateSaveButtonStatus(false);
                }
              }
            });
        dataGrid.setWidget(i + 1, 1, temp);
        dataGrid.getCellFormatter().setStyleName(idx + 1, 1, "");
        dataGrid.setWidget(i + 1, 2, new Label(DATE_FMT.format(data.get(i).getCollectionDate())));
      }

      if (data.size() >= 20) {
        nextButton.setVisible(true);
      } else {
        nextButton.setVisible(false);
      }
      if (currentPage > 0) {
        previousButton.setVisible(true);
      } else {
        previousButton.setVisible(false);
      }
      dataGrid.setWidget(data.size() + 1, 0, paginationPanel);
      dataGrid.setWidget(data.size() + 1, 1, saveButton);
      dataGrid.setWidget(data.size() + 1, 2, clearButton);

    } else {
      dataGrid.resize(1, 1);
      statusLabel.setText(TEXT_CONSTANTS.noResponsesForQuestion());
      statusLabel.setVisible(true);
    }
  }
Exemplo n.º 14
0
 /**
  * Macht den Button sichtbar bzw. unsichtbar
  *
  * @param visible true -> Button wird sichtbar false -> Button wird unsichtbar
  */
 public void setVisibleRemoveButton(boolean visible) {
   removeButton.setVisible(visible);
 }
Exemplo n.º 15
0
 private void coursePanelVisiblity(boolean isVisible) {
   createCourseBtn.setVisible(!isVisible);
   scoreTextBox.setReadOnly(!isVisible);
   coursePanel.setVisible(isVisible);
   saveEnabled(false);
 }
Exemplo n.º 16
0
  public ScheduleEditor(ScheduleDialogType type) {
    super();
    isBlockoutDialog = (type == ScheduleDialogType.BLOCKOUT);
    startTimePicker = new TimePicker();

    setStylePrimaryName("scheduleEditor"); // $NON-NLS-1$

    scheduleCombo = createScheduleCombo();
    Label l = new Label(MSGS.recurrenceColon());
    l.setStyleName(SCHEDULE_LABEL);
    add(l);
    add(scheduleCombo);

    SimplePanel hspacer = new SimplePanel();
    hspacer.setWidth("100px"); // $NON-NLS-1$

    if (!isBlockoutDialog) {
      startTimePanel = createStartTimePanel();
      add(startTimePanel);
    } else {

      // Blockout End TimePicker
      blockoutEndTimePicker = new TimePicker();
      blockoutEndTimePicker.setHour("01"); // $NON-NLS-1$
      blockoutEndTimePicker.setMinute("00"); // $NON-NLS-1$
      blockoutEndTimePicker.setTimeOfDay(TimeUtil.TimeOfDay.PM);

      // Blockout End Caption Panel
      blockoutEndTimePicker.getElement().getStyle().setDisplay(Display.NONE);

      final String[] daysList = new String[365];
      final String[] hoursList = new String[24];
      final String[] minutesList = new String[60];

      // Populate list
      for (Integer i = 0; i < 365; i++) {
        String iStr = i.toString();
        daysList[i] = iStr;

        if (i < 60) {
          minutesList[i] = iStr;
          if (i < 24) {
            hoursList[i] = iStr;
          }
        }
      }

      // Units of time Drop Down
      daysListBox = new ListBox();
      daysListBox.getElement().setId("daysListBox"); // $NON-NLS-1$
      populateListItems(daysListBox, daysList, 0, 365);

      final Label daysLabel = new Label(MSGS.dayOrDays());
      daysLabel.getElement().setAttribute("for", daysListBox.getElement().getId()); // $NON-NLS-1$

      hoursListBox = new ListBox();
      hoursListBox.getElement().setId("hoursListBox"); // $NON-NLS-1$
      populateListItems(hoursListBox, hoursList, 0, 24);

      final Label hoursLabel = new Label(MSGS.hourOrHours());
      hoursLabel.getElement().setAttribute("for", hoursListBox.getElement().getId()); // $NON-NLS-1$

      minutesListBox = new ListBox();
      minutesListBox.getElement().setId("minutesListBox"); // $NON-NLS-1$
      populateListItems(minutesListBox, minutesList, 0, 60);

      final Label minutesLabel = new Label(MSGS.minuteOrMinutes());
      minutesLabel
          .getElement()
          .setAttribute("for", minutesListBox.getElement().getId()); // $NON-NLS-1$

      final HorizontalPanel durationPanel = new HorizontalPanel();
      durationPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
      durationPanel.setSpacing(blockoutEndTimePicker.getSpacing());
      durationPanel.add(daysListBox);
      durationPanel.add(daysLabel);
      durationPanel.add(hoursListBox);
      durationPanel.add(hoursLabel);
      durationPanel.add(minutesListBox);
      durationPanel.add(minutesLabel);

      // Bind change handler
      this.scheduleCombo.addChangeHandler(
          new ChangeHandler() {

            @Override
            public void onChange(ChangeEvent event) {
              String scheduleType = scheduleCombo.getItemText(scheduleCombo.getSelectedIndex());

              if (ScheduleType.RUN_ONCE.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 365);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.HOURS.toString().equals(scheduleType)) {
                hide(true, daysListBox, daysLabel, hoursListBox, hoursLabel);
                show(true, minutesListBox, minutesLabel);

                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.DAILY.toString().equals(scheduleType)) {
                hide(true, daysListBox, daysLabel);
                show(true, hoursListBox, hoursLabel, minutesListBox, minutesLabel);

                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.WEEKLY.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 7);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.MONTHLY.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 28);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.YEARLY.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 365);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);
              }
            }
          });

      /*
       * Radio Buttons for duration
       */
      this.durationRadioButton =
          new RadioButton("durationRadioGroup", "durationRadioButton"); // $NON-NLS-1$ //$NON-NLS-2$
      this.durationRadioButton.setText(MSGS.duration());
      this.durationRadioButton.setValue(Boolean.TRUE);
      this.durationRadioButton.addClickHandler(
          new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
              blockoutEndTimePicker.getElement().getStyle().setDisplay(Display.NONE);
              durationPanel.getElement().getStyle().clearDisplay();
            }
          });

      this.endTimeRadioButton =
          new RadioButton("durationRadioGroup", "endTimeRadioButton"); // $NON-NLS-1$ //$NON-NLS-2$
      this.endTimeRadioButton.setText(MSGS.endTime());
      this.endTimeRadioButton.addClickHandler(
          new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
              blockoutEndTimePicker.getElement().getStyle().clearDisplay();
              durationPanel.getElement().getStyle().setDisplay(Display.NONE);
            }
          });

      // Radio Buttons Panel
      HorizontalPanel radioButtonsPanel = new HorizontalPanel();
      radioButtonsPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
      radioButtonsPanel.add(this.durationRadioButton);
      radioButtonsPanel.add(this.endTimeRadioButton);

      // Ends Panel
      VerticalPanel endsPanel = new VerticalPanel();
      endsPanel.add(radioButtonsPanel);
      endsPanel.add(blockoutEndTimePicker);
      endsPanel.add(durationPanel);

      // Blockout period
      CaptionPanel blockoutStartCaptionPanel = new CaptionPanel(MSGS.startTime());
      HorizontalPanel blockoutStartPanel = new HorizontalPanel();
      blockoutStartPanel.add(getStartTimePicker());
      timeZonePicker = new ListBox();
      timeZonePicker.setStyleName("timeZonePicker");
      timeZonePicker.setVisibleItemCount(1);
      blockoutStartPanel.add(timeZonePicker);
      timeZonePicker.getElement().getParentElement().getStyle().setPaddingTop(5, Unit.PX);

      blockoutStartCaptionPanel.add(blockoutStartPanel);
      populateTimeZonePicker();

      // Ends Caption Panel
      CaptionPanel endCaptionPanel = new CaptionPanel(MSGS.endsCaptionTitle());
      endCaptionPanel.add(endsPanel);

      VerticalPanel blockoutPanel = new VerticalPanel();
      blockoutPanel.setWidth("100%"); // $NON-NLS-1$
      blockoutPanel.add(blockoutStartCaptionPanel);
      blockoutPanel.add(endCaptionPanel);

      add(blockoutPanel);
    }

    VerticalPanel vp = new VerticalPanel();
    vp.setWidth("100%"); // $NON-NLS-1$
    add(vp);
    setCellHeight(vp, "100%"); // $NON-NLS-1$

    runOnceEditor = new RunOnceEditor(startTimePicker);
    vp.add(runOnceEditor);
    scheduleTypeMap.put(ScheduleType.RUN_ONCE, runOnceEditor);
    runOnceEditor.setVisible(true);

    recurrenceEditor = new RecurrenceEditor(startTimePicker);
    vp.add(recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.SECONDS, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.MINUTES, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.HOURS, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.DAILY, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.WEEKLY, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.MONTHLY, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.YEARLY, recurrenceEditor);
    recurrenceEditor.setVisible(false);

    cronEditor = new CronEditor();
    scheduleTypeMap.put(ScheduleType.CRON, cronEditor);
    cronEditor.setVisible(false);

    if (!isBlockoutDialog) {
      vp.add(cronEditor);

      VerticalPanel blockoutButtonPanel = new VerticalPanel();
      blockoutButtonPanel.setWidth("100%"); // $NON-NLS-1$
      // blockoutButtonPanel.setHeight("30%");
      blockoutButtonPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
      blockoutButtonPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);

      // We want to add a button to check for blockout conflicts
      blockoutCheckButton.setStyleName("pentaho-button"); // $NON-NLS-1$
      blockoutCheckButton.getElement().setId("blockout-check-button"); // $NON-NLS-1$
      blockoutCheckButton.setVisible(false);

      hspacer.setHeight("50px"); // $NON-NLS-1$
      blockoutButtonPanel.add(hspacer);
      blockoutButtonPanel.add(blockoutCheckButton);

      vp.add(hspacer);
      add(blockoutButtonPanel);
    }

    configureOnChangeHandler();
  }
Exemplo n.º 17
0
 private void hideStartGameElements() {
   startGameLabel.setVisible(false);
   startGameButton.setVisible(false);
   cancelStartGameButton.setVisible(false);
 }
Exemplo n.º 18
0
  public void onModuleLoad() {
    RootPanel RootTXOriginal = RootPanel.get();
    RootPanel RootMenu = RootPanel.get("Menu");
    RootTXOriginal.setSize("100%", "100%");
    RootMenu.setStyleName("Root");
    RootTXOriginal.setStyleName("Root");

    YO = this;
    MenuBar menuBar = new MenuBar(false);
    RootMenu.add(menuBar);
    menuBar.setWidth("100%");

    MenuItem menuItem = new MenuItem("GroupAdministration", false, (Command) null);
    menuItem.setHTML("Users Administrator");
    menuItem.setEnabled(false);
    menuBar.addItem(menuItem);

    MenuItemSeparator separator = new MenuItemSeparator();
    menuBar.addSeparator(separator);

    MenuItem mntmBack =
        new MenuItem(
            "Back",
            false,
            new Command() {
              public void execute() {
                Controlador.change2Administrator();
              }
            });
    menuBar.addItem(mntmBack);

    MenuItem AddLots =
        new MenuItem(
            "Masive add",
            false,
            new Command() {
              public void execute() {
                PanelAddMasibo PAM = new PanelAddMasibo(YO);
                PAM.setVisible(true);
                PAM.center();
              }
            });
    AddLots.setHTML("Masive add");
    menuBar.addItem(AddLots);

    HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel();
    RootTXOriginal.add(horizontalSplitPanel, 0, 25);
    horizontalSplitPanel.setSize("100%", "100%");

    VerticalPanel verticalPanel = new VerticalPanel();
    horizontalSplitPanel.setLeftWidget(verticalPanel);
    verticalPanel.setSize("100%", "");

    SimplePanel simplePanel = new SimplePanel();
    verticalPanel.add(simplePanel);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    simplePanel.setWidget(horizontalPanel);
    horizontalPanel.setSize("100%", "100%");

    textBox = new TextBox();
    textBox.setVisibleLength(50);
    horizontalPanel.add(textBox);
    textBox.setWidth("90%");

    Button btnNewButton = new Button("New button");
    btnNewButton.setText("+");
    btnNewButton.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonCenter");
          }
        });

    btnNewButton.addMouseDownHandler(
        new MouseDownHandler() {
          public void onMouseDown(MouseDownEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush");
          }
        });

    btnNewButton.addMouseOutHandler(
        new MouseOutHandler() {
          public void onMouseOut(MouseOutEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonCenter");
          }
        });

    btnNewButton.addMouseOverHandler(
        new MouseOverHandler() {
          public void onMouseOver(MouseOverEvent event) {

            ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver");
          }
        });

    btnNewButton.setStyleName("gwt-ButtonCenter");
    btnNewButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            String S = ClearText(textBox.getText());
            if (isValidEmail(S)) addText(S);
            else Window.alert(ErrorConstants.ERROR_NO_EMAIL_VALIDO + S);
            textBox.setText("");
          }

          private native boolean isValidEmail(String email) /*-{
	        var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	        var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
	        	return !reg1.test(email) && reg2.test(email);
			}-*/;
        });

    horizontalPanel.add(btnNewButton);
    btnNewButton.setWidth("66px");
    btnNewButton.setHTML("+");

    verticalPanel_1 = new VerticalPanel();
    verticalPanel.add(verticalPanel_1);
    verticalPanel_1.setWidth("100%");

    SaveNewUsers = new Button("Save New Users");
    SaveNewUsers.setVisible(false);
    SaveNewUsers.addClickHandler(
        new ClickHandler() {
          private AsyncCallback<Boolean> callback;

          public void onClick(ClickEvent event) {
            Pilallamada = new Stack<UserApp>();
            int Elementos_a_salvar = verticalPanel_1.getWidgetCount();
            for (int i = 0; i < Elementos_a_salvar; i++) {
              Widget Uno = verticalPanel_1.getWidget(i);
              Button Dos = (Button) Uno;
              String Nombre = Dos.getText();
              Pilallamada.add(new UserApp(Nombre, Constants.STUDENT));
            }
            if (!Pilallamada.isEmpty()) {
              callback =
                  new AsyncCallback<Boolean>() {

                    public void onFailure(Throwable caught) {
                      Window.alert("The user could not be saved at this moment");
                      LoadingPanel.getInstance().hide();
                    }

                    public void onSuccess(Boolean result) {
                      LoadingPanel.getInstance().hide();
                      if (!result)
                        Window.alert(
                            "The user "
                                + Pilallamada.peek().getEmail()
                                + " already exists (if you do not see him/her it's because he may be administrator)");
                      Pilallamada.pop();
                      if (!Pilallamada.isEmpty()) {
                        LoadingPanel.getInstance().center();
                        LoadingPanel.getInstance().setLabelTexto("Saving...");
                        bookReaderServiceHolder.saveUser(Pilallamada.peek(), callback);

                      } else {
                        refreshPanel();
                      }
                    }
                  };
              LoadingPanel.getInstance().center();
              LoadingPanel.getInstance().setLabelTexto("Saving...");
              bookReaderServiceHolder.saveUser(Pilallamada.peek(), callback);
            }
            verticalPanel_1.clear();
            SaveNewUsers.setVisible(false);
          }
        });
    SaveNewUsers.addMouseDownHandler(
        new MouseDownHandler() {
          public void onMouseDown(MouseDownEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSavePush");
          }
        });
    SaveNewUsers.addMouseOutHandler(
        new MouseOutHandler() {
          public void onMouseOut(MouseOutEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSave");
          }
        });
    SaveNewUsers.addMouseOverHandler(
        new MouseOverHandler() {
          public void onMouseOver(MouseOverEvent event) {
            ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSaveOver");
          }
        });
    SaveNewUsers.setStyleName("gwt-ButtonBottonSave");
    //	SaveNewUsers.setStyleName("gwt-MenuItemMio");
    verticalPanel.add(SaveNewUsers);
    SaveNewUsers.setSize("100%", "100%");

    ScrollPanel scrollPanel = new ScrollPanel();
    horizontalSplitPanel.setRightWidget(scrollPanel);
    scrollPanel.setSize("100%", "100%");

    stackPanel_1 = new StackPanelMio();
    scrollPanel.setWidget(stackPanel_1);
    // simplePanel.add(stackPanel_1);

    stackPanel_1.setBotonTipo(new BotonesStackPanelUsersMio("prototipo", new VerticalPanel()));
    stackPanel_1.setBotonClick(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            Long Nombre = ((BotonesStackPanelUsersMio) event.getSource()).getEntidad().getID();
            LoadingPanel.getInstance().center();
            LoadingPanel.getInstance().setLabelTexto("Loading...");
            bookReaderServiceHolder.loadUserById(
                Nombre,
                new AsyncCallback<UserApp>() {

                  public void onFailure(Throwable caught) {
                    LoadingPanel.getInstance().hide();
                  }

                  public void onSuccess(UserApp result) {
                    LoadingPanel.getInstance().hide();
                    if (result.getGroupIds() == null) result.setGroupIds(new ArrayList<Long>());
                    if (!result.getGroupIds().isEmpty())
                      if (Window.confirm(
                          InformationConstants.ARE_YOU_SURE_DELETE_USER
                              + result.getGroupIds().size()
                              + InformationConstants.ARE_YOU_SURE_DELETE_USER2))
                        remove(result.getId());
                      else {
                      }
                    else {
                      if (Window.confirm(
                          "Are you sure you want to delete this user?, he is not a member of any group"))
                        remove(result.getId());
                    }
                  }
                });
          }

          private void remove(Long userId) {

            LoadingPanel.getInstance().center();
            LoadingPanel.getInstance().setLabelTexto("Deleting...");
            bookReaderServiceHolder.deleteUserApp(
                userId,
                new AsyncCallback<Integer>() {

                  public void onFailure(Throwable caught) {
                    LoadingPanel.getInstance().hide();
                    Window.alert("Sorry but the user could not be removed, try again later");
                  }

                  public void onSuccess(Integer result) {
                    LoadingPanel.getInstance().hide();
                    refreshPanel();
                  }
                });
          }
        });

    LoadingPanel.getInstance().center();
    LoadingPanel.getInstance().setLabelTexto("Loading...");
    bookReaderServiceHolder.getUsersApp(
        new AsyncCallback<ArrayList<UserApp>>() {

          public void onFailure(Throwable caught) {
            LoadingPanel.getInstance().hide();
          }

          public void onSuccess(ArrayList<UserApp> result) {
            LoadingPanel.getInstance().hide();
            if (result.size() < 10) {
              for (UserApp User1 : result) {
                String Bienvenida;
                if ((User1.getName() != null) && (!User1.getName().isEmpty()))
                  Bienvenida = User1.getName();
                else Bienvenida = User1.getEmail();
                EntidadUser E = new EntidadUser(Bienvenida, User1.getId());
                stackPanel_1.addBotonLessTen(E);
              }

            } else {
              for (UserApp User1 : result) {
                String Bienvenida;
                if ((User1.getName() != null) && (!User1.getName().isEmpty()))
                  Bienvenida = User1.getName();
                else Bienvenida = User1.getEmail();
                EntidadUser E = new EntidadUser(Bienvenida, User1.getId());
                stackPanel_1.addBoton(E);
              }
            }
            stackPanel_1.setSize("100%", "100%");
            stackPanel_1.ClearEmpty();
          }
        });

    stackPanel_1.setSize("100%", "100%");
  }
Exemplo n.º 19
0
  public TimelinePanel(
      TenantIdentifier tenant,
      DashboardServiceAsync service,
      TimelineIdentifier timelineIdentifier,
      DashboardGroupPanel timelineGroupPanel,
      boolean isDashboardEditor) {
    super();
    _tenant = tenant;
    _service = service;
    _timelineIdentifier = timelineIdentifier;
    _timelineGroupPanel = timelineGroupPanel;
    _isDashboardEditor = isDashboardEditor;
    _header = new HeadingLabel("");

    _loadingIndicator = new LoadingIndicator();
    _loadingIndicator.setHeight((DefaultVAxisOption.DEFAULT_HEIGHT + 4) + "px");

    _saveButton = new Button("");
    _saveButton.setVisible(isDashboardEditor);
    _saveButton.addStyleDependentName("ImageButton");
    _saveButton.setTitle("Save timeline");
    _saveButton.addStyleName("SaveButton");
    _saveButton.addClickHandler(new SaveTimelineClickHandler(_service, _tenant, this));

    if (_timelineIdentifier != null) {
      // initially does not make sense to save an (unchanged) and
      // identifyable timeline.
      setTimelineDefinitionUnchanged();
    }

    _deleteButton = new Button();
    _deleteButton.setVisible(isDashboardEditor);
    _deleteButton.addStyleDependentName("ImageButton");
    _deleteButton.setTitle("Delete timeline");
    _deleteButton.addStyleName("DeleteButton");
    _deleteButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            final boolean confirmation =
                Window.confirm("Are you sure you wish to delete this timeline?");
            if (confirmation) {
              if (_timelineIdentifier != null) {
                _service.removeTimeline(
                    _tenant,
                    _timelineIdentifier,
                    new DCAsyncCallback<Boolean>() {
                      @Override
                      public void onSuccess(Boolean result) {
                        // do nothing
                      }
                    });
              }
              _timelineGroupPanel.removeTimelinePanel(TimelinePanel.this);
            }
          }
        });

    addStyleName("TimelinePanel");
    add(createButtonPanel());
    updateHeader();
    setLoading();

    if (_timelineIdentifier != null) {
      _service.getTimelineDefinition(
          _tenant,
          _timelineIdentifier,
          new DCAsyncCallback<TimelineDefinition>() {
            @Override
            public void onSuccess(final TimelineDefinition definition) {
              setTimelineDefinition(definition);
            }
          });
    }
  }
Exemplo n.º 20
0
 @Override
 public void setRewardButtonDisplay(boolean status) {
   save.setVisible(status);
 }
Exemplo n.º 21
0
 private void setButtonVisibility(boolean visibility) {
   btnPositive.setVisible(visibility);
   btnNegitive.setVisible(visibility);
 }
Exemplo n.º 22
0
 @Override
 public void setRewardBackButtonDisplay(boolean status) {
   back.setVisible(status);
 }
Exemplo n.º 23
0
 @Override
 public void setBinaryButtonVisible(boolean visible) {
   getBinaryButton.setVisible(visible);
 }
Exemplo n.º 24
0
  /**
   * Creates the calendar instance based in the configuration provided.
   *
   * <p>Options can be passed joining these using the or bit wise operator
   *
   * <ul>
   *   <li>CONFIG_DIALOG show as modal dialog
   *   <li>CONFIG_ROUNDED_BOX wrap with a rounded-corner box
   *   <li>CONFIG_NO_AUTOHIDE don't autohide dialog when the user click out of the picker
   *   <li>CONFIG_NO_ANIMATION don't animate the dialog box when it is showed/hidden
   *   <li>CONFIG_NO_ANIMATION don't animate the dialog box when it is showed/hidden
   *   <li>CONFIG_BACKGROUND show a semitransparent background covering all the document
   *   <li>CONFIG_FLAT_BUTTONS use native Buttons instead of GWTCButton also add the dependent class
   *       'flat'
   *   <li>CONFIG_STANDARD_BUTTONS use native browser Buttons instead of GWTCButton
   * </ul>
   */
  public void initialize(int config) {

    int buttonsType = config & CONFIG_FLAT_BUTTONS | config & CONFIG_STANDARD_BUTTONS;
    helpBtn = createButton(buttonsType, "?", this);
    closeBtn = createButton(buttonsType, "x", this);
    todayBtn = createButton(buttonsType, "-", this);
    prevMBtn = createButton(buttonsType, "\u003c", this);
    prevYBtn = createButton(buttonsType, "\u00AB", this);
    nextMBtn = createButton(buttonsType, "\u003e", this);
    nextYBtn = createButton(buttonsType, "\u00BB", this);

    if ((config & CONFIG_DIALOG) == CONFIG_DIALOG) {
      int opt = 0;
      if ((config & CONFIG_ROUNDED_BOX) == CONFIG_ROUNDED_BOX) {
        opt |= GWTCModalBox.OPTION_ROUNDED_FLAT;
      }
      if ((config & CONFIG_BACKGROUND) != CONFIG_BACKGROUND) {
        opt |= GWTCModalBox.OPTION_DISABLE_BACKGROUND;
        if ((config & CONFIG_NO_AUTOHIDE) == CONFIG_NO_AUTOHIDE) {
          opt |= GWTCModalBox.OPTION_DISABLE_AUTOHIDE;
        }
      }
      calendarDlg = new GWTCModalBox(opt);
      calendarDlg.setAnimationEnabled((config & CONFIG_NO_ANIMATION) != CONFIG_NO_ANIMATION);

      outer = calendarDlg;
      initWidget(new DockPanel());

      setStyleName(styleName);
      addStyleDependentName(StyleDialog);
      setZIndex(999);
    } else {
      if ((config & CONFIG_ROUNDED_BOX) == CONFIG_ROUNDED_BOX) {
        outer = new GWTCBox(GWTCBox.STYLE_FLAT);
      } else {
        outer = new VerticalPanel();
      }
      String s = outer.getStyleName();
      initWidget(outer);
      setStyleName(styleName);
      addStyleDependentName(StyleEmbeded);
      if (s != null && s.length() > 0) addStyleName(s);
    }

    helpDlg.addStyleName(StyleHelp);
    navButtonsTop.setStyleName(StyleCButtonsTop);
    navButtonsBottom.setStyleName(StyleCButtonsBottom);
    calendarGrid.setStyleName(StyleMonthGrid);
    navButtonsTop.setWidth("100%");
    calendarGrid.setWidth("100%");
    navButtonsBottom.setWidth("100%");

    if ((config & CONFIG_ROUNDED_BOX) == CONFIG_ROUNDED_BOX) addStyleDependentName(StyleBox);
    else addStyleDependentName(StyleNoBox);

    if ((config & CONFIG_DIALOG) != CONFIG_DIALOG) closeBtn.setVisible(false);

    monthSelectorHeader.setAnimationEnabled(true);

    outer.add(navButtonsTop);
    outer.add(calendarGrid);
    outer.add(navButtonsBottom);

    drawDatePickerWidget();
    refresh();

    DOM.sinkEvents(outer.getElement(), Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONCLICK);
    DOM.setStyleAttribute(outer.getElement(), "cursor", "default");
    DOM.setElementAttribute(monthMenu.getElement(), "align", "center");
  }
Exemplo n.º 25
0
 /* (non-Javadoc)
  * @see org.ednovo.gooru.client.mvp.classpage.teach.edit.content.IsEditClassContentView#setUpdateClass(org.ednovo.gooru.application.shared.model.content.ClasspageDo)
  */
 @Override
 public void setUpdateClass(ClasspageDo result) {
   classpageDo = result;
   saveLblText.setVisible(false);
   saveBtn.setVisible(true);
 }