Пример #1
0
  @Test
  public void testBuilder() {
    final LayoutDescriptors layoutDescriptors =
        LayoutDescriptors.create()
            .add(
                LayoutDescriptor.create()
                    .name("fancy-layout")
                    .displayName("Fancy layout")
                    .config(Form.create().build())
                    .regions(RegionDescriptors.create().build())
                    .key(DescriptorKey.from("module:fancy-layout"))
                    .build())
            .add(
                LayoutDescriptor.create()
                    .name("fancy-layout2")
                    .displayName("Fancy layout2")
                    .config(Form.create().build())
                    .regions(RegionDescriptors.create().build())
                    .key(DescriptorKey.from("module:fancy-layout2"))
                    .build())
            .build();

    assertEquals(2, layoutDescriptors.getSize());
    assertNotNull(layoutDescriptors.getDescriptor("fancy-layout"));
    assertNotNull(layoutDescriptors.getDescriptor(DescriptorKey.from("module:fancy-layout2")));
  }
Пример #2
0
  private MacroDescriptor generateEmbedIFrameMacroDescriptor() {
    final MacroKey macroKey = MacroKey.from(ApplicationKey.SYSTEM, "embed");

    final Form form =
        Form.create()
            .addFormItem(createTextAreaInput("body", "IFrame HTML").occurrences(1, 1).build())
            .build();

    return create(macroKey, "Embed IFrame", "Generic iframe embedder", form);
  }
Пример #3
0
  private MacroDescriptor generateDisableMacroDescriptor() {
    final MacroKey macroKey = MacroKey.from(ApplicationKey.SYSTEM, "disable");

    final Form form =
        Form.create()
            .addFormItem(createTextAreaInput("body", "Contents").occurrences(1, 1).build())
            .build();

    return create(macroKey, "Disable macros", "Contents of this macro will not be formatted", form);
  }