Package de.yaams.maker.helper.gui.form

Examples of de.yaams.maker.helper.gui.form.FormCheckbox


        if (status != null) {
          status.setText(I18N.t("{0} auf {1} updaten", getTitle(), getOnlineElement("version", "0")));
          status.setIcon(IconCache.get("web"));
        }
        form.addElement("basic." + id, new FormCheckbox(
            I18N.t("{0} auf {1} updaten", getTitle(), getOnlineElement("version", "0")), true)
            .addValidator(new ValidatorBase() {

              @Override
              public void isValide(YMessagesDialog y) {
View Full Code Here


        // return;
      }

      final PluginInfo i = PluginLoader.getPlugins().get(id);

      f.addElement("basic." + id + "_box", new FormCheckbox(i.getTitle(), false).addChangeListener(new FormElementChangeListener() {

        @Override
        public void stateChanged(FormElement form) {
          JCheckBox c = (JCheckBox) form.getElement();
          // add or remove it?
View Full Code Here

   * @param id
   * @param standard
   * @return
   */
  public static FormCheckbox bool(final Project p, String title, final String id, boolean standard) {
    return (FormCheckbox) new FormCheckbox(title, p == null ? Setting.get(id, standard) : ProjectSett.get(p, id, standard))
        .addChangeListener(new FormElementChangeListener() {

          @Override
          public void stateChanged(FormElement form) {
            if (p == null) {
View Full Code Here

      }

      // set it
      f.addElement(
          "sec.sec",
          new FormCheckbox(I18N.t("Projekt verschlüsseln"), cryp)
              .setInfoTxt(
                  "<html><strong>Vorgehen</strong><br>"
                      + "Wenn die Verschlüssungsfunktion aktiviert wurde, muss im nächsten Dialog der Name und das Password gewählt werden.<br>"
                      + "Wenn die Funktion deaktiviert wird, muss der Name und das Password eingegeben werden, wenn Sie noch nicht eingegeben wurden.<br>"
                      + "<br><strong>Hinweise</strong<br>"
View Full Code Here

   * @return
   */
  public static FormCheckbox getBooleanFlag(final String name, final RubyObject holder, final int index, final int flag) {
    final JavaTable table = new JavaTable(holder);

    return (FormCheckbox) new FormCheckbox(name, (table.get(index, 0, 0) & flag) == flag).addChangeListener(new FormElementChangeListener() {

      @Override
      public void stateChanged(FormElement form) {
        if (Boolean.parseBoolean(form.getContentAsString())) {
          table.set(index, 0, 0, table.get(index, 0, 0) | flag);
View Full Code Here

   * @param holder
   * @param index
   * @return
   */
  public static FormCheckbox getBoolean(final String name, final Object holder, final Object index) {
    return (FormCheckbox) new FormCheckbox(name, ((RubyBoolean) RubyHelper.getObj(holder, index)).isTrue())
        .addChangeListener(new FormElementChangeListener() {

          @Override
          public void stateChanged(FormElement form) {
            RubyHelper.setObj(holder, index, new RubyBoolean(RubyHelper.getRunTime(holder, index), Boolean.parseBoolean(form.getContentAsString())));
View Full Code Here

   * @param name
   * @param object
   * @return
   */
  public static FormCheckbox getBooleanAsInt(final String name, final Object holder, final Object index) {
    return (FormCheckbox) new FormCheckbox(name, RubyHelper.toInt(holder, index) == 1).addChangeListener(new FormElementChangeListener() {

      @Override
      public void stateChanged(FormElement form) {
        RubyHelper.setNum(holder, index, Boolean.parseBoolean(form.getContentAsString()) ? 1 : 0);

View Full Code Here

        "Turn", "Movement" }, page, "@span"));

    form.addHeader("cond", new FormHeader(I18N.t("Bedingung"), "if").setCollapsed(true).setColumn(6));

    // add turn
    FormCheckbox c = RubyForm.getBoolean(I18N.t("Turn"), condition, "@turn_valid");
    form.addElement("cond.turn_a", c);
    form.addElement("cond.turn_turn_a",
        FormHelper.setEnabeldWhenRightElementSelect(c, RubyForm.getNumber("", condition, "@turn_a"), "true"));
    form.addElement("cond.turn_turn_b",
        FormHelper.setEnabeldWhenRightElementSelect(c, RubyForm.getNumber("+ X*", condition, "@turn_b"), "true"));
    c.informListeners();

    // add enemy
    c = RubyForm.getBoolean(I18N.t(RGSS1Helper.getName(Type.ENEMY)), condition, "@enemy_valid");
    form.addElement("cond.enemy_a", c);
    form.addElement("cond.enemy_def", FormHelper.setEnabeldWhenRightElementSelect(c, RubyForm.getNumber("", condition, "@enemy_index")
        .setMinMax(1, 8, 1), "true"));
    form.addElement(
        "cond.enemy_hp",
        FormHelper.setEnabeldWhenRightElementSelect(c,
            RubyForm.getNumber("Hp is or below (%):", condition, "@enemy_hp").setMinMax(0, 100, 1), "true"));
    c.informListeners();

    // add actor
    c = RubyForm.getBoolean(RGSS1Helper.getName(Type.ACTOR), condition, "@actor_valid");
    form.addElement("cond.actor_a", c);
    form.addElement("cond.actor_def", FormHelper.setEnabeldWhenRightElementSelect(c, new FormDBComboBox("", project, Type.ACTOR,
        condition, "@actor_id", true), "true"));
    form.addElement(
        "cond.actor_hp",
        FormHelper.setEnabeldWhenRightElementSelect(c,
            RubyForm.getNumber("Hp is or below (%):", condition, "@actor_hp").setMinMax(0, 100, 1), "true"));
    c.informListeners();

    // add actor
    c = RubyForm.getBoolean(RGSS1Helper.getName(Type.SWITCH), condition, "@switch_valid");
    form.addElement("cond.switch_a", c);
    form.addElement("cond.switch_id", FormHelper.setEnabeldWhenRightElementSelect(c, new FormSwitchVarSelector(project,
        I18N.t("Is on"), condition, "@switch_id", Type.SWITCH), "true"));
    form.addElement("cond.switch_id2", new FormEmpty());
    c.informListeners();

    // add code
    form.setCenter(new YEventCommandList(page.getInstanceVariable("@list"), project, null));
  }
View Full Code Here

            T.setLocale(form.getContentAsString());

          }
        }));
    form.addElement("basic.lang2", new FormInfo("", T.r("lang.translate")));
    form.addElement("basic.dontask", new FormCheckbox(T.r("dialog.dontask"), true).addChangeListener(new FormElementChangeListener() {

      @Override
      public void stateChanged(FormElement form) {
        if ("true".equals(form.getContentAsString())) {
          Setting.getSystemPreferences().putBoolean("lang.dontask", Boolean.parseBoolean(form.getContentAsString()));
View Full Code Here

  @Override
  public FormBuilder getForm() {

    form = new FormBuilder("wizard.start.folder");

    FormElement c = new FormCheckbox(T.r("start.folder.usb"), false).addChangeListener(new FormElementChangeListener() {

      @Override
      public void stateChanged(FormElement form) {
        if ("true".equals(form.getContentAsString())) {
          Setting.getSystemPreferences().put("workspace", "USB");
          YAamsCore.setFolder("USB", Start.mess);
        }

      }
    });
    form.addElement("basic.usb", c);

    form.addElement(
        "basic.folder",
        FormHelper.addEnableLister(
            new FormFileSelectField(T.r("start.folder.title"), new File(Setting.getSystemPreferences().get("workspace",
                new File(SystemUtils.getUserHome(), "YAams").getAbsolutePath())), JFileChooser.SAVE_DIALOG, true, true), c, "false"))
        .addChangeListener(new FormElementChangeListener() {

          @Override
          public void stateChanged(FormElement form) {
            YAamsCore.setFolder(form.getContentAsString(), Start.mess);
            Setting.getSystemPreferences().put("workspace", form.getContentAsString());

          }
        });

    form.addElement("basic.dontask", new FormCheckbox(T.r("dialog.dontask"), true).addChangeListener(new FormElementChangeListener() {

      @Override
      public void stateChanged(FormElement form) {
        if ("true".equals(form.getContentAsString())) {
          Setting.getSystemPreferences().putBoolean("workspace.dontask", Boolean.parseBoolean(form.getContentAsString()));
View Full Code Here

TOP

Related Classes of de.yaams.maker.helper.gui.form.FormCheckbox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.