HTMLEditorKit() ajouter une action
J'ai créé un JTextpane auquel j'associe un HTMLEditor:
Code:
1 2 3 4 5 6 7
|
// new JTextpane
m_editor = new JTextPane();
m_kit = new HTMLEditorKit();
m_editor.setEditorKit(m_kit);
m_editor.setAutoscrolls(true);
m_editor.setCursor(new Cursor(Cursor.TEXT_CURSOR)); |
je sais passer la sélection en cours en gras par exemple:
Code:
1 2 3 4 5
|
// Set the Bold action
Action a = new HTMLEditorKit.BoldAction() ;
m_editor.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_B, Event.CTRL_MASK), "Bold");
m_editor.getActionMap().put("Bold", a); |
Maintenant, je souhaite faire sur la sélection une tâche qui n'est pas déjà dispo dans le HTMLEditor. Je veux pouvoir passer la sélecion en minuscules ou en majuscules.
Quelqu'un a t-il déjà réalisé cela ?
d'avance merci.