Open GoogleCodeExporter opened 9 years ago
ok... got it, but I had to read quite a bit of code, we should still create a
sample.
here's the code, in scala (sorry):
------- 1. make your action classes, that do your stuff:
class F9RunCompletionAction extends DefaultSyntaxAction ("RAZIE_F9ACTION") {
override def actionPerformed(target:JTextComponent , sDoc:SyntaxDocument , dot:Int
, e:ActionEvent ) {
SPRaz.sp.runline
}
}
---------- 2. register them, before you create the panel:
DefaultSyntaxKit.getConfig (classOf[DefaultSyntaxKit]).put
("Action.RAZIE_F9ACTION","razie.draw.swing.F9RunCompletionAction,F9");
-------- 3. when setting up the pane (copy from the main test clas) add the
actions:
defaultSyntaxKit.addActions(jEdtTest);
...the surrounding code here is:
EditorKit kit = jEdtTest.getEditorKit();
if (kit instanceof DefaultSyntaxKit) {
DefaultSyntaxKit defaultSyntaxKit = (DefaultSyntaxKit) kit;
defaultSyntaxKit.addToolBarActions(jEdtTest, jToolBar1);
defaultSyntaxKit.addActions(jEdtTest);
}
cheers
Original comment by razvanc99@gmail.com
on 9 Mar 2010 at 9:23
Original issue reported on code.google.com by
razvanc99@gmail.com
on 9 Mar 2010 at 7:40