1 19 20 25 26 package org.netbeans.modules.css.editor; 27 28 import org.netbeans.modules.css.actions.CssRuleCreateAction; 29 import java.awt.Component ; 30 import javax.swing.Action ; 31 import javax.swing.JEditorPane ; 32 import javax.swing.text.Document ; 33 import javax.swing.text.TextAction ; 34 import org.netbeans.modules.editor.NbEditorDocument; 35 import org.netbeans.modules.languages.dataobject.LanguagesEditorKit; 36 37 42 public class CssEditorKit extends LanguagesEditorKit { 43 44 public static final String CSS_MIME_TYPE = "text/x-css"; 46 public static final String createRuleAction = "create-rule"; 48 49 public CssEditorKit() { 50 super(CSS_MIME_TYPE); 51 } 52 53 public Document createDefaultDocument() { 54 Document doc = new NbEditorDocument(getClass()){ 55 public Component createEditor(JEditorPane editorPane) { 56 return new CssCustomEditor(editorPane); 57 } 58 }; 59 schliemanizeDocument(doc); return doc; 61 } 62 63 66 public String getContentType() { 67 return CSS_MIME_TYPE; 68 } 69 70 protected Action[] createActions() { 71 Action[] cssEditorActions = new Action[] { 72 new CssRuleCreateAction() 73 }; 74 return TextAction.augmentList(super.createActions(), cssEditorActions); 75 } 76 77 public Object clone () { 78 return new CssEditorKit (); 79 } 80 } 81 | Popular Tags |