public void onValueChange(ValueChangeEvent<Boolean> event) {
   if (event.getSource() == regularRolesBtn) {
     if (regularRolesBtn.getValue()) {
       showRoles(REGULAR_ROLES_TYPE);
     }
   } else if (event.getSource() == systemRolesBtn) {
     if (systemRolesBtn.getValue()) {
       showRoles(SYSTEM_ROLES_TYPE);
     }
   } else {
     if (rolesListBox.getSelectedIndex() >= 0) {
       ArrayList<String> selectedLogicalRoles = new ArrayList<String>();
       for (LogicalRoleInfo logicalRoleInfo : logicalRoles.values()) {
         if (logicalRoleInfo.checkBox.getValue()) {
           selectedLogicalRoles.add(logicalRoleInfo.roleName);
         }
       }
       String runtimeRole = rolesListBox.getItemText(rolesListBox.getSelectedIndex());
       List<String> originalRoles = masterRoleMap.get(runtimeRole);
       if (((originalRoles == null) || (originalRoles.size() == 0))
           && (selectedLogicalRoles.size() == 0)) {
         newRoleAssignments.remove(runtimeRole);
       } else if ((originalRoles != null)
           && (originalRoles.containsAll(selectedLogicalRoles))
           && selectedLogicalRoles.containsAll(originalRoles)) {
         newRoleAssignments.remove(runtimeRole);
       } else {
         newRoleAssignments.put(runtimeRole, selectedLogicalRoles);
       }
     }
   }
 }
Beispiel #2
0
 public void testRadioButton() {
   RadioButton able = widgetUi.myRadioAble;
   RadioButton baker = widgetUi.myRadioBaker;
   assertTrue("able should be checked", able.getValue());
   assertFalse("baker should not be checked", baker.getValue());
   assertEquals("radios", able.getName());
   assertEquals("radios", baker.getName());
 }
  @Test
  public void checkRadioButton() {
    // Make some radio buttons, all in one group.
    RadioButton rb0 = new RadioButton("myRadioGroup", "foo");
    RadioButton rb1 = new RadioButton("myRadioGroup", "bar");
    RadioButton rb2 = new RadioButton("myRadioGroup", "baz");

    // Check 'baz' by default.
    rb1.setValue(true);

    Assert.assertEquals(false, rb0.getValue());
    Assert.assertEquals(true, rb1.getValue());
    Assert.assertEquals(false, rb2.getValue());
  }
Beispiel #4
0
  /** When the below changes */
  @UiHandler({"positive", "zero", "negative"})
  @GFlotExamplesSource
  void onValueChangeGraphType(ValueChangeEvent<Boolean> event) {
    GlobalSeriesOptions options = plot.getPlotOptions().getGlobalSeriesOptions();
    if (positive.getValue()) {
      options.getThreshold().setBelow(5);
    } else if (zero.getValue()) {
      options.getThreshold().setBelow(0);
    } else {
      options.getThreshold().setBelow(-2.5);
    }

    plot.redraw();
  }
 private AlertSeverity getSelectedSeverity() {
   if (_severityIntelligenceRadio.getValue().booleanValue()) {
     return AlertSeverity.INTELLIGENCE;
   }
   if (_severitySurveillanceRadio.getValue().booleanValue()) {
     return AlertSeverity.SURVEILLANCE;
   }
   if (_severityWarningRadio.getValue().booleanValue()) {
     return AlertSeverity.WARNING;
   }
   if (_severityFatalRadio.getValue().booleanValue()) {
     return AlertSeverity.FATAL;
   }
   return null;
 }
  public Canvas createBgCanvas() {
    CanvasUtils.clear(bgCanvas);
    if (transparentBt.getValue()) {
      // do nothing
    } else if (colorBt.getValue()) {
      String bg = colorBox.getValue();
      CanvasUtils.fillRect(bgCanvas, bg);
    } else if (imageBt.getValue()) {
      if (bgImage != null) {
        // TODO set pos,scale,rot from simplelogo
        CanvasUtils.drawCenter(bgCanvas, bgImage);
      }
    }

    return bgCanvas;
  }
  protected void updateSettings() {
    // gif-panel
    try { // TODO only update modified value

      // screenshot
      int sctype = screenshotTransparentBt.getValue() ? 0 : 1;
      storageControler.setValue(KEY_SCREENSHOT_BG_TYPE, sctype);
      storageControler.setValue(KEY_SCREENSHOT_BG_VALUE, screenshotColorBox.getValue());

      storageControler.setValue(KEY_GIF_WITH_BACKGROUND, backgroundCheck.getValue());
      storageControler.setValue(KEY_GIF_WITH_BONE, boneCheck.getValue());
      storageControler.setValue(KEY_GIF_WITH_IK, ikCheck.getValue());

      if (transparentBt.getValue()) {
        storageControler.setValue(KEY_GIF_BG_TYPE, 0);
      } else if (colorBt.getValue()) {
        storageControler.setValue(KEY_GIF_BG_TYPE, 1);
        storageControler.setValue(KEY_GIF_BG_VALUE, colorBox.getValue());
      } else if (imageBt.getValue()) {
        storageControler.setValue(KEY_GIF_BG_TYPE, 2);
      }

      storageControler.setValue(KEY_GIF_WIDTH, widthBox.getValue());
      storageControler.setValue(KEY_GIF_HEIGHT, heightBox.getValue());

      storageControler.setValue(KEY_GIF_QUALITY, qualityBox.getValue());
      storageControler.setValue(KEY_GIF_SPEED, speedBox.getValue());

    } catch (StorageException e) {
      // possible quote error
      PoseEditor.alert(e.getMessage());
    }
  }
  @Test
  public void checkRadioButtonClickTwice() {
    tested = false;
    RadioButton r1 = new RadioButton("myRadioGroup", "r1");
    RadioButton r2 = new RadioButton("myRadioGroup", "r2");
    r1.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            tested = !tested;
          }
        });

    r2.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            tested = !tested;
          }
        });

    Assert.assertEquals(false, tested);

    // simule the event
    Browser.click(r1);
    Browser.click(r1);

    Assert.assertEquals(false, tested);
    Assert.assertEquals(true, r1.getValue());
  }
Beispiel #9
0
 public String getSelectedChoice() {
   for (RadioButton button : radioButtons) {
     if (button.getValue()) {
       return button.getText();
     }
   }
   throw new RuntimeException("No radio button selected");
 }
 @Override
 protected boolean validate() {
   if ((!(managingYes.getValue() || managingNo.getValue()))
   /* && (!(trackingTimeYes.getValue() || trackingNo.getValue()) */ ) {
     Accounter.showError(messages.pleaseEnter(messages.details()));
     return false;
   } else if (!(managingYes.getValue() || managingNo.getValue())) {
     Accounter.showMessage(messages.managingBills());
     return false;
     /*
      * } else if (!(trackingTimeYes.getValue() ||
      * trackingNo.getValue())) {
      * Accounter.showMessage(messages.doyouwantTrackBills()); return
      * false;
      */
   } else {
     return true;
   }
 }
 public ManageMeasureSearchModel.Result getSelectedMeasure() {
   ManageMeasureSearchModel.Result r = new ManageMeasureSearchModel.Result();
   List<ManageMeasureSearchModel.Result> data = getData();
   for (int i = 0; i < data.size(); i++) {
     ManageMeasureSearchModel.Result m = data.get(i);
     RadioButton selectedMeasure = radioButtonMap.get(m);
     if (selectedMeasure.getValue().equals(Boolean.TRUE)) {
       r = m;
     }
   }
   return r;
 }
  @Override
  public void onSave() {
    if (managingYes.getValue()) {
      preferences.setKeepTrackofBills(true);
    } else {
      preferences.setKeepTrackofBills(false);
    }

    // if (trackingTimeYes.getValue()) {
    // preferences.setDoYouKeepTrackOfTime(true);
    // } else {
    // preferences.setDoYouKeepTrackOfTime(false);
    // }
  }
Beispiel #13
0
 /**
  * Called whenever the internal state has been changed and needs to synchronize the other
  * components.
  */
 private void updateSliders() {
   // Let the sliders know something's changed
   if (rbHue.getValue()) onClick(rbHue);
   if (rbSaturation.getValue()) onClick(rbSaturation);
   if (rbBrightness.getValue()) onClick(rbBrightness);
   if (rbRed.getValue()) onClick(rbRed);
   if (rbGreen.getValue()) onClick(rbGreen);
   if (rbBlue.getValue()) onClick(rbBlue);
 }
  @Test
  public void checkRadioButtonClick() {
    tested = false;
    RadioButton r = new RadioButton("myRadioGroup", "foo");
    r.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            tested = !tested;
          }
        });

    Assert.assertEquals(false, tested);

    // simule the event
    Browser.click(r);

    Assert.assertEquals(true, tested);
    Assert.assertEquals(true, r.getValue());
  }
 /** {@inheritDoc} */
 @Override
 public boolean isHardMode() {
   return hard.getValue();
 }
 /** {@inheritDoc} */
 @Override
 public boolean isMixMode() {
   return mixed.getValue();
 }
 /** {@inheritDoc} */
 @Override
 public boolean isSoftMode() {
   return soft.getValue();
 }
Beispiel #18
0
  private boolean validate() {
    boolean result = true;
    String description = taDescription.getText();
    String name = tbName.getText();
    String imageFile = fuImageFile.getFilename();
    if (rbSinglePrice.getValue()) {
      fixPriceFormat(dbSinglePrice);
      if (dbSinglePrice.getValue() == null) {
        Window.alert("El precio introducido no es válido");
        result = false;
      }
    } else {
      boolean oneChecked = false;
      if (cbSmall.getValue()) {
        oneChecked = true;
        fixPriceFormat(dbSmallPrice);
        if (dbSmallPrice.getValue() == null) {
          Window.alert("El precio introducido para 'Pequeña' no es válido");
          result = false;
        }
      }
      if (result && cbMedium.getValue()) {
        oneChecked = true;
        fixPriceFormat(dbMediumPrice);
        if (dbMediumPrice.getValue() == null) {
          Window.alert("El precio introducido para 'Mediana' no es válido");
          result = false;
        }
      }
      if (result && cbLarge.getValue()) {
        oneChecked = true;
        fixPriceFormat(dbLargePrice);
        if (dbLargePrice.getValue() == null) {
          Window.alert("El precio introducido para 'Grande' no es válido");
          result = false;
        }
      }
      if (result && cbTapa.getValue()) {
        oneChecked = true;
        fixPriceFormat(dbTapaPrice);
        if (dbTapaPrice.getValue() == null) {
          Window.alert("El precio introducido para 'Tapa' no es válido");
          result = false;
        }
      }
      if (result && cbHalf.getValue()) {
        oneChecked = true;
        fixPriceFormat(dbHalfPrice);
        if (dbHalfPrice.getValue() == null) {
          Window.alert("El precio introducido para '1/2 Ración' no es válido");
          result = false;
        }
      }
      if (result && cbFull.getValue()) {
        oneChecked = true;
        fixPriceFormat(dbFullPrice);
        if (dbFullPrice.getValue() == null) {
          Window.alert("El precio introducido para 'Ración' no es válido");
          result = false;
        }
      }
    }

    if (result) {
      if (name == null || name.length() == 0) {
        Window.alert("Por favor, introduzca el nombre");
        result = false;
      }
    }
    return result;
  }
 public boolean isEndBy() {
   return endByRb.getValue();
 }
 public boolean isNoEndDate() {
   return noEndDateRb.getValue();
 }