예제 #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);
  }
예제 #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 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();
 }
예제 #4
0
 public MacroDescriptor getByKey(final MacroKey key) {
   if (!ApplicationKey.SYSTEM.equals(key.getApplicationKey())) {
     return null;
   }
   return macrosByName.get(key.getName().toLowerCase());
 }