Preferences/PreferencesLexer.py

changeset 6878
79008f970902
parent 6866
b792455b35cd
diff -r da5d6c7d5348 -r 79008f970902 Preferences/PreferencesLexer.py
--- a/Preferences/PreferencesLexer.py	Mon Mar 18 19:07:10 2019 +0100
+++ b/Preferences/PreferencesLexer.py	Mon Mar 18 19:15:57 2019 +0100
@@ -114,6 +114,7 @@
         
         @return list of tuples each containing the description of the style,
             style number and sub-style number (or -1 for no sub-style)
+        @rtype list of tuples of (str, int, int)
         """
         styles = []
         
@@ -129,6 +130,25 @@
         
         return styles
     
+    def getSubStyles(self, style):
+        """
+        Public method to get a list of all sub-styles of a style.
+        
+        @param style style number
+        @type int
+        @return list of tuples each containing the description of the style,
+            style number and sub-style number (or -1 for no sub-style)
+        @rtype list of tuples of (str, int, int)
+        """
+        styles = []
+        
+        if self.isBaseStyle(style):
+            for subStyle in range(self.__lex.substylesCount(style)):
+                desc = self.__lex.substyleDescription(style, subStyle)
+                styles.append((desc, style, subStyle))
+        
+        return styles
+    
     def defaultColor(self, style, substyle=-1):
         """
         Public method to get the default color of a style.
@@ -501,3 +521,12 @@
         @rtype bool
         """
         return self.__lex.delSubstyle(style, substyle)
+    
+    def loadDefaultSubStyles(self, style):
+        """
+        Public method to load the default sub-styles for a given base style.
+        
+        @param style style number
+        @type int
+        """
+        self.__lex.loadDefaultSubStyles(style)

eric ide

mercurial