Beispiel #1
0
  private void updateButtons() {
    btnPrevious.setEnabled(slidePanel.hasPrevious());

    if (!slidePanel.hasNext()) {
      btnNext.setText(R.lang.AddScenario());
      btnNext.setEnabled(mecController.getLastValue());
    } else {
      btnNext.setText(R.lang.Next());
      btnNext.setEnabled(true);
    }
  }
Beispiel #2
0
 @Override
 public void onClick(ClickEvent event) {
   if (event.getSource() == btnNext) {
     if (slidePanel.getSlidePosition() == 0) {
       slidePanel.next();
     } else {
       addScenario();
     }
   } else if (event.getSource() == btnPrevious) {
     slidePanel.previous();
   }
   updateButtons();
 }
Beispiel #3
0
  public NoScenario() {
    slidePanel = new SlidePanel(SLIDER_WIDTH, SLIDER_HEIGHT);
    slidePanel.addStyleName(ADD_SCENARIO_BOX);

    slidePanel.getFooterPanel().addStyleName(FOOTER_CSS_CLASS);

    btnNext = new Button(R.lang.Next());
    btnNext.addClickHandler(this);
    btnNext.getElement().getStyle().setFloat(Float.RIGHT);

    btnPrevious = new Button(R.lang.Previous());
    btnPrevious.addClickHandler(this);

    slidePanel.addFooterWidget(btnPrevious);
    slidePanel.addFooterWidget(btnNext);

    sac = new ScenarioAddController(true, false, false);
    sac.addBlurHandlerSName(this);
    sac.addKeyUpHandlerSName(this);

    mecController = new MEControllerSettings();
    mecController.addValueChangeHandler(this);

    mecPanel = new FlowPanel();
    Headline headline = new Headline(R.lang.measurementEnvironmentController());
    headline.getElement().getStyle().setMarginTop(0, Unit.PX);
    mecPanel.add(headline);
    mecPanel.add(mecController.getView());
    mecPanel.getElement().getStyle().setPadding(1, Unit.EM);

    slidePanel.addWidget(sac.getView());
    slidePanel.addWidget(mecPanel);

    add(slidePanel);

    updateButtons();
  }