Source

jde / lisp / jde-gen.el

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
;;; jde-gen.el -- Integrated Development Environment for Java.
;; $Revision$ 

;; Author: Paul Kinnucan <paulk@mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools

;; Copyright (C) 1997, 1998, 2000, 2001 Paul Kinnucan.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; Gnu Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;

(require 'tempo)

(defgroup jde-gen nil
  "JDE Autocoder"
  :group 'jde
  :prefix "jde-gen-")

(defcustom jde-gen-k&r t
  "*If non-nil, use braces in Original Kerningham & Ritchie Style.
The Creators of C started using brace placement style:

    class Some {

    }

But there is also alternative line-up style

    class Some
    {

    }

Setting this variable to t, uses k&R style in skeletons and tempaltes."
  :group 'jde-gen
  :type  'boolean)

(defun jde-gen-lookup-named (name)
  "Lookup some saved data under the name NAME.
Returns the data if NAME was found, and nil otherwise."
  (cdr (assq name tempo-named-insertions)))

(defun jde-gen-read-template (strings)
  "Converts an autocode template represented as a list
of strings to a list of Lisp objects as required by
tempo."
  (let ((template-string "")
	(n (length strings))
	(i 0))
    (while (< i n)
      (setq template-string
		  (concat template-string " " (nth i strings)))
      (setq i (1+ i)))
      (setq template-string
	    (concat "'(" template-string ")"))
      (eval (car (read-from-string template-string)))))

(defcustom jde-gen-buffer-boilerplate nil
"*Lines of boilerplate text to put at the head of a buffer template."
  :group 'jde-gen
  :type '(repeat (string :tag "Line")))

(defcustom jde-gen-boilerplate-function 'jde-gen-create-buffer-boilerplate
"*Specifes buffer boilerplate text function.
This variable specifies a function to create boilerplate text for
insertion at the head of Java source buffers generated by JDE
templates. The specified function should take no arguments and should
return a text string.  The default value is
`jde-gen-create-buffer-boilerplate', which returns the lines of text
specified by `jde-gen-buffer-boilerplate'."
  :group 'jde-gen
  :type 'function)

(defun jde-gen-create-buffer-boilerplate ()
"This function creates buffer boilerplate from the
variable `jde-gen-buffer-boilerplate."
  (if jde-gen-buffer-boilerplate
      (let ((bp "")
	    (n (length jde-gen-buffer-boilerplate))
	    (i 0))
	(while (< i n)
	  (setq bp
		(concat bp (elt jde-gen-buffer-boilerplate i) "\n"))
	  (setq i (1+ i)))
	bp)))

(defun jde-gen-get-extend-class ()
  (let ((super-class (read-from-minibuffer "extends: ")))
    (if (not (string= super-class ""))
        (concat "extends " super-class " "))))

(defun jde-gen-get-interface-implementation ()
  (let ((interface (read-from-minibuffer "implements: ")))
    (if (not (string= interface ""))
        (let ((skeleton 
	       (jde-wiz-implement-interface-internal interface)))
          (if (string= 
	       skeleton 
	       "Error evaluating Java expresson. See *Messages* buffer.")
              ""
            skeleton)))))

(defun jde-gen-get-package-statement () 
  (let* ((package-dir (jde-package-get-package-directory))
	 (suggested-package-name
	  (if (or
	       (string= package-dir jde-package-unknown-package-name)
	       (string= package-dir ""))
	      nil
	    (jde-package-convert-directory-to-package package-dir)))
	 (package-name
	  (read-from-minibuffer "Package: " suggested-package-name)))
    (if (and
	 package-name
	 (not (string= package-name "")))
	(format "package %s;\n\n" package-name))))
    
	       

;;(makunbound 'jde-gen-class-buffer-template)
(defcustom jde-gen-class-buffer-template
  (list
    "(funcall jde-gen-boilerplate-function)"
    "(jde-gen-get-package-statement)"
    "\"/**\" '>'n"
    "\" * \""
    "(file-name-nondirectory buffer-file-name) '>'n"
    "\" *\" '>'n"
    "\" *\" '>'n"
    "\" * Created: \" (current-time-string) '>'n"
    "\" *\" '>'n"
    "\" * @author <a href=\\\"mailto:\" (eval user-mail-address) \"\\\">\" (user-full-name) \"</a>\"'>'n"
    "\" * @version\" '>'n"
    "\" */\" '>'n'"
    "'>'n"
    "\"public class \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "\" \" (jde-gen-get-extend-class)"

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"public \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "\" ()\""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'p'n"
    "\"}\">"
    "'>'n"
    "(jde-gen-get-interface-implementation)"
    "'>'n"
    "\"}\">"
    "\"// \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "'>'n")
  "*Template for new Java class.
Setting this variable defines a template instantiation
command `jde-gen-class', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-class
	    (tempo-define-template "java-class-buffer-template"
		       (jde-gen-read-template val)
                       nil
                       "Insert a generic Java class buffer skeleton."))
	  (set-default sym val)))

;;;###autoload
(defun jde-gen-class-buffer (file)
  "Create a new Java buffer containing a class of the same name.
This command inserts the class template generated by `jde-gen-class'.
It then moves the point to the location to the constructor."
  (interactive "F")
  (find-file file)
  (jde-gen-class)
  (beginning-of-buffer)
  (search-forward "{")
  (backward-char 1)
  (c-indent-exp)
  (tempo-forward-mark))


;;(makunbound 'jde-gen-console-buffer-template)
(defcustom jde-gen-console-buffer-template
  (list
    "(funcall jde-gen-boilerplate-function)"
    "(jde-gen-get-package-statement)"
    "\"/**\" '>'n"
    "\" * \""
    "(file-name-nondirectory buffer-file-name) '>'n"
    "\" *\" '>'n"
    "\" *\" '>'n"
    "\" * Created: \" (current-time-string) '>'n"
    "\" *\" '>'n"
    "\" * @author <a href=\\\"mailto:\" (eval user-mail-address) \"\\\">\" (user-full-name) \"</a>\"'>'n"
    "\" * @version\" '>'n"
    "\" */\" '>'n"
    "'>'n"
    "\"public class \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"public \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "\" ()\""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n"
    "\"}\"'>'n"
    "'>'n"
    "\"public static void main(String[] args)\""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'p'n"
    "\"}\"'>'n"
    "\"} // \"'>"
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "'>'n")
  "*Template for new Java console app main class buffer.
Setting this variable defines a template instantiation
command `jde-gen-console', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-console
	    (tempo-define-template "java-console-buffer-template"
		       (jde-gen-read-template val)
                       nil
                       "Insert skeleton for a new Java console buffer"))
	  (set-default sym val)))

;;;###autoload
(defun jde-gen-console-buffer (file)
  "Create a new Java buffer containing a console class of the same name.
This command inserts the class template generated by `jde-gen-class'.
It then moves the point to the location to the constructor."
  (interactive "F")
  (find-file file)
  (jde-gen-console)
  (beginning-of-buffer)
  (search-forward "{")
  (backward-char 1)
  (c-indent-exp)
  (tempo-forward-mark))


(defcustom jde-gen-jfc-app-buffer-template
  (list
    "(funcall jde-gen-boilerplate-function)"
    "(jde-gen-get-package-statement)"
    "\"import java.awt.Dimension;\" '>'n"
    "\"import java.awt.Graphics;\" '>'n"
    "\"import java.awt.Graphics2D;\" '>'n"
    "\"import java.awt.Color;\" '>'n"
    "\"import java.awt.geom.Ellipse2D;\" '>'n"
    "\"import java.awt.event.WindowAdapter;\" '>'n"
    "\"import java.awt.event.WindowEvent;\" '>'n"
    "\"import javax.swing.JFrame;\" '>'n"
    "\"import javax.swing.JPanel;\" '>'n"
    "\"import javax.swing.JScrollPane;\" '>'n"
    "\"import javax.swing.JMenuBar;\" '>'n"
    "\"import javax.swing.JMenu;\" '>'n"
    "\"import java.awt.event.ActionEvent;\" '>'n"
    "\"import javax.swing.AbstractAction;\" '>'n '>'n"
    "\"/**\" '>'n"
    "\" * \""
    "(file-name-nondirectory buffer-file-name) '>'n"
    "\" *\" '>'n"
    "\" *\" '>'n"
    "\" * Created: \" (current-time-string) '>'n"
    "\" *\" '>'n"
    "\" * @author <a href=\\\"mailto:\" (eval user-mail-address) \"\\\">\" (user-full-name) \"</a>\"'>'n"
    "\" * @version\" '>'n"
    "\" */\" '>'n"
    "'>'n"
    "\"public class \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "\" extends JFrame\""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"class Canvas extends JPanel\""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"public Canvas () \""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"setSize(getPreferredSize());\" '>'n"
    "\"Canvas.this.setBackground(Color.white);\" '>'n"
    "\"}\"'>'n '>'n"

    "\"public Dimension getPreferredSize() \""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"


    "\"return new Dimension(600, 600);\" '>'n"
    "\"}\"'>'n '>'n"

    "\"public void paintComponent(Graphics g) \""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"super.paintComponent(g);\" '>'n"
    "\"Graphics2D g2d = (Graphics2D) g;\" '>'n"
    "\"Ellipse2D circle = new Ellipse2D.Double(0d, 0d, 100d, 100d);\" '>'n"
    "\"g2d.setColor(Color.red);\" '>'n"
    "\"g2d.translate(10, 10);\" '>'n"
    "\"g2d.draw(circle);\" '>'n"
    "\"g2d.fill(circle);\" '>'n"
    "\"}\"'>'n "

    "\"}\"'>'n '>'n"


    ;; Constructor
    "\"public \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "\"()\""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"


    "\"super(\\\"\" (P \"Enter app title: \") \"\\\");\" '>'n"
    "\"setSize(300, 300);\" '>'n"
    "\"addWindowListener(new WindowAdapter() \""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"


    "\"public void windowClosing(WindowEvent e) {System.exit(0);}\" '>'n"
    "\"public void windowOpened(WindowEvent e) {}\" '>'n"
    "\"});\"'>'n"


    "\"setJMenuBar(createMenu());\" '>'n"
    "\"getContentPane().add(new JScrollPane(new Canvas()));\" '>'n"
    "\"}\"'>'n"
    "'>'n"

    ;; Main method
    "\"public static void main(String[] args) \""


    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n"
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "\" f = new \""
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "\"();\" '>'n"
    "\"f.show();\" '>'n"
    "\"}\"'>'n '>'n"
    ;; createMenu method
    "\"protected JMenuBar createMenu() \""


    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"


    "\"JMenuBar mb = new JMenuBar();\" '>'n"
    "\"JMenu menu = new JMenu(\\\"File\\\");\" '>'n"
    "\"menu.add(new AbstractAction(\\\"Exit\\\") \""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"


    "\"public void actionPerformed(ActionEvent e) \""

    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"


    "\"System.exit(0);\" '>'n"
    "\"}\" '>'n"
    "\"});\" '>'n"
    "\"mb.add(menu);\" '>'n"
    "\"return mb;\" '>'n"
    "\"}\"'>'n "
    "\"} // \"'>"
    "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
    "'>'n")
  "*Template for JFC (Swing) application buffer.
Setting this variable defines a template instantiation
command `jde-gen-jfc-app', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-jfc-app
	    (tempo-define-template "java-jfc-app-buffer-template"
		       (jde-gen-read-template val)
                       nil
                       "Insert skeleton for a JFC app buffer"))
	  (set-default sym val)))

;;;###autoload
(defun jde-gen-jfc-app-buffer (file)
  "Create a new Java buffer containing a JFC application class.
This command inserts the class template generated by `jde-gen-jfc-app'.
It then moves the point to the location to the constructor."
  (interactive "F")
  (find-file file)
  (jde-gen-jfc-app)
  (beginning-of-buffer)
  (search-forward "{")
  (backward-char 1)
  (c-indent-exp)
  (tempo-forward-mark))


(defcustom jde-gen-buffer-templates
  (list (cons "Class" 'jde-gen-class)
	(cons "Console" 'jde-gen-console)
	(cons "Swing App" 'jde-gen-jfc-app))
  "*Specifies available autocode templates for creating buffers.
The value of this variable is an association list. The car of
each element specifies the template's title. The cdr specifies
a command that inserts the template into a buffer. See the function
`tempo-define-template' for any easy way to create a template
insertion command."
  :group 'jde-gen
  :type '(repeat
	  (cons :tag "Template"
	   (string :tag "Title")
	   (function :tag "Command")))
  :set '(lambda (sym val)
	  (let ((n (length val))
		(i 0))
	    (setq jde-gen-buffer-template-names (list))
	    (while (< i n)
	      (setq jde-gen-buffer-template-names
		    (append
		     jde-gen-buffer-template-names
		     (list (cons (car (nth i val)) (1+ i)))))
	      (setq i (1+ i))))
	  (set-default sym val)))

;;;###autoload
(defun jde-gen-buffer (template file)
  "Create a new Java buffer containing a code template.
This command inserts the specified template at the beginning
of the buffer."
  (interactive
   (list (completing-read "Template: " jde-gen-buffer-template-names)
	 (read-file-name "File: ")))
  (find-file file)
  (funcall (cdr (assoc template jde-gen-buffer-templates)))
  (beginning-of-buffer)
  (search-forward "{")
  (backward-char 1)
  (c-indent-exp))

(defun jde-gen-init-cap (name)
  (concat (upcase (substring name 0 1)) (substring name 1)))


(defcustom jde-gen-get-set-var-template
  '(
    "(end-of-line) '&"
    "(P \"Variable type: \" type) \" \""
    "(P \"Variable name: \" name) \";\" '>'n '>'n"
    ;;we begin by the getter
    "\"/**\" '>'n"
    "\"* Get the value of \" (s name) \".\" '>'n"
    "\"* @return value of \" (s name) \".\" '>'n"
    "\"*/\" '>'n"
    "'>'\"public \" (s type)"
    ;;we must check type cause boolean getters
    ;;start with "is" not "get"
    "(if (string= \"boolean\" (jde-gen-lookup-named 'type) ) "
    "\" is\" "
    "\" get\" ) "
    "(jde-gen-init-cap (jde-gen-lookup-named 'name))"
    "\"() \""
    
    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\" '>'n"
 
    "\"return \" (s name) \";\" '>'n \"}\""
    "'>'n '>'n"
    ;;we continue with the setter
    "\"/**\" '>'n"
    "\"* Set the value of \" (s name) \".\" '>'n"
    "\"* @param v  Value to assign to \" (s name) \".\" '>'n"
    "\"*/\" '>'n"
    "'>'\"public void set\" (jde-gen-init-cap (jde-gen-lookup-named 'name))"
    "\"(\" (s type) \"  v) \" "

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\" '>'n"

    "'>'\"this.\" (s name) \" = v;\" '>'n \"}\" '>'n'>"
    )
  "*Template for creating a get/set method pair.
Setting this variable defines a template instantiation
command `jde-gen-get-set', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
   (defalias 'jde-gen-get-set
     (tempo-define-template
      "java-get-set-pair"
      (jde-gen-read-template val)
      nil
      "Insert variable get-set method pair."))
   (set-default sym val)))


(defcustom jde-gen-inner-class-template
  '(
    "(end-of-line) '& \"class \" (P \"Class name: \" class)"
     "\" \" (jde-gen-get-extend-class)"

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\" '>'n"

    "\"public \" (s class) \"() \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\"'>'n"

    "'>'n"
    "(jde-gen-get-interface-implementation)"
    "'>'n"

    "\"}\" '>'n'>"
    )
"*Template that creates an empty private class at point."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-inner-class-internal
	    (tempo-define-template
	     "java-inner-class"
	     (jde-gen-read-template val)
	     nil
	     "Insert inner class."))
	  (set-default sym val)))

(defun jde-gen-inner-class ()
  (interactive)
  (jde-gen-inner-class-internal)
  (goto-char (scan-lists (point) -1 0))
  (c-indent-exp))

(defcustom jde-gen-action-listener-template
  '(
    "'& (P \"Component name: \")"
    "\".addActionListener(new ActionListener() \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"public void actionPerformed(ActionEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\"'>'n \"});\"'>'n'>"
    )
  "*Template for generating an action listener.
Setting this variable defines a template instantiation
command, `jde-gen-action-listener', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-action-listener
	    (tempo-define-template
	     "java-action-listener"
	     (jde-gen-read-template val)
	     nil
	     "Insert skeleton action listener."))
	  (set-default sym val)))

(defcustom jde-gen-window-listener-template
  '(
    "(end-of-line) '& (P \"Window name: \")"
    "\".addWindowListener(new WindowAdapter() \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'> \"public void windowActivated(WindowEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\""
    "'>'n \"public void windowClosed(WindowEvent e)\""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n \"}\""
    "'>'n \"public void windowClosing(WindowEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n \"System.exit(0);\" '>'n \"}\""

    "'>'n \"public void windowDeactivated(WindowEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n \"}\""
    "'>'n \"public void windowDeiconified(WindowEvent e) \""
 
    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n \"}\""
    "'>'n \"public void windowIconified(WindowEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n \"}\""
    "'>'n \"public void windowOpened(WindowEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "'>'n \"}\""
    "'>'n \"});\" '>'n'>"
    )
  "*Template for generating a window listener.
Setting this variable defines a template instantiation
command, `jde-gen-window-listener', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-window-listener
	    (tempo-define-template
	     "java-window-listener"
	     (jde-gen-read-template val)
	     nil
	     "Insert skeleton window listener."))
	  (set-default sym val)))



(defcustom jde-gen-mouse-listener-template
  '(
    "(end-of-line) '& (P \"Component name: \")"
    "\".addMouseListener(new MouseAdapter() \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'> "

    "'>'n \"public void mouseClicked(MouseEvent e) \" "

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\" '>"
    "'>'n \"public void mouseEntered(MouseEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\" '>"
    "'>'n \"public void mouseExited(MouseEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\"'>"
    "'>'n \"public void mousePressed(MouseEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\" '>"
    "'>'n \"public void mouseReleased(MouseEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\"'>"
    "'>'n \"});\"'>'n'>"
    )
  "*Template for generating a mouse listener.
Setting this variable defines a template instantiation
command, `jde-gen-mouse-listener', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-mouse-listener
	    (tempo-define-template
	     "java-mouse-listener"
	     (jde-gen-read-template val)
	     nil
	     "Insert skeleton mouse listener."))
	  (set-default sym val)))

(defcustom jde-gen-mouse-motion-listener-template
  '(
    "(end-of-line) '& (P \"Component name: \")"
    "\".addMouseMotionListener(new MouseMotionAdapter() \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>"

    "'>'n \"public void mouseDragged(MouseEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\"'>"
    "'>'n \"public void mouseMoved(MouseEvent e) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"

    "\"}\"'>"
    "'>'n \"});\"'>'n'>"
    )
  "*Template for generating a mouse listener.
Setting this variable defines a template instantiation
command, `jde-gen-mouse-motion-listener', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-mouse-motion-listener
	    (tempo-define-template
	     "java-mouse-motion-listener"
	     (jde-gen-read-template val)
	     nil
	     "Insert skeleton mouse motion listener."))
	  (set-default sym val)))



(defcustom jde-gen-to-string-method-template
  '(
    "(end-of-line) '&"
    "\"public String toString() \""
    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
     "\"}\"'>'n'>"
    )
  "*Template for generating a toString method.
Setting this variable defines a template instantiation
command, `jde-gen-to-string-method', as a side-effect."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-to-string-method
	    (tempo-define-template
	     "toString method"
	     (jde-gen-read-template val)
	     nil
	     "Insert skeleton toString method."))
	  (set-default sym val)))

(defcustom  jde-gen-println
  '(
    "(end-of-line) '&"
    "\"System.out.println(\" (P \"Print out: \") \");\" '>'n'>"
   )
  "*Template for generating a System.out.println statement."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-println
	    (tempo-define-template
	     "println statement"
	     (jde-gen-read-template val)
	     nil
	     "Insert println statement."))
	  (set-default sym val)))

(defcustom  jde-gen-beep
  '(
    "(end-of-line) '&"
    "\"Toolkit.getDefaultToolkit().beep();\"'>'n'>"
   )
  "*Template for generating a Toolkit.getDefaultToolkit().beep() statement."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-beep
	    (tempo-define-template
	     "beep statement"
	     (jde-gen-read-template val)
	     nil
	     "Insert beep statement."))
	  (set-default sym val)))

(defcustom  jde-gen-property-change-support
  '(
    "(end-of-line) '&"

    "\"protected PropertyChangeSupport pcs =  new PropertyChangeSupport(this);\" '>'n '>'n"


    "\"/**\" '>'n"
    "\"* Adds a PropertyChangeListener to the listener list.\" '>'n"
    "\"* The listener is registered for all properties.\" '>'n"
    "\"*\" '>'n"
    "\"* @param listener The PropertyChangeListener to be added\" '>'n"
    "\"*/\" '>'n"
    "\"public void addPropertyChangeListener(PropertyChangeListener listener) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n"
    
    "\"pcs.addPropertyChangeListener(listener);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n"
    "\"* Removes a PropertyChangeListener from the listener list.\" '>'n"
    "\"* This removes a PropertyChangeListener that was registered for all properties.\" '>'n"
    "\"*\" '>'n "
    "\"* @param listener The PropertyChangeListener to be removed\" '>'n"
    "\"*/\" '>'n"
    "\"public void removePropertyChangeListener(PropertyChangeListener listener) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n"
    
    "'>\"pcs.removePropertyChangeListener(listener);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n\"* Adds a PropertyChangeListener for a specific property.\" '>'n"
    "\"* The listener will be invoked only when a call on firePropertyChange\" '>'n"
    "\"* names that specific property.\" '>'n"
    "\"*\" '>'n \"* @param propertyName The name of the property to listen on\" '>'n"
    "\"* @param listener The PropertyChangeListener to be added\" '>'n \"*/\" '>'n"
    "\"public void addPropertyChangeListener(String propertyName,\" '>'n"
    "\"PropertyChangeListener listener) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "'> \"pcs.addPropertyChangeListener(propertyName, listener);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n\"* Removes a PropertyChangeListener for a specific property.\" '>'n"
    "\"*\" '>'n \"* @param propertyName The name of the property that was listened on\" '>'n"
    "\"* @param listener The PropertyChangeListener to be removed\" '>'n \"*/\" '>'n"
    "\"public void removePropertyChangeListener(String propertyName,\" '>'n"
    "\"PropertyChangeListener listener) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "'> \"pcs.removePropertyChangeListener(propertyName, listener);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n\"* Reports a bound property update to any registered listeners. \" '>'n"
    "\"* No event is fired if old and new are equal and non-null.\" '>'n"
    "\"*\" '>'n \"* @param propertyName The programmatic name of the property that was changed\" '>'n"
    "\"* @param oldValue The old value of the property\" '>'n"
    "\"* @param newValue The new value of the property.\" '>'n \"*/\" '>'n"
    "\"public void firePropertyChange(String propertyName, Object oldValue, Object newValue) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "'> \"pcs.firePropertyChange(propertyName, oldValue, newValue);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n\"* Reports a bound property update to any registered listeners. \" '>'n"
    "\"* No event is fired if old and new are equal and non-null.\" '>'n"
    "\"* This is merely a convenience wrapper around the more general\" '>'n"
    "\"* firePropertyChange method that takes Object values.\" '>'n"
    "\"* No event is fired if old and new are equal and non-null.\" '>'n"
    "\"*\" '>'n \"* @param propertyName The programmatic name of the property that was changed\" '>'n"
    "\"* @param oldValue The old value of the property\" '>'n"
    "\"* @param newValue The new value of the property.\" '>'n \"*/\" '>'n"
    "\"public void firePropertyChange(String propertyName, int oldValue, int newValue) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "'> \"pcs.firePropertyChange(propertyName, oldValue, newValue);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n\"* Reports a bound property update to any registered listeners. \" '>'n"
    "\"* No event is fired if old and new are equal and non-null.\" '>'n"
    "\"* This is merely a convenience wrapper around the more general\" '>'n"
    "\"* firePropertyChange method that takes Object values.\" '>'n"
    "\"* No event is fired if old and new are equal and non-null.\" '>'n"
    "\"*\" '>'n \"* @param propertyName The programmatic name of the property that was changed\" '>'n"
    "\"* @param oldValue The old value of the property\" '>'n"
    "\"* @param newValue The new value of the property.\" '>'n \"*/\" '>'n"
    "\"public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "'> \"pcs.firePropertyChange(propertyName, oldValue, newValue);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n\"* Fires an existing PropertyChangeEvent to any registered listeners.\" '>'n"
    "\"* No event is fired if the given event's old and new values are equal and non-null. \" '>'n"
    "\"*\" '>'n \"* @param evt The PropertyChangeEvent object.\" '>'n\"*/\" '>'n"
    "\"public void firePropertyChange(PropertyChangeEvent evt) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "'> \"pcs.firePropertyChange(evt);\" '>'n \"}\" '>'n '>'n"

    "\"/**\" '>'n\"* Checks if there are any listeners for a specific property.\" '>'n"
    "\"*\" '>'n \"* @param evt The PropertyChangeEvent object.\" '>'n"
    "\"* @return <code>true</code>if there are one or more listeners for the given property\" '>'n"
    "\"*/\" '>'n"
    "\"public boolean hasListeners(String propertyName) \""

    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "'> \"return pcs.hasListeners(propertyName);\" '>'n \"}\" '>'n '>'n'>"
   )
  "*Template for adding property change support to a class."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-property-change-support
	    (tempo-define-template
	     "property change support template"
	     (jde-gen-read-template val)
	     nil
	     "Insert property change support template."))
	  (set-default sym val)))

(defcustom jde-gen-entity-bean-template
  '(
    "(jde-import-insert-imports-into-buffer (list \"javax.ejb.*\"
\"java.rmi.RemoteException\"))"
;;   "(jde-wiz-update-implements-clause \"EntityBean\")"
    "'> \"public void ejbActivate() throws RemoteException \""
    ;;we open the bracket according to k&r style or not
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "\"}\"'>'n '>'n"  
    "'> \"public void ejbPassivate() throws RemoteException \""
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "\"}\"'>'n '>'n"  

    "'> \"public void ejbLoad() throws RemoteException \""
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "\"}\"'>'n '>'n"  

    "'> \"public void ejbStore() throws RemoteException \""
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "\"}\"'>'n '>'n"  

    "'> \"public void ejbRemove() throws RemoteException \""
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "\"}\"'>'n '>'n"  

    "'> \"public void setEntityContext(EntityContext ctx) throws RemoteException \""
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "\"}\"'>'n '>'n"  

    "'> \"public void unsetEntityContext() throws RemoteException \""
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n"
    "\"}\"'>'n '>'n'>"  

    )
  "*Template that creates an empty implementation of an EJB Entity Bean."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-entity-bean
	    (tempo-define-template
	     "ejb-entity-bean"
	     (jde-gen-read-template val)
	     nil
	     "Insert EJB Entity Bean."))
	  (set-default sym val)))

(defcustom jde-gen-session-bean-template
  '(
    "(jde-import-insert-imports-into-buffer (list \"javax.ejb.*\"
\"java.rmi.RemoteException\"))"
    "(jde-wiz-update-implements-clause \"SessionBean\")"
    "'> \"public void ejbActivate() throws RemoteException {\"'>'n \"}\"'>'n
'>'n"
    "'> \"public void ejbPassivate() throws RemoteException {\"'>'n \"}\"'>'n
'>'n"
    "'> \"public void ejbRemove() throws RemoteException {\"'>'n \"}\"'>'n '>'n"
    "'> \"public void setSessionContext(SessionContext ctx) throws
RemoteException {\""
    "'>'n \"}\"'>'n '>'n"
    "'> \"public void unsetSessionContext() throws RemoteException {\"'>'n
\"}\"'>'n '>'n'>"
    )
  "*Template that creates an empty implementation of an EJB Session Bean."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (defalias 'jde-gen-session-bean
	    (tempo-define-template
	     "ejb-session-bean"
	     (jde-gen-read-template val)
	     nil
	     "Insert EJB Session Bean."))
	  (set-default sym val)))


(defcustom jde-gen-code-templates
  (list (cons "Get Set Pair" 'jde-gen-get-set)
	(cons "toString method" 'jde-gen-to-string-method)
	(cons "Action Listener" 'jde-gen-action-listener)
	(cons "Window Listener" 'jde-gen-window-listener)
	(cons "Mouse Listener" 'jde-gen-mouse-listener)
	(cons "Mouse Motion Listener" 'jde-gen-mouse-motion-listener)
	(cons "Inner Class" 'jde-gen-inner-class)
	(cons "println" 'jde-gen-println)
        (cons "beep" 'jde-gen-beep)
	(cons "property change support" 'jde-gen-property-change-support)
	(cons "EJB Entity Bean" 'jde-gen-entity-bean)
	(cons "EJB Session Bean" 'jde-gen-session-bean)
	)
  "*Specifies available autocode templates.
The value of this variable is an association list. The car of
each element specifies a template name. The cdr specifies
a command that inserts the template into a buffer. See the function
`tempo-define-template' for any easy way to create a template
insertion command."
  :group 'jde-gen
  :type '(repeat
	  (cons :tag "Template"
	   (string :tag "Name")
	   (function :tag "Command")))
  :set '(lambda (sym val)
	  (let ((n (length val))
		(i 0))
	    (setq jde-gen-template-names (list))
	    (while (< i n)
	      (setq jde-gen-template-names
		    (append
		     jde-gen-template-names
		     (list (cons (car (nth i val)) (1+ i)))))
	      (setq i (1+ i))))
	  (set-default sym val)))

(defun jde-gen-code (name)
  "Insert the code template specified by NAME at point.
The template must be one of those specified by the
variable `jde-gen-code-templates'."
  (interactive
   (list
    (completing-read "Template name: " jde-gen-template-names)))
  (funcall (cdr (assoc name jde-gen-code-templates))))



;;; Control Flow Templates
;;; Contributed by Eric D. Friedman <friedman@lmi.net>

(defvar jde-gen-abbrev-templates nil
  "List of abbreviation templates defined by
`jde-gen-define-abbrev-template'.")

(defun jde-gen-define-abbrev-template (abbrev template)
  "Defines a TEMPLATE that replaces ABBREV when you type ABBREV
in a JDE source buffer. TEMPLATE is a list of tempo template
elements. See `tempo-define-template' for information on
template elements. The resulting template is added to the
list bound to `jde-gen-abbrev-templates'. " 
  (tempo-define-template 
   (concat "jde-gen-" abbrev) 
   template abbrev "JDE abbreviation template." 'jde-gen-abbrev-templates))

(defcustom jde-gen-cflow-enable t
  "Enables abbreviations for Java control flow constructs."
  :group 'jde-gen
  :type 'boolean)


(defcustom jde-gen-comments t
  "*If no-nil, use comments, else do not use comments.
with comments:


      try 
      {
         


      } catch (Exception e) 
      {
         
      } // end of try-catch


witout comments:


      try 
      {
         


      } catch (Exception e) 
      {
         
      }


Setting this variable to t, uses comments in skeletons and templates."
  :group 'jde-gen
  :type 'boolean)

(defcustom jde-gen-cflow-if
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"if\")"
    "'(l '> \"if (\" (p \"if-clause: \" clause) \") \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"}\""
    "(if jde-gen-comments "
    "'(l \" // end of if (\" (s clause) \")\"))"
    "'>'n'>)"
    ")"
    )
  "Skeleton if statement. To insert the if statement at point, type if 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode'"
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "if"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-else
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"else\")"
    "'(l '> \"else \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of else\"'>'n'>)"
    ")"
   )
  "Skeleton else statement. To insert the statement at point, type else 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "else"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-if-else
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"ife\")"
    "'(l '> \"if (\" (p \"if-clause: \" clause) \") \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of if (\" (s clause) \")\"'> n"
    "'> \"else \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of if (\" (s clause) \")else\"'>'n'>)"
    ")"
   )
  "Skeleton if-else statement. To insert the statement at point, type ife 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "ife"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-else-if
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"eif\")"
    "'(l '> \"else if (\" (p \"else-if-clause: \" clause) \") \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of else if (\" (s clause) \")\"'> n)"
    ")"
   )
  "Skeleton else-if statement. To insert the statement at point, type eif 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "eif"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-while
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"while\")"
    "'(l '> \"while (\" (p \"while-clause: \" clause) \") \""
    "(if jde-gen-k&r "
     "()"
     "'>'n)"
     "\"{\"'>'n'>'r'n"
    "\"} // end of while (\" (s clause) \")\"'>'n'>)"
    ")"
   )
  "Skeleton while statement. To insert the statement at point, type while 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "while"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-for
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"for\")"
    "'(l '> \"for (\" (p \"for-clause: \" clause) \") \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of for (\" (s clause) \")\"'>'n'>)"
    ")"
   )
  "Skeleton for statement. To insert the statement at point, type for 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "for"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-for-i
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"fori\")"
    "'(l '> \"for (int \" (p \"variable: \" var) \" = 0; \""
    "(s var)"
    "\" < \"(p \"upper bound: \" ub)\"; \" (s var) \"++) \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of for (int \" (s var) \" = 0; \""
    "(s var) \" < \" (s ub) \"; \" (s var) \"++)\"'>'n'>)"
    ")"
  )
  "Skeleton for i statement. To insert the statement at point, type fori 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "fori"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-for-iter
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"foriter\")"
    "'(l '> \"for (Iterator \" (p \"variable: \" var) \" = \""
    "(p \"collection: \" coll) \".iterator(); \""
    "(s var) \".hasNext();\""
    "\")\""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "(s var) \".next();\" '>'n'>"
    "\"} // end of for (Iterator \" (s var) \" = \" (s coll) \".iterator(); \""
    "(s var) \".hasNext();)\"'>'n'>)"
    ")"
  )
  "Skeleton for iterator statement. To insert the statement at point,
type foriter and then space.  Note that abbrev mode must be
enabled. See `jde-enable-abbrev-mode' for more information.
Also, `tempo-interactive' must be set to a non-nil value."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
          (jde-gen-define-abbrev-template
             "foriter"
              (jde-gen-read-template val))
          (set-default sym val)))

(defcustom jde-gen-cflow-main
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"main\")"
    "'(l '> \"public static void main (String[] args) \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of main ()\"'>'n'>)"
    ")"       
  )
  "Skeleton main method. To insert the method at point, type main 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "main"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-switch
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"switch\")"
    "'(l '> \"switch (\" (p \"switch-condition: \" clause) \") \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'"
    "\"case \" (p \"first value: \") \":\"'>'n'>'p'n"
    "\"break;\"'>'n'>'p'n"
    "\"default:\"'>'n'>'p'n"
    "\"break;\"'>'n"
    "\"} // end of switch (\" (s clause) \")\"'>'n'>)"
    ")"
    )
  "Skeleton switch statement. To insert the statement at point, type switch 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "switch"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-case
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"case\")"
    "'(l 'n \"case \" (p \"value: \") \":\"'>'n'>'p'n"
    "\"break;\"'>'n'>'p)"
    ")"
    )
  "Skeleton case statement. To insert the statement at point, type case 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "case"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-try-catch
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"try\")"
    "'(l \"try \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} \""
    "'> \"catch (\" (p \"catch what: \" clause) \" e) \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of try-catch\"'>'n'>)"
    ")"
   )
  "Skeleton try-catch statement. To insert the statement at point, type try 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "try"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-catch
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"catch\")"
    "'(l '> \"catch (\" (p \"catch what: \" clause) \" e) \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of catch\"'>'n'>)"
    ")"
   )
  "Skeleton catch statement. To insert the statement at point, type catch 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "catch"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-try-finally
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"try\")"
    "'(l \"try \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"}\""
    "'> \"catch (\" (p \"catch what: \" clause) \" e) \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} \""
	"'> \"finally \""
	"(if jde-gen-k&r "
    "()"    
	"'>'n)" 
    "\"{\"'>'n'>'r'n"
    "\"} // end of try-finally\"'>'n'>)"
    ")"
   )
  "Skeleton try-catch-finally statement. To insert the statement at point, type 
tryf and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "tryf"
	     (jde-gen-read-template val))
	  (set-default sym val)))

(defcustom jde-gen-cflow-finally
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    "'(l \"finally\")"
    "'(l '> \"finally \""
    "(if jde-gen-k&r "
    "()"
    "'>'n)"
    "\"{\"'>'n'>'r'n"
    "\"} // end of finally\"'>'n'>)"
    ")"
   )
  "Skeleton finally statement. To insert the statement at point, type finally 
and then space. Note that abbrev mode must be enabled. See 
`jde-enable-abbrev-mode' for more information."
  :group 'jde-gen
  :type '(repeat string)
  :set '(lambda (sym val)
	  (jde-gen-define-abbrev-template
	     "finally"
	     (jde-gen-read-template val))
	  (set-default sym val)))


(defun jde-gen-load-abbrev-templates ()
  "Defines jde-mode abbrevs for the control flow templates."
  (loop for template in jde-gen-abbrev-templates do
	(define-abbrev 
	  local-abbrev-table 
	  (car template) "" (cdr template) 0)))

(provide 'jde-gen)

;; $Log$
;; Revision 1.38  2001/08/26 02:14:37  paulk
;; Fixed catch and tryf templates. Thanks to Javier Lopes.
;;
;; Revision 1.37  2001/06/30 12:35:28  paulk
;; Adds jde-gen-define-abbrev-template function.
;;
;; Revision 1.36  2001/06/10 04:07:05  paulk
;; Adds a control flow template for a for iterator loop. Thanks to Robert Mecklenburg <mecklen@cimsoft.com>.
;;
;; Revision 1.35  2001/06/05 05:33:10  paulk
;; Added else-f control flow template. Thanks to "Javier Lopez" <jlopez@cellexchange.com>.
;;
;; Revision 1.34  2001/06/05 04:54:49  paulk
;; Minor updates.
;;
;; Revision 1.33  2001/05/21 06:48:16  paulk
;; The class buffer template now generates skeletal implementations of interfaces that the class implements. Thanks to Javier Lopez for this enhancement.
;;
;; The inner class template now generates skeletal implementations of interfaces implemented by the class.
;;
;; Revision 1.32  2001/03/16 03:57:37  paulk
;; Fixed author line in javadoc comments. Thanks to Karel.Sprenger@compaq.com.
;;
;; Revision 1.31  2001/02/22 05:05:29  paulk
;; The class, console app, and Swing app templates now prompt you to enter a package name. The prompt includes a suggested package name based on the location of the current directory in the classpath.
;;
;; Revision 1.30  2001/01/19 04:28:09  paulk
;; Adds cflow expansions for try, catch, and finally. Thanks to Venkatesh Prasad Ranganath <rvprasad@ksu.edu> for these expansions.
;;
;; Revision 1.29  2000/12/18 05:22:45  paulk
;; *** empty log message ***
;;
;; Revision 1.28  2000/09/30 16:50:20  paulk
;; Correct type in jde-gen-cflow-enable.
;;
;; Revision 1.27  2000/09/07 04:37:28  paulk
;; Tweaked get-set pair template to indent correctly. Thanks to Lou Aloia <xlxa@rims.com> for this fix.
;;
;; Revision 1.26  2000/08/19 05:10:05  paulk
;; Adds jde-gen-cflow-enable variable.
;;
;; Revision 1.25  2000/07/23 02:44:44  paulk
;; Templates now indent correctly when inserted in a buffer. Thanks to el mono <mono@utp.edu.co> for this enhancement.
;;
;; Revision 1.24  2000/07/20 06:08:59  paulk
;; Extended K&R coding style to all templates. Thanks to Stephane Nicolas <s.nicolas@videotron.ca> for doing this.
;;
;; Revision 1.23  2000/06/28 02:46:48  paulk
;; Get/set pair template now generates correct method name for getting the value of boolean variables. Thanks to Stephane <s.nicolas@videotron.ca> for contributing this fix.
;;
;; Revision 1.22  2000/06/01 06:43:01  paulk
;; Added control flow templates contributed by Eric D. Friedman <friedman@lmi.net>.
;;
;; Revision 1.21  2000/02/01 05:22:51  paulk
;; Provide choice of coding styles for code generated by templates. Thanks to Jari Aalto for this enhancement.
;;
;; Revision 1.20  1999/09/23 03:23:41  paulk
;; Added code templates implementing EJB EntityBean and SessionBean
;; interfaces. Thanks to Brendan.Burns@tfsma-ims.tfn.com for contributing
;; the templates.
;;
;; Revision 1.19  1999/08/29 04:29:18  paulk
;; Patches provided by Michael Ernst <mernst@alum.mit.edu>
;;
;; Revision 1.18  1999/02/11 17:03:00  paulk
;; Updated the Swing application template to the JDK 1.2 Swing package
;; scheme and expanded the template to provide a menu and scrollable
;; canvas.
;;
;; Revision 1.17  1998/09/16 22:55:51  paulk
;; Added template for Java bean property change support.
;;
;; Revision 1.16  1998/09/13 00:34:28  paulk
;; Added a template for generating a System.out.println statement.
;;
;; Revision 1.15  1998/07/22 00:28:04  paulk
;; Modified class buffer creation templates to use tempo-marks
;; to mark initial position for user to insert code. Thanks
;; to David Hull <david.hull@trw.com> for suggesting this.
;;
;; Revision 1.14  1998/07/06 06:39:42  paulk
;; class buffer template now prompts for super class and
;; interface
;;
;; Revision 1.13  1998/07/06 05:06:13  paulk
;; Added boilerlate to other buffer generation templates.
;;
;; Revision 1.12  1998/07/01 03:54:40  paulk
;; Added source file boilerplate support.
;;
;; Revision 1.11  1998/06/27 03:04:46  paulk
;; Fixed capitalization on get-set method pair. Thanks to Jere_McDevitt@HomeDepot.COM
;;
;; Revision 1.10  1998/06/17 03:49:21  paulk
;; Fixed bug that caused jfc-app to be generated instead of console app.
;; Added a mouse motion listener template.
;; Added a toString method template.
;;
;; Revision 1.9  1998/05/27 05:55:20  paulk
;; Added autoload comments.
;;
;; Revision 1.8  1998/05/27 05:51:20  paulk
;; *** empty log message ***
;;
;; Revision 1.7  1998/05/17 06:20:37  paulk
;; Added templates for a Swing application and an inner class.
;;
;; Fixed a bug in jde-gen-buffer
;;
;; Revision 1.6  1998/04/18 14:08:55  kinnucan
;; Fixes some bugs in the generated code.
;;
;; Revision 1.5  1998/04/10 02:55:00  kinnucan
;; * Updated some of the doc strings.
;;
;; Revision 1.4  1998/04/09 04:51:09  kinnucan
;; * Added the capability to define your own custom autocode templates.
;;   The facility consists of the following items:
;;
;;   - jde-gen-code-templates
;;
;;     Defines a list of templates for code inserted at point. The
;;     list by default contains the templates defined by the JDE.
;;     You can define your own templates and add them to the list,
;;     using the Emacs customization feature. See tempo.el for
;;     information on creating templates.
;;
;;   - jde-gen-buffer-templates
;;
;;     Defines a list of templates for code to be inserted in a
;;     newly created Java buffer.
;;
;;   - jde-gen-code (JDE->Generate->Custom)
;;
;;     This command inserts a specified code template at point.
;;
;;   - jde-gen-buffer (Files->JDE New->Custom)
;;
;;     This command creates the specified buffer and inserts
;;     a specified template at the beginning of the buffer.
;;
;; Revision 1.3  1998/04/08 04:38:16  kinnucan
;; * Provided each template variable with a set function that regenerates
;;   the corresponding template command whenever the template is changed.
;;
;; Revision 1.2  1998/04/06 03:47:20  kinnucan
;; * Added jde-gen-class-buffer and jde-gen-console-buffer functions.
;;
;; Revision 1.1  1998/04/01 05:33:43  kinnucan
;; Initial revision
;;

;; End of jde-gen.el