Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
SyntaxContentEditorConfiguration | 45 | 2 | 0% | 2 | 2 |
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.internal; | |
21 | ||
22 | import javax.inject.Inject; | |
23 | import javax.inject.Singleton; | |
24 | ||
25 | import org.xwiki.component.annotation.Component; | |
26 | import org.xwiki.edit.Editor; | |
27 | import org.xwiki.edit.EditorConfiguration; | |
28 | import org.xwiki.rendering.block.XDOM; | |
29 | import org.xwiki.rendering.syntax.SyntaxContent; | |
30 | ||
31 | /** | |
32 | * Custom configuration for {@link SyntaxContent} {@link Editor}s, which serves two roles: | |
33 | * <ul> | |
34 | * <li>preserves backward compatibility (because it looks for configuration properties that existed before the edit | |
35 | * module was written)</li> | |
36 | * <li>provides the default editor when there's no one configured</li> | |
37 | * </ul> | |
38 | * . | |
39 | * | |
40 | * @version $Id: b3ec8e6d41d7111cb8a2907cb5d6fa0368fbc5a3 $ | |
41 | * @since 8.2RC1 | |
42 | */ | |
43 | @Component | |
44 | @Singleton | |
45 | public class SyntaxContentEditorConfiguration implements EditorConfiguration<SyntaxContent> | |
46 | { | |
47 | @Inject | |
48 | private EditorConfiguration<XDOM> xdomEditorConfiguration; | |
49 | ||
50 | 0 | ![]() |
51 | public String getDefaultEditor() | |
52 | { | |
53 | 0 | return this.xdomEditorConfiguration.getDefaultEditor(); |
54 | } | |
55 | ||
56 | 429 | ![]() |
57 | public String getDefaultEditor(String category) | |
58 | { | |
59 | 429 | return this.xdomEditorConfiguration.getDefaultEditor(category); |
60 | } | |
61 | } |