01: package org.gjt.sp.jedit.buffer;
02:
03: import java.util.Map;
04: import java.util.HashMap;
05:
06: /**
07: * @author Matthieu Casanova
08: * @version $Id: Buffer.java 8190 2006-12-07 07:58:34Z kpouer $
09: */
10: public class DefaultFoldHandlerProvider implements FoldHandlerProvider {
11: private final Map<String, FoldHandler> folds = new HashMap<String, FoldHandler>();
12:
13: /**
14: * Returns the fold handler with the specified name, or null if
15: * there is no registered handler with that name.
16: *
17: * @param name The name of the desired fold handler
18: * @return the FoldHandler or null if it doesn't exists
19: * @since jEdit 4.3pre10
20: */
21: public FoldHandler getFoldHandler(String name) {
22: return folds.get(name);
23: }
24:
25: /**
26: * Returns an array containing the names of all registered fold
27: * handlers.
28: *
29: * @since jEdit 4.0pre6
30: */
31: public String[] getFoldModes() {
32: return folds.keySet().toArray(new String[folds.size()]);
33: }
34: }
|