Home | Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2012 Vaadin Ltd. 2 # Copyright (C) 2012 Richard Lincoln 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 from muntjac.ui.text_field import TextField 17 18 from muntjac.addon.codemirror.client.code_mode import CodeMode 19 from muntjac.addon.codemirror.client.code_theme import CodeTheme 20 2123 """Server side component for the VCodeMirrorTextField2 widget.""" 24 25 CLIENT_WIDGET = None #ClientWidget(VCodeMirror) 26 27 TYPE_MAPPING = 'org.vaadin.codemirror2.CodeMirror' 288330 if codeMode is None: 31 codeMode = CodeMode.TEXT 32 33 if codeTheme is None: 34 codeTheme = CodeTheme.DEFAULT 35 36 self._codeStyle = None 37 self._showLineNumbers = False 38 self._codeTheme = None 39 40 super(CodeMirror, self).__init__(caption) 41 42 self.setCodeMode(codeMode) 43 self.setCodeTheme(codeTheme)44 4547 super(CodeMirror, self).paintContent(target) 48 49 if self.getCodeMode() is not None: 50 target.addAttribute('codeMode', self.getCodeMode().getId()) 51 52 target.addAttribute('showLineNumbers', self.isShowLineNumbers()) 53 54 if self.getCodeTheme() is not None: 55 target.addAttribute('codeTheme', self.getCodeTheme().getId())56 57 61 62 65 66 70 71 74 75 79 80
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jun 10 22:40:35 2015 | http://epydoc.sourceforge.net |