def __init__(self, parent=None): """ Constructor @param parent parent widget of this lexer """ QsciLexerJava.__init__(self, parent) Lexer.__init__(self) self.commentString = "//" self.streamCommentString = {'start': '/* ', 'end': ' */'} self.boxCommentString = {'start': '/* ', 'middle': ' * ', 'end': ' */'}
def __init__(self, parent=None): """ Constructor @param parent parent widget of this lexer """ QsciLexerJava.__init__(self, parent) Lexer.__init__(self) self.commentString = "//" self.streamCommentString = {"start": "/* ", "end": " */"} self.boxCommentString = {"start": "/* ", "middle": " * ", "end": " */"}
def createCodeGroupBox(self, parent): yPos = const.GROUP_BOX_MARGIN_TOP width = AlgorithmDescDialog.WINDOW_WIDTH - const.PADDING * 4 box = WidgetUtil.createGroupBox(parent, title="代码实现", minSize=QSize(width, AlgorithmDescDialog.DESC_GROUP_BOX_HEIGHT)) # sizePolicy = WidgetUtil.createSizePolicy() splitter = WidgetUtil.createSplitter(box, geometry=QRect(const.PADDING, yPos, width - const.PADDING * 2, 330)) tabWidget = WidgetUtil.createTabWidget(splitter) if self.javaCode: tabWidget.addTab(self.createTabWidget(self.javaCode, QsciLexerJava()), "Java") if self.javaScriptCode: tabWidget.addTab(self.createTabWidget(self.javaScriptCode, QsciLexerJavaScript()), "JavaScript") if self.pythonCode: tabWidget.addTab(self.createTabWidget(self.pythonCode, QsciLexerPython()), "Python") if self.cCode: tabWidget.addTab(self.createTabWidget(self.cCode, QsciLexerCPP()), "C") if self.cppCode: tabWidget.addTab(self.createTabWidget(self.cppCode, QsciLexerCPP()), "C++") if self.swiftCode: tabWidget.addTab(self.createTabWidget(self.swiftCode, QsciLexerCPP()), "Swift") return box
def defaultKeywords(self, kwSet): """ Public method to get the default keywords. @param kwSet number of the keyword set (integer) @return string giving the keywords (string) or None """ return QsciLexerJava.keywords(self, kwSet)
def __init__(self, parent=None): """ Constructor @param parent parent widget of this lexer """ QsciLexerJava.__init__(self, parent) Lexer.__init__(self) self.commentString = "//" self.streamCommentString = { 'start': '/* ', 'end': ' */' } self.boxCommentString = { 'start': '/* ', 'middle': ' * ', 'end': ' */' }
def __init__(self, parent=None): """ Constructor @param parent parent widget of this lexer """ QsciLexerJava.__init__(self, parent) Lexer.__init__(self) self.commentString = "//" self.streamCommentString = {'start': '/* ', 'end': ' */'} self.boxCommentString = {'start': '/* ', 'middle': ' * ', 'end': ' */'} self.keywordSetDescriptions = [ self.tr("Primary keywords and identifiers"), self.tr("Secondary keywords and identifiers"), self.tr("Documentation comment keywords"), self.tr("Global classes and typedefs"), self.tr("Preprocessor definitions"), self.tr("Task marker and error marker keywords"), ]
def checkExtensionToHighlight(self, path, editor): _, extension = os.path.splitext(path) if extension == '.py': editor.setLexer(QsciLexerPython(self)) elif extension == '.html': editor.setLexer(QsciLexerHTML(self)) elif extension == '.java': editor.setLexer(QsciLexerJava(self)) elif extension == '.cs': editor.setLexer(QsciLexerCSharp(self)) elif extension == '.bat': editor.setLexer(QsciLexerBatch(self))