Package de.agilecoders.wicket.core.markup.html.bootstrap.block

Examples of de.agilecoders.wicket.core.markup.html.bootstrap.block.Code


     */
    public DatePickerPage(PageParameters parameters) {
        super(parameters);

        add(newDefaultDatePicker("default"),
            new Code("default-html-code", Model.of("//HTML\n<form><input wicket:id=\"default\"></form>")).setShowLineNumbers(true),
            new Code("default-java-code", Model.of("//JAVA\nadd(new DateTextField(\"default\"));")).setShowLineNumbers(true));

        add(newDatePicker("birthday", new DateTextFieldConfig().showTodayButton(DateTextFieldConfig.TodayButton.TRUE).withStartDate(new DateTime().withYear(1900)).autoClose(true).withView(DateTextFieldConfig.View.Decade)),
            new Code("birthday-html-code", Model.of("//HTML\n<form><input wicket:id=\"birthday\"></form>")).setShowLineNumbers(true),
            new Code("birthday-java-code", Model.of("//JAVA\nadd(new DateTextField(\"birthday\",\n\t\t new DateTextFieldConfig()\n"
                                                    + "\t\t\t.autoClose(true)\n"
                                                    + "\t\t\t.withView(DateTextFieldConfig.View.Decade)\n"
                                                    + "\t\t\t.showTodayButton(true)\n"
                                                    + "\t\t\t.withStartDate(new DateTime().withYear(1900));")).setShowLineNumbers(true));

        add(newDatePicker("language", new DateTextFieldConfig().showTodayButton(DateTextFieldConfig.TodayButton.LINKED).autoClose(true).withLanguage("es")),
            new Code("language-html-code", Model.of("//HTML\n<form><input wicket:id=\"language\"></form>")).setShowLineNumbers(true),
            new Code("language-java-code", Model.of("//JAVA\nadd(new DateTextField(\"language\",\n\t\t new DateTextFieldConfig()\n"
                                                    + "\t\t\t.autoClose(true)\n"
                                                    + "\t\t\t.withLanguage(\"es\")\n"
                                                    + "\t\t\t.showTodayButton(true);")).setShowLineNumbers(true));

        DatePickerModal modal = new DatePickerModal("modal");
View Full Code Here


        add(newNavbar("navbar"));
        add(newNavigation("navigation"));
        add(new Footer("footer"));

        add(new Code("code-internal"));

        add(new HeaderResponseContainer("footer-container", "footer-container"));

        // add new relic RUM scripts.
        add(new Label("newrelic", Model.of(NewRelic.getBrowserTimingHeader()))
View Full Code Here

                        "video/ogg"),
                    new Video(
                        "http://ia700305.us.archive.org/18/items/CopyingIsNotTheft/CINT_Nik_H264_720_512kb.mp4",
                        "video/mp4"));
    add(new Html5Player("video", Model.ofList(videos)));
    add(new Code(
        "video-code",
        Model.of("List<Html5Player.IVideo> videos = Lists.<Html5Player.IVideo>newArrayList(\n"
            + "\t\tnew Video(\"video.ogv\", \"video/ogg\"),\n"
            + "\t\tnew Video(\"video.mp4\", \"video/mp4\")\n"
            + ");\n"
            + "add(new Html5Player(\"video\", Model.ofList(videos)));")));

    add(new Html5Player("video-custom", Model.ofList(videos),
        new Html5VideoConfig().showProgressBar(false)
            .autoHideControlBar(false)).setWidth(680)
        .setHeight(360));
    add(new Code(
        "video-custom-code",
        Model.of("List<Html5Player.IVideo> videos = Lists.<Html5Player.IVideo>newArrayList(\n"
            + "\t\tnew Video(\"video.ogv\", \"video/ogg\"),\n"
            + "\t\tnew Video(\"video.mp4\", \"video/mp4\")\n"
            + ");\n"
            + "add(new Html5Player(\"video\", Model.ofList(videos),\n"
            + "\tnew Html5VideoConfig().showProgressBar(false).autoHideControlBar(false))\n"
            + "\t\t.setWidth(680).setHeight(360));")));

    final List<? extends AbstractLink> buttons = Lists
        .<AbstractLink> newArrayList(
            new MenuBookmarkablePageLink<Void>(
                DatePickerPage.class, Model.of("DatePicker"))
                .setIconType(GlyphIconType.time),
            new MenuBookmarkablePageLink<Void>(IssuesPage.class,
                Model.of("Github Issues"))
                .setIconType(GlyphIconType.book),
            new MenuBookmarkablePageLink<Void>(
                ExtensionsPage.class, Model.of("Extensions"))
                .setIconType(GlyphIconType.qrcode));
    final Component contextPanel = new TransparentWebMarkupContainer(
        "context-panel");
    final ButtonListContextMenu contextMenu = new ButtonListContextMenu(
        "contextmenu", Model.ofList(buttons));
    contextMenu.assignTo(contextPanel);
    add(contextMenu,
        contextPanel,
        new Code(
            "context-code",
            Model.of(""
                + "final List<? extends AbstractLink> buttons = Lists.<AbstractLink>newArrayList(\n"
                + "\tnew MenuBookmarkablePageLink<>(...),\n"
                + "\t[...]\n"
                + ");\n"
                + "final Component contextPanel = new TransparentWebMarkupContainer(\"context-panel\");\n"
                + "final ButtonListContextMenu contextMenu = new ButtonListContextMenu(\"contextmenu\", \n"
                + "\t\tModel.ofList(buttons));\n"
                + "contextMenu.assignTo(contextPanel);\n"
                + "add(contextMenu, contextPanel,")));

    Modal<String> draggableModal = new TextContentModal(
        "draggable-modal",
        Model.of("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."));
    // draggableModal.add(new Draggable(new
    // DraggableConfig().withHandle(".modal-header").withCursor("move")));
    // draggableModal.add(new Resizable());
    draggableModal.setUseKeyboard(true).addCloseButton();
    draggableModal.setFadeIn(false);
    Label draggableButton = new Label("open-draggable", "Open Modal Dialog");
    draggableModal.addOpenerAttributesTo(draggableButton);
    add(draggableModal, draggableButton,
        new Code("draggable-code", Model.of("")));

    DropDownButton dropDownButton = new DropDownButton("dropdown",
        Model.of("open-on-hover")) {
      @Override
      protected List<AbstractLink> newSubMenuButtons(String buttonMarkupId) {
        return Lists.<AbstractLink> newArrayList(
            new MenuBookmarkablePageLink<Void>(
                DatePickerPage.class, Model.of("DatePicker"))
                .setIconType(GlyphIconType.time),
            new MenuBookmarkablePageLink<Void>(IssuesPage.class,
                Model.of("Github Issues"))
                .setIconType(GlyphIconType.book),
            new MenuBookmarkablePageLink<Void>(
                ExtensionsPage.class, Model.of("Extensions"))
                .setIconType(GlyphIconType.qrcode));
      }
    };

    dropDownButton.add(new DropDownAutoOpen());
    add(dropDownButton,
        new Code("dropdown-code", Model
            .of("dropDownButton.add(new DropDownAutoOpen());")));

    addTour();
    add(new Icon("html5-colored", OpenWebIconType.html5_colored),
        new Icon("apml", OpenWebIconType.apml), new Icon("feed",
            OpenWebIconType.feed_colored));
    add(new Icon("html5", OpenWebIconType.html5),
        new Code(
            "openwebicon-code",
            Model.of("response.render(JavaScriptHeaderItem.forReference(OpenWebIconsCssReference.instance()));\n\nadd(new Icon(\"html5\", OpenWebIconType.html5));")));

    addJasnyFileUploadDemo();
    addJasnyInputMaskDemo();
View Full Code Here

    };

    final ComponentFeedbackPanel feedback = new ComponentFeedbackPanel("feedback", checkBoxX);
    feedback.setOutputMarkupId(true);

    Code code = new Code("linkCode", Model.of("CheckboxX checkboxX = new CheckboxX(\"checkboxX\", new Model<Boolean>(true)) {\n"
                          + "  @Override\n"
                          + "  protected void onChange(Boolean value, AjaxRequestTarget target) {\n"
                          + "    info(\"The selection is: \" + value);\n"
                          + "    target.add(feedback);\n"
                          + "  }\n"
View Full Code Here

        Duration.seconds(2).sleep();
      }
    };
    laddaLink.setEffect(LaddaBehavior.Effect.EXPAND_LEFT).setSize(Buttons.Size.Medium);

    form.add(new Code("linkCode", Model.of("laddaLink = new LaddaAjaxLink<String>(\"laddaLink\", Model.of(\"Link, 2secs\"), Buttons.Type.Success) {\n"
                         + "    @Override public void onClick(AjaxRequestTarget target) {\n"
                         + "        Duration.seconds(2).sleep();\n"
                         + "    }\n"
                         + "};\n"
                         + "laddaLink.setEffect(LaddaBehavior.Effect.EXPAND_LEFT).setSize(Buttons.Size.Medium);")));
View Full Code Here

*/
public class CodeTest extends WicketApplicationTest {

    @Test(expected = MarkupException.class)
    public void tagNameWasAsserted() {
        tester().startComponentInPage(new Code(id()));
    }
View Full Code Here

        tester().startComponentInPage(new Code(id()));
    }

    @Test
    public void codeTagIsAllowed() {
        tester().startComponentInPage(new Code(id()), createMarkup("code"));

        tester().assertNoErrorMessage();
        tester().assertVisible(id());
    }
View Full Code Here

        tester().assertVisible(id());
    }

    @Test
    public void preTagIsAllowed() {
        tester().startComponentInPage(new Code(id()), createMarkup("pre"));

        tester().assertNoErrorMessage();
        tester().assertVisible(id());
    }
View Full Code Here

        tester().assertVisible(id());
    }

    @Test
    public void linenumberWithStartCssClassNameWasSet() {
        tester().startComponentInPage(new Code(id()).setStartFromLine(5), createMarkup("pre"));

        assertCssClass(tester().getTagByWicketId(id()), "linenums:5");
    }
View Full Code Here

        assertCssClass(tester().getTagByWicketId(id()), "linenums:5");
    }

    @Test
    public void linenumberCssClassNameWasSet() {
        tester().startComponentInPage(new Code(id()).setShowLineNumbers(true), createMarkup("pre"));

        assertCssClass(tester().getTagByWicketId(id()), "linenums");
    }
View Full Code Here

TOP

Related Classes of de.agilecoders.wicket.core.markup.html.bootstrap.block.Code

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.