Exemplo n.º 1
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);
  }
Exemplo n.º 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);
  }
Exemplo n.º 3
0
 private MacroDescriptor create(
     final MacroKey macroKey,
     final String displayName,
     final String description,
     final Form form) {
   return MacroDescriptor.create()
       .key(macroKey)
       .displayName(displayName)
       .description(description)
       .form(form)
       .icon(IconLoader.loadIcon(this.getClass(), MACRO_DESCRIPTORS_FOLDER, macroKey.getName()))
       .build();
 }
Exemplo n.º 4
0
 public MacroDescriptor getByKey(final MacroKey key) {
   if (!ApplicationKey.SYSTEM.equals(key.getApplicationKey())) {
     return null;
   }
   return macrosByName.get(key.getName().toLowerCase());
 }