File tree Expand file tree Collapse file tree
src/com/github/zoliszabo/netbeans/quickinsert Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- build.xml.data.CRC32 =43fc1f1b
1+ build.xml.data.CRC32 =6e79f9f7
22build.xml.script.CRC32 =3fa314a7
33build.xml.stylesheet.CRC32 =15ca8a54@2.75.1
44# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
55# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6- nbproject/build-impl.xml.data.CRC32 =43fc1f1b
6+ nbproject/build-impl.xml.data.CRC32 =6e79f9f7
77nbproject/build-impl.xml.script.CRC32 =8f8bb75c
88nbproject/build-impl.xml.stylesheet.CRC32 =49aa68b0@2.75.1
Original file line number Diff line number Diff line change 66 <code-name-base >com.github.zoliszabo.netbeans.quickinsert</code-name-base >
77 <standalone />
88 <module-dependencies >
9+ <dependency >
10+ <code-name-base >org.netbeans.modules.editor.lib2</code-name-base >
11+ <build-prerequisite />
12+ <compile-dependency />
13+ <run-dependency >
14+ <release-version >1</release-version >
15+ <specification-version >2.21.1.55.3</specification-version >
16+ </run-dependency >
17+ </dependency >
918 <dependency >
1019 <code-name-base >org.openide.awt</code-name-base >
1120 <build-prerequisite />
Original file line number Diff line number Diff line change 77
88import java .awt .event .ActionEvent ;
99import java .awt .event .ActionListener ;
10+ import javax .swing .text .BadLocationException ;
11+ import javax .swing .text .JTextComponent ;
12+ import org .netbeans .api .editor .EditorRegistry ;
1013import org .openide .awt .ActionID ;
1114import org .openide .awt .ActionReference ;
1215import org .openide .awt .ActionReferences ;
1316import org .openide .awt .ActionRegistration ;
17+ import org .openide .util .Exceptions ;
1418import org .openide .util .NbBundle .Messages ;
1519
1620@ ActionID (
@@ -31,6 +35,13 @@ public final class InsertCurrentTimestamp implements ActionListener {
3135
3236 @ Override
3337 public void actionPerformed (ActionEvent e ) {
34- // TODO implement action body
38+ JTextComponent lastFocusedEditor = EditorRegistry .lastFocusedComponent ();
39+ if (lastFocusedEditor != null ) {
40+ try {
41+ lastFocusedEditor .getDocument ().insertString (lastFocusedEditor .getCaretPosition (), "ABCD" , null );
42+ } catch (BadLocationException ex ) {
43+ Exceptions .printStackTrace (ex );
44+ }
45+ }
3546 }
3647}
You can’t perform that action at this time.
0 commit comments