Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
EditorManager | 36 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.edit; | |
21 | ||
22 | import java.lang.reflect.Type; | |
23 | import java.util.List; | |
24 | ||
25 | import org.xwiki.component.annotation.Role; | |
26 | import org.xwiki.stability.Unstable; | |
27 | ||
28 | /** | |
29 | * Manages the available {@link Editor}s. | |
30 | * | |
31 | * @version $Id: 714a4df5fc4b4c231023af2b15d7bb7688b25999 $ | |
32 | * @since 8.2RC1 | |
33 | */ | |
34 | @Role | |
35 | @Unstable | |
36 | public interface EditorManager | |
37 | { | |
38 | /** | |
39 | * @param dataType the data type | |
40 | * @param <D> the data type | |
41 | * @return the list of editors that can edit the specified type of data | |
42 | */ | |
43 | <D> List<Editor<D>> getEditors(Type dataType); | |
44 | ||
45 | /** | |
46 | * @param dataType the data type | |
47 | * @param category the editor category | |
48 | * @param <D> the data type | |
49 | * @return the list of editors that have the specified category and which are associated with the given data type | |
50 | */ | |
51 | <D> List<Editor<D>> getEditors(Type dataType, String category); | |
52 | ||
53 | /** | |
54 | * @param dataType the data type | |
55 | * @param hint the {@link Editor} component role hint | |
56 | * @param <D> the data type | |
57 | * @return an editor that can edit the specified data type and which has the given {@link Editor} component role | |
58 | * hint, or {@code null} if no such editor can be found | |
59 | */ | |
60 | <D> Editor<D> getEditor(Type dataType, String hint); | |
61 | ||
62 | /** | |
63 | * @param dataType the data type | |
64 | * @param <D> the data type | |
65 | * @return the configured default editor associated with the specified data type | |
66 | */ | |
67 | <D> Editor<D> getDefaultEditor(Type dataType); | |
68 | ||
69 | /** | |
70 | * @param dataType the data type | |
71 | * @param category the editor category | |
72 | * @param <D> the data type | |
73 | * @return the configured default editor that has the specified category and which is associated with the given data | |
74 | * type | |
75 | */ | |
76 | <D> Editor<D> getDefaultEditor(Type dataType, String category); | |
77 | } |