Examples of BooleanOption


Examples of com.asakusafw.runtime.value.BooleanOption

        super(TypeInfoFactory.booleanTypeInfo);
    }

    @Override
    protected ValueOption<?> newObject() {
        return new BooleanOption();
    }
View Full Code Here

Examples of com.asakusafw.runtime.value.BooleanOption

        return new BooleanOption();
    }

    @Override
    public Object getPrimitiveJavaObject(Object o) {
        BooleanOption object = (BooleanOption) o;
        if (object == null || object.isNull()) {
            return null;
        }
        return object.get();
    }
View Full Code Here

Examples of com.asakusafw.runtime.value.BooleanOption

        return object.get();
    }

    @Override
    public Object getPrimitiveWritableObject(Object o) {
        BooleanOption object = (BooleanOption) o;
        if (object == null || object.isNull()) {
            return null;
        }
        return new BooleanWritable(object.get());
    }
View Full Code Here

Examples of com.asakusafw.runtime.value.BooleanOption

    public void boolean_values() throws Exception {
        trueFormat = "true";
        falseFormat = "false";

        CsvParser parser = create("true,false,");
        BooleanOption option = new BooleanOption();

        assertThat(parser.next(), is(true));

        parser.fill(option);
        assertThat(option.get(), is(true));

        parser.fill(option);
        assertThat(option.get(), is(false));

        parser.fill(option);
        assertThat(option.isNull(), is(true));

        parser.endRecord();
        assertThat(parser.next(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.runtime.value.BooleanOption

     * booleanの値を出力するテスト。
     * @throws Exception 例外が発生した場合
     */
    @Test
    public void emitBoolean() throws Exception {
        BooleanOption value = new BooleanOption();

        value.modify(true);
        emitter.emit(value);
        value.modify(false);
        emitter.emit(value);
        emitter.endRecord();

        value.modify(false);
        emitter.emit(value);
        value.modify(true);
        emitter.emit(value);
        emitter.endRecord();

        value.setNull();
        emitter.emit(value);
        value.modify(true);
        emitter.emit(value);
        emitter.endRecord();
        emitter.close();

        RecordParser parser = parser();
        assertThat(parser.next(), is(true));
        parser.fill(value);
        assertThat(value.get(), is(true));
        parser.fill(value);
        assertThat(value.get(), is(false));

        assertThat(parser.next(), is(true));
        parser.fill(value);
        assertThat(value.get(), is(false));
        parser.fill(value);
        assertThat(value.get(), is(true));

        assertThat(parser.next(), is(true));
        parser.fill(value);
        assertThat(value.isNull(), is(true));
        parser.fill(value);
        assertThat(value.isNull(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.runtime.value.BooleanOption

     * test for boolean values.
     * @throws Exception if failed
     */
    @Test
    public void boolean_values() throws Exception {
        assertRestorable(new BooleanOption(true));
        assertRestorable(new BooleanOption(false));
        assertRestorable(new BooleanOption());

        trueFormat = "false";
        falseFormat = "true";
        assertRestorable(new BooleanOption(true));
        assertRestorable(new BooleanOption(false));
    }
View Full Code Here

Examples of com.asakusafw.runtime.value.BooleanOption

     * booleanの値を解析するテスト。
     * @throws Exception 例外が発生した場合
     */
    @Test
    public void fillBoolean() throws Exception {
        BooleanOption value = new BooleanOption();
        create("boolean");

        assertThat(parser.next(), is(true));
        parser.fill(value);
        assertThat(value.get(), is(true));
        parser.fill(value);
        assertThat(value.get(), is(false));
        parser.endRecord();

        assertThat(parser.next(), is(true));
        parser.fill(value);
        assertThat(value.get(), is(false));
        parser.fill(value);
        assertThat(value.get(), is(true));
        parser.endRecord();

        assertThat(parser.next(), is(true));
        parser.fill(value);
        assertThat(value.isNull(), is(true));
        parser.fill(value);
        assertThat(value.isNull(), is(false));
        parser.endRecord();
    }
View Full Code Here

Examples of com.gitblit.wicket.panels.BooleanOption

        getString("gb.languagePreference"),
        getString("gb.languagePreferenceDescription"),
        language,
        languages));

    prefs.add(new BooleanOption("emailMeOnMyTicketChanges",
        getString("gb.emailMeOnMyTicketChanges"),
        getString("gb.emailMeOnMyTicketChangesDescription"),
        emailMeOnMyTicketChanges).setVisible(app().notifier().isSendingMail()));

    List<Transport> availableTransports = new ArrayList<>();
View Full Code Here

Examples of com.gitblit.wicket.panels.BooleanOption

    form.add(teamsPalette);

    //
    // TICKETS
    //
    form.add(new BooleanOption("acceptNewPatchsets",
        getString("gb.acceptNewPatchsets"),
        getString("gb.acceptNewPatchsetsDescription"),
        new PropertyModel<Boolean>(repositoryModel, "acceptNewPatchsets")));

    form.add(new BooleanOption("acceptNewTickets",
        getString("gb.acceptNewTickets"),
        getString("gb.acceptNewTicketsDescription"),
        new PropertyModel<Boolean>(repositoryModel, "acceptNewPatchsets")));

    form.add(new BooleanOption("requireApproval",
        getString("gb.requireApproval"),
        getString("gb.requireApprovalDescription"),
        new PropertyModel<Boolean>(repositoryModel, "requireApproval")));

    form.add(new ChoiceOption<String>("mergeTo",
        getString("gb.mergeTo"),
        getString("gb.mergeToDescription"),
        new PropertyModel<String>(repositoryModel, "mergeTo"),
        availableBranches));

    //
    // RECEIVE
    //
    form.add(new BooleanOption("isFrozen",
        getString("gb.isFrozen"),
        getString("gb.isFrozenDescription"),
        new PropertyModel<Boolean>(repositoryModel, "isFrozen")));

    form.add(new BooleanOption("incrementalPushTags",
        getString("gb.enableIncrementalPushTags"),
        getString("gb.useIncrementalPushTagsDescription"),
        new PropertyModel<Boolean>(repositoryModel, "useIncrementalPushTags")));

    final CheckBox verifyCommitter = new CheckBox("checkbox", new PropertyModel<Boolean>(repositoryModel, "verifyCommitter"));
    verifyCommitter.setOutputMarkupId(true);
    form.add(new BooleanOption("verifyCommitter",
        getString("gb.verifyCommitter"),
        getString("gb.verifyCommitterDescription") + "<br/>" + getString("gb.verifyCommitterNote"),
        verifyCommitter).setIsHtmlDescription(true));

    form.add(preReceivePalette);
    form.add(new BulletListPanel("inheritedPreReceive", getString("gb.inherited"), app().repositories()
        .getPreReceiveScriptsInherited(repositoryModel)));
    form.add(postReceivePalette);
    form.add(new BulletListPanel("inheritedPostReceive", getString("gb.inherited"), app().repositories()
        .getPostReceiveScriptsInherited(repositoryModel)));

    WebMarkupContainer customFieldsSection = new WebMarkupContainer("customFieldsSection");
    customFieldsSection.add(customFieldsListView);
    form.add(customFieldsSection.setVisible(!app().settings().getString(Keys.groovy.customFields, "").isEmpty()));

    //
    // FEDERATION
    //
    List<FederationStrategy> federationStrategies = new ArrayList<FederationStrategy>(
        Arrays.asList(FederationStrategy.values()));
    // federation strategies - remove ORIGIN choice if this repository has no origin.
    if (StringUtils.isEmpty(repositoryModel.origin)) {
      federationStrategies.remove(FederationStrategy.FEDERATE_ORIGIN);
    }

    form.add(new ChoiceOption<FederationStrategy>("federationStrategy",
        getString("gb.federationStrategy"),
        getString("gb.federationStrategyDescription"),
        new DropDownChoice<FederationStrategy>(
            "choice",
            new PropertyModel<FederationStrategy>(repositoryModel, "federationStrategy"),
            federationStrategies,
            new FederationTypeRenderer())));

    form.add(federationSetsPalette);

    //
    // SEARCH
    //
    form.add(indexedBranchesPalette);

    //
    // GARBAGE COLLECTION
    //
    boolean gcEnabled = app().settings().getBoolean(Keys.git.enableGarbageCollection, false);
    int defaultGcPeriod = app().settings().getInteger(Keys.git.defaultGarbageCollectionPeriod, 7);
    if (repositoryModel.gcPeriod == 0) {
      repositoryModel.gcPeriod = defaultGcPeriod;
    }
    List<Integer> gcPeriods = Arrays.asList(1, 2, 3, 4, 5, 7, 10, 14 );
    form.add(new ChoiceOption<Integer>("gcPeriod",
        getString("gb.gcPeriod"),
        getString("gb.gcPeriodDescription"),
        new DropDownChoice<Integer>("choice",
            new PropertyModel<Integer>(repositoryModel, "gcPeriod"),
            gcPeriods,
            new GCPeriodRenderer())).setEnabled(gcEnabled));

    form.add(new TextOption("gcThreshold",
        getString("gb.gcThreshold"),
        getString("gb.gcThresholdDescription"),
        "span1",
        new PropertyModel<String>(repositoryModel, "gcThreshold")).setEnabled(gcEnabled));

    //
    // MISCELLANEOUS
    //

    form.add(new TextOption("origin",
        getString("gb.origin"),
        getString("gb.originDescription"),
        "span6",
        new PropertyModel<String>(repositoryModel, "origin")).setEnabled(false));

    form.add(new BooleanOption("showRemoteBranches",
        getString("gb.showRemoteBranches"),
        getString("gb.showRemoteBranchesDescription"),
        new PropertyModel<Boolean>(repositoryModel, "showRemoteBranches")));

    form.add(new BooleanOption("skipSizeCalculation",
        getString("gb.skipSizeCalculation"),
        getString("gb.skipSizeCalculationDescription"),
        new PropertyModel<Boolean>(repositoryModel, "skipSizeCalculation")));

    form.add(new BooleanOption("skipSummaryMetrics",
        getString("gb.skipSummaryMetrics"),
        getString("gb.skipSummaryMetricsDescription"),
        new PropertyModel<Boolean>(repositoryModel, "skipSummaryMetrics")));

    List<Integer> maxActivityCommits  = Arrays.asList(-1, 0, 25, 50, 75, 100, 150, 200, 250, 500);
View Full Code Here

Examples of com.gitblit.wicket.panels.BooleanOption

    // initial commit options
    //

    // add README
    addReadmeModel = Model.of(false);
    form.add(new BooleanOption("addReadme",
        getString("gb.initWithReadme"),
        getString("gb.initWithReadmeDescription"),
        addReadmeModel));

    // add .gitignore
    File gitignoreDir = app().runtime().getFileOrFolder(Keys.git.gitignoreFolder, "${baseFolder}/gitignore");
    File [] files = gitignoreDir.listFiles();
    if (files == null) {
      files = new File[0];
    }
    List<String> gitignores = new ArrayList<String>();
    for (File file : files) {
      if (file.isFile() && file.getName().endsWith(".gitignore")) {
        gitignores.add(StringUtils.stripFileExtension(file.getName()));
      }
    }
    Collections.sort(gitignores);

    gitignoreModel = Model.of("");
    addGitignoreModel = Model.of(false);
    form.add(new BooleanChoiceOption<String>("addGitIgnore",
        getString("gb.initWithGitignore"),
        getString("gb.initWithGitignoreDescription"),
        addGitignoreModel,
        gitignoreModel,
        gitignores).setVisible(gitignores.size() > 0));

    // TODO consider gitflow at creation (ticket-55)
    addGitflowModel = Model.of(false);
    form.add(new BooleanOption("addGitFlow",
        "Include a .gitflow file",
        "This will generate a config file which guides Git clients in setting up Gitflow branches.",
        addGitflowModel).setVisible(false));

    form.add(new Button("create"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.