コード例 #1
0
  private void createColorPicker() {
    colorPicker.setValue("000000");

    // Set the selected color to the maplayer
    colorPicker.addListener(
        Events.Select,
        new Listener<ColorPaletteEvent>() {
          @Override
          public void handleEvent(ColorPaletteEvent be) {
            if (!Objects.equal(layer.getMaxColor(), colorPicker.getValue())) {
              layer.setMaxColor(colorPicker.getValue());
              ValueChangeEvent.fire(PolygonLayerOptions.this, layer);
            }
          }
        });

    LabelField labelColor = new LabelField(I18N.CONSTANTS.color());
    add(labelColor);
    add(colorPicker);
  }
コード例 #2
0
  @Override
  public void go(UserDatabaseDTO db) {
    view.setHeading(db.getFullName() == null ? db.getName() : db.getFullName());

    if (db.isDesignAllowed()) {
      view.add(
          I18N.CONSTANTS.design(),
          I18N.CONSTANTS.designDescription(),
          "db-design.png",
          new DbPageState(DesignPresenter.PAGE_ID, db.getId()));
    }
    if (db.isManageAllUsersAllowed()) {
      view.add(
          I18N.CONSTANTS.partner(),
          I18N.CONSTANTS.partnerEditorDescription(),
          "db-partners.png",
          new DbPageState(DbPartnerEditor.PAGE_ID, db.getId()));
    }
    if (db.isManageUsersAllowed()) {
      view.add(
          I18N.CONSTANTS.users(),
          I18N.CONSTANTS.userManagerDescription(),
          "db-users.png",
          new DbPageState(DbUserEditor.PAGE_ID, db.getId()));
    }
    if (db.isDesignAllowed()) {
      view.add(
          I18N.CONSTANTS.timeLocks(),
          I18N.CONSTANTS.lockPeriodsDescription(),
          "db-lockedperiods.png",
          new DbPageState(LockedPeriodsPresenter.PAGE_ID, db.getId()));
    }
    if (db.isDesignAllowed()) {
      view.add(
          I18N.CONSTANTS.project(),
          I18N.CONSTANTS.projectManagerDescription(),
          "db-projects.png",
          new DbPageState(DbProjectEditor.PAGE_ID, db.getId()));
    }
    if (db.isDesignAllowed()) {
      view.add(
          I18N.CONSTANTS.target(),
          I18N.CONSTANTS.targetDescription(),
          "db-targets.png",
          new DbPageState(DbTargetEditor.PAGE_ID, db.getId()));
    }

    // view.add("Cibles", "Définer les cibles pour les indicateurs.",
    // "db-targets",
    // new DbPageState(Pages.DatabaseTargets, db.getId()));
  }