Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert SummernoteConfig toolbarOptions code, Array.asList is unmodifiable #1158

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.agilecoders.wicket.extensions.markup.html.bootstrap.editor;

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -55,14 +55,14 @@ public class SummernoteConfig extends AbstractConfig {
private static final IKey<Map<String, List<String>>> ToolbarOptions = newKey("ToolbarOptions", null);


private Map<String, List<String>> toolbarOptions = new LinkedHashMap<>() {
private final Map<String, List<String>> toolbarOptions = new LinkedHashMap<>() {
private static final long serialVersionUID = 1L;

{
put("Style", Arrays.asList("style", "fontname", "fontsize", "color", "bold", "italic", "underline", "strikethrough", "clear"));
put("Layout", Arrays.asList("ul", "ol", "paragraph", "height"));
put("Insert", Arrays.asList("picture", "link", "video", "table", "hr"));
put("Misc", Arrays.asList("fullscreen", "codeview", "undo", "redo", "help"));
put("Style", new ArrayList<>(List.of("style", "fontname", "fontsize", "color", "bold", "italic", "underline", "strikethrough", "clear")));
put("Layout", new ArrayList<>(List.of("ul", "ol", "paragraph", "height")));
put("Insert", new ArrayList<>(List.of("picture", "link", "video", "table", "hr")));
put("Misc", new ArrayList<>(List.of("fullscreen", "codeview", "undo", "redo", "help")));
}
};

Expand Down Expand Up @@ -242,6 +242,7 @@ public void useStorageId(String storageId) {
/**
* Gets a list of button ids of the given category
*
* @param category
* @return a list of button ids
*/
public List<String> getButtons(String category) {
Expand Down