QScintilla/Editor.py

changeset 1196
77da430b4080
parent 1169
36a3bb21e6e6
child 1295
b3db3070d104
--- a/QScintilla/Editor.py	Sun Jul 24 15:25:42 2011 +0200
+++ b/QScintilla/Editor.py	Sun Jul 24 19:22:40 2011 +0200
@@ -1689,7 +1689,23 @@
                 return True
         
         return False
-        
+    
+    def isPreviewable(self):
+        """
+        Public method to check, if the contents of the file is previewable in
+        a web browser.
+        
+        @return flag indicating a previewable file (boolean)
+        """
+        if self.fileName is not None and \
+           os.path.splitext(self.fileName)[1][1:] in Preferences.getEditor(
+            "PreviewableFileNameExtensions"):
+            return True
+        elif self.getLanguage() == "HTML":
+            return True
+        else:
+            return False
+    
     def highlightVisible(self):
         """
         Public method to make sure that the highlight is visible.

eric ide

mercurial