View Javadoc
1   /**
2    * This file Copyright (c) 2010-2018 Magnolia International
3    * Ltd.  (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10   * This file is distributed in the hope that it will be
11   * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12   * implied warranty of MERCHANTABILITY or FITNESS FOR A
13   * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14   * Redistribution, except as permitted by whichever of the GPL
15   * or MNA you select, is prohibited.
16   *
17   * 1. For the GPL license (GPL), you can redistribute and/or
18   * modify this file under the terms of the GNU General
19   * Public License, Version 3, as published by the Free Software
20   * Foundation.  You should have received a copy of the GNU
21   * General Public License, Version 3 along with this program;
22   * if not, write to the Free Software Foundation, Inc., 51
23   * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24   *
25   * 2. For the Magnolia Network Agreement (MNA), this file
26   * and the accompanying materials are made available under the
27   * terms of the MNA which accompanies this distribution, and
28   * is available at http://www.magnolia-cms.com/mna.html
29   *
30   * Any modifications to this file must keep this entire header
31   * intact.
32   *
33   */
34  package info.magnolia.ui.form.field.definition;
35  
36  /**
37   * Field definition for a rich-text field.
38   *
39   * @deprecated since 6.2 - use {@link info.magnolia.ui.field.RichTextFieldDefinition} instead.
40   *
41   * @see <a href="https://documentation.magnolia-cms.com/display/DOCS62/Upgrading+to+Magnolia+6.2.x">Upgrading to Magnolia 6.2.x</a>
42   */
43  @Deprecated
44  public class RichTextFieldDefinition extends ConfiguredFieldDefinition {
45  
46      private boolean alignment;
47      private boolean images;
48      private boolean lists = true;
49      private boolean source;
50      private boolean tables;
51  
52      private long height;
53  
54      private String colors;
55      private String fonts;
56      private String fontSizes;
57  
58      private String configJsFile;
59  
60      /**
61       * Defines whether text alignment (left, center, right, justify) is allowed in this rich-text field.
62       *
63       * @return <code>true</code> if alignment is enabled, <code>false</code> otherwise. Defaults to <code>false</code>.
64       */
65      public boolean isAlignment() {
66          return alignment;
67      }
68  
69      public void setAlignment(boolean alignment) {
70          this.alignment = alignment;
71      }
72  
73      /**
74       * Defines whether images are allowed in this rich-text field.
75       *
76       * @return <code>true</code> if images are enabled, <code>false</code> otherwise. Defaults to <code>false</code>.
77       */
78      public boolean isImages() {
79          return images;
80      }
81  
82      public void setImages(boolean images) {
83          this.images = images;
84      }
85  
86      /**
87       * Defines whether lists are allowed in this rich-text field.
88       *
89       * @return <code>true</code> if lists are enabled, <code>false</code> otherwise. Defaults to <code>true</code>.
90       */
91      public boolean isLists() {
92          return lists;
93      }
94  
95      public void setLists(boolean lists) {
96          this.lists = lists;
97      }
98  
99      /**
100      * Defines whether source mode is allowed in this rich-text field.
101      *
102      * @return <code>true</code> if source mode is enabled, <code>false</code> otherwise. Defaults to <code>false</code>.
103      */
104     public boolean isSource() {
105         return source;
106     }
107 
108     public void setSource(boolean source) {
109         this.source = source;
110     }
111 
112     /**
113      * Defines whether tables are allowed in this rich-text field.
114      *
115      * @return <code>true</code> if tables are enabled, <code>false</code> otherwise. Defaults to <code>true</code>.
116      */
117     public boolean isTables() {
118         return tables;
119     }
120 
121     public void setTables(boolean tables) {
122         this.tables = tables;
123     }
124 
125     /**
126      * Defines the height of this rich-text field, in pixels.
127      */
128     public long getHeight() {
129         return height;
130     }
131 
132     public void setHeight(long height) {
133         this.height = height;
134     }
135 
136     /**
137      * Defines the text colors that are allowed in this rich-text field.
138      *
139      * @return a comma separated list of colors, as per CKEditor documentation (hexadecimal codes, without leading hash).
140      * @see <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-colorButton_colors">http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-colorButton_colors</a>
141      */
142     public String getColors() {
143         return colors;
144     }
145 
146     public void setColors(String colors) {
147         this.colors = colors;
148     }
149 
150     /**
151      * Defines the font families that are allowed in this rich-text field.
152      *
153      * @return a semi-colon separated list of font names, as per CKEditor documentation.
154      * @see <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-font_names">http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-font_names</a>
155      */
156     public String getFonts() {
157         return fonts;
158     }
159 
160     public void setFonts(String fonts) {
161         this.fonts = fonts;
162     }
163 
164     /**
165      * Defines the font sizes that are allowed in this rich-text field.
166      *
167      * @return a semi-colon separated list of font sizes, as per CKEditor documentation (including CSS unit).
168      * @see <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-fontSize_sizes">http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-fontSize_sizes</a>
169      */
170     public String getFontSizes() {
171         return fontSizes;
172     }
173 
174     public void setFontSizes(String fontSizes) {
175         this.fontSizes = fontSizes;
176     }
177 
178     /**
179      * Defines the custom configuration file for this rich-text field.
180      *
181      * @return a path to the config JavaScript file, relative to context path.
182      */
183     public String getConfigJsFile() {
184         return configJsFile;
185     }
186 
187     public void setConfigJsFile(String configJsFile) {
188         this.configJsFile = configJsFile;
189     }
190 }