Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 89183dc34fbcf9a5550d1bfaf9e2477247b4187e (plain) (blame)
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
/*******************************************************************************
 * Copyright (c) 2003, 2009 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui.actions;

import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IAction;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.internal.CloseAllSavedAction;
import org.eclipse.ui.internal.IWorkbenchGraphicConstants;
import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
import org.eclipse.ui.internal.IntroAction;
import org.eclipse.ui.internal.NavigationHistoryAction;
import org.eclipse.ui.internal.ToggleEditorsVisibilityAction;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.internal.actions.CommandAction;
import org.eclipse.ui.internal.actions.DynamicHelpAction;
import org.eclipse.ui.internal.actions.HelpContentsAction;
import org.eclipse.ui.internal.actions.HelpSearchAction;

/**
 * Access to standard actions provided by the workbench.
 * <p>
 * Most of the functionality of this class is provided by static methods and
 * fields. Example usage:
 * 
 * <pre>
 * MenuManager menu = ...;
 * ActionFactory.IWorkbenchAction closeEditorAction
 *    = ActionFactory.CLOSE.create(window);
 * menu.add(closeEditorAction);
 * </pre>
 * </p>
 * <p>
 * Clients may declare other classes that provide additional application-specific
 * action factories.
 * </p>
 * 
 * @since 3.0
 */
public abstract class ActionFactory {

    /**
     * Interface for a workbench action.
     */
    public interface IWorkbenchAction extends IAction {
        /**
         * Disposes of this action. Once disposed, this action cannot be used.
         * This operation has no effect if the action has already been
         * disposed.
         */
        public void dispose();
    }
    
    private static class WorkbenchCommandAction extends CommandAction implements
			IWorkbenchAction {
		/**
		 * @param commandIdIn
		 * @param window
		 */
		public WorkbenchCommandAction(String commandIdIn,
				IWorkbenchWindow window) {
			super(window, commandIdIn);
		}
	}

	/**
	 * Workbench action (id: "about", commandId: "org.eclipse.ui.help.aboutAction"): Displays the
	 * About dialog. This action maintains its enablement state.
	 */
    public static final ActionFactory ABOUT = new ActionFactory("about", //$NON-NLS-1$
    		IWorkbenchCommandConstants.HELP_ABOUT) {

		/*
		 * (non-Javadoc)
		 * 
		 * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
		 */
		public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}

			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);

			action.setId(getId());
			IProduct product = Platform.getProduct();
			String productName = null;
			if (product != null) {
				productName = product.getName();
			}
			if (productName == null) {
				productName = ""; //$NON-NLS-1$
			}

			action.setText(NLS.bind(WorkbenchMessages.AboutAction_text,
					productName));
			action.setToolTipText(NLS.bind(
					WorkbenchMessages.AboutAction_toolTip, productName));
			window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.ABOUT_ACTION);
			return action;
		}
	};

	/**
	 * Workbench action (id: "activateEditor", commandId: "org.eclipse.ui.window.activateEditor"):
	 * Activate the most recently used editor. This action maintains its enablement state.
	 */
    public static final ActionFactory ACTIVATE_EDITOR = new ActionFactory(
            "activateEditor", IWorkbenchCommandConstants.WINDOW_ACTIVATE_EDITOR) {//$NON-NLS-1$
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
			action.setId(getId());
			action.setText(WorkbenchMessages.ActivateEditorAction_text);
			action
					.setToolTipText(WorkbenchMessages.ActivateEditorAction_toolTip);
			return action;
		}
    };

	/**
	 * Workbench action (id: "back", commandId: "org.eclipse.ui.navigate.back"): Back. This action
	 * is a {@link RetargetAction} with id "back". This action maintains its enablement state.
	 */
    public static final ActionFactory BACK = new ActionFactory("back", //$NON-NLS-1$
    		IWorkbenchCommandConstants.NAVIGATE_BACK) {
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new LabelRetargetAction(getId(), WorkbenchMessages.Workbench_back);
            action.setToolTipText(WorkbenchMessages.Workbench_backToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "backardHistory", commandId: "org.eclipse.ui.navigate.backwardHistory"):
	 * Backward in the navigation history. This action maintains its enablement state.
	 */
    public static final ActionFactory BACKWARD_HISTORY = new ActionFactory(
            "backardHistory", IWorkbenchCommandConstants.NAVIGATE_BACKWARD_HISTORY) {//$NON-NLS-1$
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new NavigationHistoryAction(window, false);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "close", commandId: "org.eclipse.ui.file.close"): Close the active
	 * editor. This action maintains its enablement state.
	 */
    public static final ActionFactory CLOSE = new ActionFactory("close",//$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_CLOSE) {
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.CloseEditorAction_text);
            action.setToolTipText(WorkbenchMessages.CloseEditorAction_toolTip);
            return action;
        }
    };

	/**
	 * Workbench action (id: "closeAll", commandId: "org.eclipse.ui.file.closeAll"): Close all open
	 * editors. This action maintains its enablement state.
	 */
    public static final ActionFactory CLOSE_ALL = new ActionFactory("closeAll",//$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_CLOSE_ALL) {
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.CloseAllAction_text);
            action.setToolTipText(WorkbenchMessages.CloseAllAction_toolTip);
            return action;
        }
    };

	/**
	 * Workbench action (id: "closeOthers", commandId: "org.eclipse.ui.file.closeOthers"): Close all
	 * editors except the one that is active. This action maintains its enablement state.
	 * 
	 * @since 3.2
	 */
    public static final ActionFactory CLOSE_OTHERS = new ActionFactory("closeOthers",//$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_CLOSE_OTHERS) {
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
			action.setId(getId());
			action.setText(WorkbenchMessages.CloseOthersAction_text);
			action.setToolTipText(WorkbenchMessages.CloseOthersAction_toolTip);
			return action;
        }
    };

	/**
	 * Workbench action (id: "closeAllPerspectives", commandId: "org.eclipse.ui.window.closeAllPerspectives"):
	 * Closes all perspectives. This action maintains its enablement state.
	 */
    public static final ActionFactory CLOSE_ALL_PERSPECTIVES = new ActionFactory(
            "closeAllPerspectives", IWorkbenchCommandConstants.WINDOW_CLOSE_ALL_PERSPECTIVES) {//$NON-NLS-1$
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            
            action.setId(getId());
            action.setText(WorkbenchMessages.CloseAllPerspectivesAction_text);
            action.setToolTipText(WorkbenchMessages.CloseAllPerspectivesAction_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CLOSE_ALL_PAGES_ACTION);
            
            return action;
        }
    };

	/**
	 * Workbench action (id: "closeAllSaved"): Close all open editors except those with unsaved
	 * changes. This action maintains its enablement state.
	 */
    public static final ActionFactory CLOSE_ALL_SAVED = new ActionFactory(
            "closeAllSaved") {//$NON-NLS-1$
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new CloseAllSavedAction(window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "closePerspective", commandId: "org.eclipse.ui.window.closePerspective"):
	 * Closes the current perspective. This action maintains its enablement state.
	 */
    public static final ActionFactory CLOSE_PERSPECTIVE = new ActionFactory(
    "closePerspective", IWorkbenchCommandConstants.WINDOW_CLOSE_PERSPECTIVE) {//$NON-NLS-1$
    	/*
    	 * (non-Javadoc)
    	 * 
    	 * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
    	 */
    	public IWorkbenchAction create(IWorkbenchWindow window) {
    		if (window == null) {
    			throw new IllegalArgumentException();
    		}
    		WorkbenchCommandAction action = new WorkbenchCommandAction(
    				getCommandId(), window);

    		action.setId(getId());
    		action.setText(WorkbenchMessages.
    				ClosePerspectiveAction_text);
    		action.setToolTipText(WorkbenchMessages.
    				ClosePerspectiveAction_toolTip);
    		window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.CLOSE_PAGE_ACTION);
    		return action;
    	}
    };

	/**
	 * Workbench action (id: "intro", commandId: "org.eclipse.ui.help.quickStartAction"): Activate
	 * the introduction extension. This action should not be instantiated if no intro is provided.
	 * Use code like:
	 * 
	 * <pre>
	 * if (window.getWorkbench().getIntroManager().hasIntro()) {
	 * 	introAction= ActionFactory.INTRO.create(window);
	 * 	register(introAction);
	 * }
	 * </pre>
	 */
    public static final ActionFactory INTRO = new ActionFactory("intro", //$NON-NLS-1$
    		IWorkbenchCommandConstants.HELP_WELCOME) {
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new IntroAction(window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "copy", commandId: "org.eclipse.ui.edit.copy"): Copy. This action is a
	 * {@link RetargetAction} with id "copy". This action maintains its enablement state.
	 */
    public static final ActionFactory COPY = new ActionFactory("copy", //$NON-NLS-1$
    		IWorkbenchCommandConstants.EDIT_COPY) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_copy);
            action.setToolTipText(WorkbenchMessages.Workbench_copyToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            ISharedImages sharedImages = window.getWorkbench()
                    .getSharedImages();
            action.setImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
            action.setDisabledImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "cut", commandId: "org.eclipse.ui.edit.cut"): Cut. This action is a
	 * {@link RetargetAction} with id "cut". This action maintains its enablement state.
	 */
    public static final ActionFactory CUT = new ActionFactory("cut", //$NON-NLS-1$
    		IWorkbenchCommandConstants.EDIT_CUT) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_cut);
            action.setToolTipText(WorkbenchMessages.Workbench_cutToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            ISharedImages sharedImages = window.getWorkbench()
                    .getSharedImages();
            action.setImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
            action.setDisabledImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "delete", commandId: "org.eclipse.ui.edit.delete"): Delete. This action
	 * is a {@link RetargetAction} with id "delete". This action maintains its enablement state.
	 */
    public static final ActionFactory DELETE = new ActionFactory("delete", //$NON-NLS-1$
    		IWorkbenchCommandConstants.EDIT_DELETE) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_delete);
            action.setToolTipText(WorkbenchMessages.Workbench_deleteToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            action.enableAccelerator(false);
            window.getWorkbench().getHelpSystem().setHelp(action,
                    IWorkbenchHelpContextIds.DELETE_RETARGET_ACTION);
            ISharedImages sharedImages = window.getWorkbench()
                    .getSharedImages();
            action.setImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
            action
                    .setDisabledImageDescriptor(sharedImages
                            .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "editActionSets", commandId: "org.eclipse.ui.window.customizePerspective"):
	 * Edit the action sets. This action maintains its enablement state.
	 */
    public static final ActionFactory EDIT_ACTION_SETS = new ActionFactory(
            "editActionSets", IWorkbenchCommandConstants.WINDOW_CUSTOMIZE_PERSPECTIVE) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.EditActionSetsAction_text);
            action.setToolTipText(WorkbenchMessages.EditActionSetsAction_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.EDIT_ACTION_SETS_ACTION);
            
            return action;
        }
    };

	/**
	 * Workbench action (id: "export", commandId: "org.eclipse.ui.file.export"): Opens the export
	 * wizard. This action maintains its enablement state.
	 */
    public static final ActionFactory EXPORT = new ActionFactory("export", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_EXPORT) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }

			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.ExportResourcesAction_fileMenuText);
            action.setToolTipText(WorkbenchMessages.ExportResourcesAction_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.EXPORT_ACTION);
            action.setImageDescriptor(WorkbenchImages
                    .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_EXPORT_WIZ));
            return action;
        }
        
    };

	/**
	 * Workbench action (id: "find", commandId: "org.eclipse.ui.edit.findReplace"): Find. This
	 * action is a {@link RetargetAction} with id "find". This action maintains its enablement
	 * state.
	 */
    public static final ActionFactory FIND = new ActionFactory("find", //$NON-NLS-1$
    		IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_findReplace);
            action.setToolTipText(WorkbenchMessages.Workbench_findReplaceToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            // Find's images are commented out due to a conflict with Search.
            // See bug 16412.
            //		action.setImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC));
            //		action.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "forward", commandId: "org.eclipse.ui.navigate.forward"): Forward. This
	 * action is a {@link RetargetAction} with id "forward". This action maintains its enablement
	 * state.
	 */
    public static final ActionFactory FORWARD = new ActionFactory("forward", //$NON-NLS-1$
    		IWorkbenchCommandConstants.NAVIGATE_FORWARD) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_forward);
            action.setToolTipText(WorkbenchMessages.Workbench_forwardToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "forwardHistory", commandId: "org.eclipse.ui.navigate.forwardHistory"):
	 * Forward in the navigation history. This action maintains its enablement state.
	 */
    public static final ActionFactory FORWARD_HISTORY = new ActionFactory(
            "forwardHistory", IWorkbenchCommandConstants.NAVIGATE_FORWARD_HISTORY) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new NavigationHistoryAction(window, true);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "goInto", commandId: "org.eclipse.ui.navigate.goInto"): Go Into. This
	 * action is a {@link RetargetAction} with id "goInto". This action maintains its enablement
	 * state.
	 */
    public static final ActionFactory GO_INTO = new ActionFactory("goInto", //$NON-NLS-1$
    		IWorkbenchCommandConstants.NAVIGATE_GO_INTO) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_goInto);
            action.setToolTipText(WorkbenchMessages.Workbench_goIntoToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "import", commandId: "org.eclipse.ui.file.import"): Opens the import
	 * wizard. This action maintains its enablement state.
	 */
    public static final ActionFactory IMPORT = new ActionFactory("import", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_IMPORT) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.ImportResourcesAction_text);
            action.setToolTipText(WorkbenchMessages.ImportResourcesAction_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.IMPORT_ACTION);
            action.setImageDescriptor(WorkbenchImages
                    .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_IMPORT_WIZ));
            return action;

        }
    };

	/**
	 * Workbench action (id: "lockToolBar"): Lock/unlock the workbench window tool bar. This action
	 * maintains its enablement state.
	 */
    public static final ActionFactory LOCK_TOOL_BAR = new ActionFactory(
            "lockToolBar") {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					IWorkbenchCommandConstants.HELP_ABOUT, window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "maximize", commandId: "org.eclipse.ui.window.maximizePart"):
	 * Maximize/restore the active part. This action maintains its enablement state.
	 */
    public static final ActionFactory MAXIMIZE = new ActionFactory("maximize", //$NON-NLS-1$
    		IWorkbenchCommandConstants.WINDOW_MAXIMIZE_ACTIVE_VIEW_OR_EDITOR) {
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setToolTipText(WorkbenchMessages.MaximizePartAction_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.MAXIMIZE_PART_ACTION);
            
            return action;
        }
    };

	/**
	 * Workbench action (id: "minimize", commandId: "org.eclipse.ui.window.minimizePart"): Minimizes
	 * the active part. This action maintains its enablement state.
	 * 
	 * @since 3.1
	 */
    public static final ActionFactory MINIMIZE = new ActionFactory("minimize", //$NON-NLS-1$
    		IWorkbenchCommandConstants.WINDOW_MINIMIZE_ACTIVE_VIEW_OR_EDITOR) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
			action.setId(getId());
			action.setToolTipText(WorkbenchMessages.MinimizePartAction_toolTip);
			window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.MINIMIZE_PART_ACTION);
			return action;
        }
    };

	/**
	 * Workbench action (id: "move", commandId: "org.eclipse.ui.edit.move"): Move. This action is a
	 * {@link RetargetAction} with id "move". This action maintains its enablement state.
	 */
    public static final ActionFactory MOVE = new ActionFactory("move", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_MOVE) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_move);
            action.setToolTipText(WorkbenchMessages.Workbench_moveToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "new", commandId: "org.eclipse.ui.newWizard"): Opens the new wizard
	 * dialog. This action maintains its enablement state.
	 */
    public static final ActionFactory NEW = new ActionFactory("new", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_NEW) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            ISharedImages images = window.getWorkbench().getSharedImages();
            action.setImageDescriptor(images
                    .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD));
            action.setDisabledImageDescriptor(images
                    .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED));
            action.setText(WorkbenchMessages.NewWizardAction_text);
            action.setToolTipText(WorkbenchMessages.NewWizardAction_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.NEW_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "newWizardDropDown"): Drop-down action which shows shows the new wizard
	 * drop down, or opens the new wizard dialog when pressed. For use in the toolbar. This action
	 * maintains its enablement state.
	 * 
	 * @since 3.1
	 */
    public static final ActionFactory NEW_WIZARD_DROP_DOWN = new ActionFactory(
            "newWizardDropDown") { //$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new NewWizardDropDownAction(window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "next", commandId: "org.eclipse.ui.navigate.next"): Next. This action
	 * is a {@link RetargetAction} with id "next". This action maintains its enablement state.
	 */
    public static final ActionFactory NEXT = new ActionFactory("next", //$NON-NLS-1$
    		IWorkbenchCommandConstants.NAVIGATE_NEXT) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_next);
            action.setToolTipText(WorkbenchMessages.Workbench_nextToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "nextEditor", commandId: "org.eclipse.ui.window.nextEditor"): Next
	 * editor. This action maintains its enablement state.
	 * <p>
	 * <code>NEXT_EDITOR</code> and <code>PREVIOUS_EDITOR</code> form a cycle action pair. For a
	 * given window, use {@link ActionFactory#linkCycleActionPair
	 * ActionFactory.linkCycleActionPair</code>} to connect the two.
	 * </p>
	 */
    public static final ActionFactory NEXT_EDITOR = new ActionFactory(
            "nextEditor", IWorkbenchCommandConstants.WINDOW_NEXT_EDITOR) {//$NON-NLS-1$
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			IWorkbenchAction action = new WorkbenchCommandAction(
					getCommandId(), window);

			action.setId(getId());
			action.setText(WorkbenchMessages.CycleEditorAction_next_text);
			action.setToolTipText(WorkbenchMessages.CycleEditorAction_next_toolTip);
            // @issue missing action ids
			window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.CYCLE_EDITOR_FORWARD_ACTION);
            
			return action;
		}
    };

	/**
	 * Workbench action (id: "nextPart", commandId: "org.eclipse.ui.window.nextView"): Next part.
	 * This action maintains its enablement state.
	 * <p>
	 * <code>NEXT_PART</code> and <code>PREVIOUS_PART</code> form a cycle action pair. For a given
	 * window, use {@link ActionFactory#linkCycleActionPair
	 * ActionFactory.linkCycleActionPair</code>} to connect the two.
	 * </p>
	 */
    public static final ActionFactory NEXT_PART = new ActionFactory("nextPart", //$NON-NLS-1$
    		IWorkbenchCommandConstants.WINDOW_NEXT_VIEW) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.CyclePartAction_next_text);
			action.setToolTipText(WorkbenchMessages.CyclePartAction_next_toolTip);
			// @issue missing action ids
			window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.CYCLE_PART_FORWARD_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "nextPerspective", commandId: "org.eclipse.ui.window.nextPerspective"):
	 * Next perspective. This action maintains its enablement state.
	 * <p>
	 * <code>NEXT_PERSPECTIVE</code> and <code>PREVIOUS_PERSPECTIVE</code> form a cycle action pair.
	 * For a given window, use {@link ActionFactory#linkCycleActionPair
	 * ActionFactory.linkCycleActionPair</code>} to connect the two.
	 * </p>
	 */
    public static final ActionFactory NEXT_PERSPECTIVE = new ActionFactory(
            "nextPerspective", IWorkbenchCommandConstants.WINDOW_NEXT_PERSPECTIVE) {//$NON-NLS-1$
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.CyclePerspectiveAction_next_text);
            action.setToolTipText(WorkbenchMessages.CyclePerspectiveAction_next_toolTip);
            // @issue missing action ids
            window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.CYCLE_PERSPECTIVE_FORWARD_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "openNewWindow", commandId: "org.eclipse.ui.window.newWindow"): Open a
	 * new workbench window. This action maintains its enablement state.
	 */
    public static final ActionFactory OPEN_NEW_WINDOW = new ActionFactory(
            "openNewWindow", IWorkbenchCommandConstants.WINDOW_NEW_WINDOW) {//$NON-NLS-1$
        
    	
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.OpenInNewWindowAction_text);
            action.setToolTipText(WorkbenchMessages.OpenInNewWindowAction_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action,
            		IWorkbenchHelpContextIds.OPEN_NEW_WINDOW_ACTION);
            return action;
        }
        
    };

	/**
	 * Workbench action (id: "paste", commandId: "org.eclipse.ui.edit.paste"): Paste. This action is
	 * a {@link RetargetAction} with id "paste". This action maintains its enablement state.
	 */
    public static final ActionFactory PASTE = new ActionFactory("paste", //$NON-NLS-1$
    		IWorkbenchCommandConstants.EDIT_PASTE) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_paste);
            action.setToolTipText(WorkbenchMessages.Workbench_pasteToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            ISharedImages sharedImages = window.getWorkbench()
                    .getSharedImages();
            action.setImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
            action.setDisabledImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "preferences", commandId: "org.eclipse.ui.window.preferences"):
	 * Displays the Preferences dialog. This action maintains its enablement state.
	 */
    public static final ActionFactory PREFERENCES = new ActionFactory(
            "preferences", IWorkbenchCommandConstants.WINDOW_PREFERENCES) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }

            WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "previous", commandId: "org.eclipse.ui.navigate.previous"): Previous.
	 * This action is a {@link RetargetAction} with id "previous". This action maintains its
	 * enablement state.
	 */
    public static final ActionFactory PREVIOUS = new ActionFactory("previous", //$NON-NLS-1$
    		IWorkbenchCommandConstants.NAVIGATE_PREVIOUS) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_previous);
            action.setToolTipText(WorkbenchMessages.Workbench_previousToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "previousEditor", commandId: "org.eclipse.ui.window.previousEditor"):
	 * Previous editor. This action maintains its enablement state.
	 * <p>
	 * <code>NEXT_EDITOR</code> and <code>PREVIOUS_EDITOR</code> form a cycle action pair. For a
	 * given window, use {@link ActionFactory#linkCycleActionPair
	 * ActionFactory.linkCycleActionPair</code>} to connect the two.
	 * </p>
	 */
    public static final ActionFactory PREVIOUS_EDITOR = new ActionFactory(
            "previousEditor", IWorkbenchCommandConstants.WINDOW_PREVIOUS_EDITOR) {//$NON-NLS-1$
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			IWorkbenchAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.CycleEditorAction_prev_text);
            action.setToolTipText(WorkbenchMessages.CycleEditorAction_prev_toolTip);
            // @issue missing action ids
            window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.CYCLE_EDITOR_BACKWARD_ACTION);

            return action;
        }
    };

	/**
	 * Workbench action (id: "previousPart", commandId: "org.eclipse.ui.window.previousView"):
	 * Previous part. This action maintains its enablement state.
	 * <p>
	 * <code>NEXT_PART</code> and <code>PREVIOUS_PART</code> form a cycle action pair. For a given
	 * window, use {@link ActionFactory#linkCycleActionPair
	 * ActionFactory.linkCycleActionPair</code>} to connect the two.
	 * </p>
	 */
    public static final ActionFactory PREVIOUS_PART = new ActionFactory(
            "previousPart", IWorkbenchCommandConstants.WINDOW_PREVIOUS_VIEW) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
			action.setText(WorkbenchMessages.CyclePartAction_prev_text);
			action.setToolTipText(WorkbenchMessages.CyclePartAction_prev_toolTip);
			// @issue missing action ids
			window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.CYCLE_PART_BACKWARD_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "previousPerspective", commandId: "org.eclipse.ui.window.previousPerspective"):
	 * Previous perspective. This action maintains its enablement state.
	 * <p>
	 * <code>NEXT_PERSPECTIVE</code> and <code>PREVIOUS_PERSPECTIVE</code> form a cycle action pair.
	 * For a given window, use {@link ActionFactory#linkCycleActionPair
	 * ActionFactory.linkCycleActionPair</code>} to connect the two.
	 * </p>
	 */
    public static final ActionFactory PREVIOUS_PERSPECTIVE = new ActionFactory(
            "previousPerspective", IWorkbenchCommandConstants.WINDOW_PREVIOUS_PERSPECTIVE) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.CyclePerspectiveAction_prev_text);
            action.setToolTipText(WorkbenchMessages.CyclePerspectiveAction_prev_toolTip);
            // @issue missing action ids
            window.getWorkbench().getHelpSystem().setHelp(action,
					IWorkbenchHelpContextIds.CYCLE_PERSPECTIVE_BACKWARD_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "print", commandId: "org.eclipse.ui.file.print"): Print. This action is
	 * a {@link RetargetAction} with id "print". This action maintains its enablement state.
	 */
    public static final ActionFactory PRINT = new ActionFactory("print", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_PRINT) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_print);
            action.setToolTipText(WorkbenchMessages.Workbench_printToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            action
                    .setImageDescriptor(WorkbenchImages
                            .getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT));
            action
                    .setDisabledImageDescriptor(WorkbenchImages
                            .getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "properties", commandId: "org.eclipse.ui.file.properties"): Properties.
	 * This action is a {@link RetargetAction} with id "properties". This action maintains its
	 * enablement state.
	 */
    public static final ActionFactory PROPERTIES = new ActionFactory(
            "properties", IWorkbenchCommandConstants.FILE_PROPERTIES) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_properties);
            action.setToolTipText(WorkbenchMessages.Workbench_propertiesToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "quit", commandId: "org.eclipse.ui.file.exit"): Quit (close the
	 * workbench). This action maintains its enablement state.
	 */
    public static final ActionFactory QUIT = new ActionFactory("quit", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_EXIT) {
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.Exit_text);
            action.setToolTipText(WorkbenchMessages.Exit_toolTip);
            window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.QUIT_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "redo", commandId: "org.eclipse.ui.edit.redo"): Redo. This action is a
	 * {@link RetargetAction} with id "redo". This action maintains its enablement state.
	 */
    public static final ActionFactory REDO = new ActionFactory("redo", //$NON-NLS-1$
    		IWorkbenchCommandConstants.EDIT_REDO) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            LabelRetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_redo);
            action.setToolTipText(WorkbenchMessages.Workbench_redoToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            ISharedImages sharedImages = window.getWorkbench()
                    .getSharedImages();
            action.setImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
            action.setDisabledImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "refresh", commandId: "org.eclipse.ui.file.refresh"): Refresh. This
	 * action is a {@link RetargetAction} with id "refresh". This action maintains its enablement
	 * state.
	 */
    public static final ActionFactory REFRESH = new ActionFactory("refresh", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_REFRESH) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_refresh);
            action.setToolTipText(WorkbenchMessages.Workbench_refreshToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "rename", commandId: "org.eclipse.ui.edit.rename"): Rename. This action
	 * is a {@link RetargetAction} with id "rename". This action maintains its enablement state.
	 */
    public static final ActionFactory RENAME = new ActionFactory("rename", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_RENAME) {
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_rename);
            action.setToolTipText(WorkbenchMessages.Workbench_renameToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "resetPerspective", commandId: "org.eclipse.ui.window.resetPerspective"):
	 * Resets the current perspective. This action maintains its enablement state.
	 */
    public static final ActionFactory RESET_PERSPECTIVE = new ActionFactory(
            "resetPerspective", IWorkbenchCommandConstants.WINDOW_RESET_PERSPECTIVE) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window);

			action.setId(getId());
			action.setText(WorkbenchMessages.ResetPerspective_text);
			action.setToolTipText(WorkbenchMessages.ResetPerspective_toolTip);
			window.getWorkbench().getHelpSystem()
					.setHelp(action, IWorkbenchHelpContextIds.RESET_PERSPECTIVE_ACTION);
			return action;
        }
    };

	/**
	 * Workbench action (id: "revert", commandId: "org.eclipse.ui.file.revert"): Revert. This action
	 * is a {@link RetargetAction} with id "revert". This action maintains its enablement state.
	 */
    public static final ActionFactory REVERT = new ActionFactory("revert", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_REVERT) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_revert);
            action.setToolTipText(WorkbenchMessages.Workbench_revertToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "save", commandId: "org.eclipse.ui.file.save"): Save the active editor.
	 * This action maintains its enablement state.
	 */
    public static final ActionFactory SAVE = new ActionFactory("save", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_SAVE) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window);
			action.setText(WorkbenchMessages.SaveAction_text);
			action.setToolTipText(WorkbenchMessages.SaveAction_toolTip);
            action.setId(getId());
			window.getWorkbench().getHelpSystem()
					.setHelp(action, IWorkbenchHelpContextIds.SAVE_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "saveAll", commandId: "org.eclipse.ui.file.saveAll"): Save all open
	 * editors with unsaved changes. This action maintains its enablement state.
	 */
    public static final ActionFactory SAVE_ALL = new ActionFactory("saveAll", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_SAVE_ALL) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			IWorkbenchAction action = new WorkbenchCommandAction(getCommandId(), window);
			action.setText(WorkbenchMessages.SaveAll_text);
			action.setToolTipText(WorkbenchMessages.SaveAll_toolTip);
			window.getWorkbench().getHelpSystem()
					.setHelp(action, IWorkbenchHelpContextIds.SAVE_ALL_ACTION);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "saveAs", commandId: "org.eclipse.ui.file.saveAs"): Save As for the
	 * active editor. This action maintains its enablement state.
	 */
    public static final ActionFactory SAVE_AS = new ActionFactory("saveAs", //$NON-NLS-1$
    		IWorkbenchCommandConstants.FILE_SAVE_AS) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			IWorkbenchAction action = new WorkbenchCommandAction(getCommandId(), window);
			action.setText(WorkbenchMessages.SaveAs_text);
			action.setToolTipText(WorkbenchMessages.SaveAs_toolTip);
			window.getWorkbench().getHelpSystem()
					.setHelp(action, IWorkbenchHelpContextIds.SAVE_AS_ACTION);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "savePerspective", commandId: "org.eclipse.ui.window.savePerspective"):
	 * Save the current perspective. This action maintains its enablement state.
	 */
    public static final ActionFactory SAVE_PERSPECTIVE = new ActionFactory(
            "savePerspective", IWorkbenchCommandConstants.WINDOW_SAVE_PERSPECTIVE_AS) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window);

			action.setId(getId());
			action.setText(WorkbenchMessages.SavePerspective_text);
			action.setToolTipText(WorkbenchMessages.SavePerspective_toolTip);
			window.getWorkbench().getHelpSystem()
					.setHelp(action, IWorkbenchHelpContextIds.SAVE_PERSPECTIVE_ACTION);
			return action;
		}
    };

	/**
	 * Workbench action (id: "selectAll", commandId: "org.eclipse.ui.edit.selectAll"): Select All.
	 * This action is a {@link RetargetAction} with id "selectAll". This action maintains its
	 * enablement state.
	 */
    public static final ActionFactory SELECT_ALL = new ActionFactory(
            "selectAll", IWorkbenchCommandConstants.EDIT_SELECT_ALL) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_selectAll);
            action.setToolTipText(WorkbenchMessages.Workbench_selectAllToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "showEditor"): Show/hide the editor area. This action maintains its
	 * enablement state.
	 */
    public static final ActionFactory SHOW_EDITOR = new ActionFactory(
            "showEditor") {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new ToggleEditorsVisibilityAction(window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "showOpenEditors"): Show a list of open (and recently closed) editors.
	 * This action maintains its enablement state.
	 */
    public static final ActionFactory SHOW_OPEN_EDITORS = new ActionFactory(
            "showOpenEditors") {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.switchToEditor", window); //$NON-NLS-1$
            action.setId(getId());
            action.setText(WorkbenchMessages.WorkbenchEditorsAction_label);
            // @issue missing action id
            window.getWorkbench().getHelpSystem().setHelp(action,
    				IWorkbenchHelpContextIds.WORKBENCH_EDITORS_ACTION);
            return action;
        }
    };

	/**
	 * Workbench action (id: "showWorkbookEditors"): Shows a list of open editors in the current or
	 * last active workbook.
	 */
    public static final ActionFactory SHOW_WORKBOOK_EDITORS = new ActionFactory(
            "showWorkBookEditors") {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            
            WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.openEditorDropDown", window); //$NON-NLS-1$
            action.setId(getId());
            action.setText(WorkbenchMessages.WorkbookEditorsAction_label);
            
            return action;
        }
    };

	/**
	 * Workbench action (id: "showQuickAccess"): Shows a list of UI elements like editors, views,
	 * perspectives etc.
	 * 
	 * @since 3.3
	 */
	public static final ActionFactory SHOW_QUICK_ACCESS = new ActionFactory(
			"showQuickAccess") { //$NON-NLS-1$

		/*
		 * (non-Javadoc)
		 * 
		 * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
		 */
		public IWorkbenchAction create(IWorkbenchWindow window) {
			WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.quickAccess", window); //$NON-NLS-1$
			action.setId(getId());
			action.setText(WorkbenchMessages.QuickAccessAction_text);
			action.setToolTipText(WorkbenchMessages.QuickAccessAction_toolTip);
			return action;
		}

	};

	/**
	 * Workbench action (id: "showPartPaneMenu"): Show the part pane menu. This action maintains its
	 * enablement state.
	 */
    public static final ActionFactory SHOW_PART_PANE_MENU = new ActionFactory(
            "showPartPaneMenu") {//$NON-NLS-1$
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            WorkbenchCommandAction action=new WorkbenchCommandAction("org.eclipse.ui.window.showSystemMenu",window); //$NON-NLS-1$
            action.setId(getId());
            action.setText(WorkbenchMessages.ShowPartPaneMenuAction_text);
            action.setToolTipText(WorkbenchMessages.ShowPartPaneMenuAction_toolTip);
            return action;
        }
    };

	/**
	 * Workbench action (id: "showViewMenu", commandId: "org.eclipse.ui.window.showViewMenu"): Show
	 * the view menu. This action maintains its enablement state.
	 */
    public static final ActionFactory SHOW_VIEW_MENU = new ActionFactory(
            "showViewMenu", IWorkbenchCommandConstants.WINDOW_SHOW_VIEW_MENU) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
            action.setId(getId());
            action.setText(WorkbenchMessages.ShowViewMenuAction_text);
            action.setToolTipText(WorkbenchMessages.ShowViewMenuAction_toolTip);
            return action;
        }
    };

	/**
	 * Workbench action (id: "undo", commandId: "org.eclipse.ui.edit.undo"): Undo. This action is a
	 * {@link RetargetAction} with id "undo". This action maintains its enablement state.
	 */
    public static final ActionFactory UNDO = new ActionFactory("undo", //$NON-NLS-1$
    		IWorkbenchCommandConstants.EDIT_UNDO) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            LabelRetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_undo);
            action.setToolTipText(WorkbenchMessages.Workbench_undoToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            ISharedImages sharedImages = window.getWorkbench()
                    .getSharedImages();
            action.setImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
            action.setDisabledImageDescriptor(sharedImages
                    .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED));
            return action;
        }
    };

	/**
	 * Workbench action (id: "up", commandId: "org.eclipse.ui.navigate.up"): Up. This action is a
	 * {@link RetargetAction} with id "up". This action maintains its enablement state.
	 */
    public static final ActionFactory UP = new ActionFactory("up", //$NON-NLS-1$
    		IWorkbenchCommandConstants.NAVIGATE_UP) {
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_up);
            action.setToolTipText(WorkbenchMessages.Workbench_upToolTip);
            window.getPartService().addPartListener(action);
            action.setActionDefinitionId(getCommandId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "helpContents", commandId: "org.eclipse.ui.help.helpContents"): Open
	 * the help contents. This action is always enabled.
	 */
    public static final ActionFactory HELP_CONTENTS = new ActionFactory(
            "helpContents", IWorkbenchCommandConstants.HELP_HELP_CONTENTS) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new HelpContentsAction(window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "helpSearch", commandId: "org.eclipse.ui.help.helpSearch"): Open the
	 * help search. This action is always enabled.
	 * 
	 * @since 3.1
	 */
    public static final ActionFactory HELP_SEARCH = new ActionFactory(
            "helpSearch", IWorkbenchCommandConstants.HELP_HELP_SEARCH) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new HelpSearchAction(window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "dynamicHelp", commandId: "org.eclipse.ui.help.dynamicHelp"): Open the
	 * dynamic help. This action is always enabled.
	 * 
	 * @since 3.1
	 */
    public static final ActionFactory DYNAMIC_HELP = new ActionFactory(
            "dynamicHelp", IWorkbenchCommandConstants.HELP_DYNAMIC_HELP) {//$NON-NLS-1$
        
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            IWorkbenchAction action = new DynamicHelpAction(window);
            action.setId(getId());
            return action;
        }
    };

	/**
	 * Workbench action (id: "openPerspectiveDialog", commandId: "org.eclipse.ui.perspectives.showPerspective"):
	 * Open the Open Perspective dialog. This action is always enabled.
	 * 
	 * @since 3.1
	 */
    public static final ActionFactory OPEN_PERSPECTIVE_DIALOG = new ActionFactory(
            "openPerspectiveDialog", IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE) {//$NON-NLS-1$
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
			action.setId(getId());
	        action.setText(WorkbenchMessages.OpenPerspectiveDialogAction_text);
	        action.setToolTipText(WorkbenchMessages.OpenPerspectiveDialogAction_tooltip);
	        action.setImageDescriptor(WorkbenchImages.getImageDescriptor(
	              IWorkbenchGraphicConstants.IMG_ETOOL_NEW_PAGE));

			return action;
        }
    };

	/**
	 * Workbench action (id: "newEditor", commandId: "org.eclipse.ui.window.newEditor"): Open a new
	 * editor on the active editor's input. This action maintains its enablement state.
	 * 
	 * @since 3.1
	 */
    public static final ActionFactory NEW_EDITOR = new ActionFactory(
            "newEditor", IWorkbenchCommandConstants.WINDOW_NEW_EDITOR) {//$NON-NLS-1$
       
        /* (non-Javadoc)
         * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
         */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }

			WorkbenchCommandAction action = new WorkbenchCommandAction(
					getCommandId(), window);
			action.setId(getId());
			action.setText(WorkbenchMessages.NewEditorAction_text);
			action.setToolTipText(WorkbenchMessages.NewEditorAction_tooltip);

			return action;
        }
    };

	/**
	 * Workbench action (id: "toggleCoolbar"): Toggle the visibility of the coolbar and perspective
	 * switcher. This will only enable visibility of the coolbar and perspective bar if the window
	 * advisor creating the window allowed for their visibility initially.
	 * 
	 * @since 3.3
	 */
	public static final ActionFactory TOGGLE_COOLBAR = new ActionFactory(
			"toggleCoolbar") { //$NON-NLS-1$

		public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			WorkbenchCommandAction action = new WorkbenchCommandAction(
					"org.eclipse.ui.ToggleCoolbarAction", window); //$NON-NLS-1$
			action.setId(getId());
			// set the default text - this will be updated by the handler
			action.setText(WorkbenchMessages.ToggleCoolbarVisibilityAction_hide_text);
			action.setToolTipText(WorkbenchMessages.ToggleCoolbarVisibilityAction_toolTip);
			return action;
		}
	};
    
    /**
	 * Establishes bi-direction connections between the forward and backward
	 * actions of a cycle pair.
	 * <p>
	 * Example usage:
	 * 
	 * <pre>
	 * ActionFactory.IWorkbenchAction nextEditorAction = ActionFactory.NEXT_EDITOR
	 * 		.create(window);
	 * ActionFactory.IWorkbenchAction previousEditorAction = ActionFactory.PREVIOUS_EDITOR
	 * 		.create(window);
	 * ActionFactory.linkCycleActionPair(nextEditorAction, previousEditorAction);
	 * </pre>
	 * 
	 * </p>
	 * 
	 * @param next
	 *            the action that moves forward
	 * @param previous
	 *            the action that moves backward
	 */
    public static void linkCycleActionPair(IWorkbenchAction next,
            IWorkbenchAction previous) {
    }

    /**
     * Id of actions created by this action factory.
     */
    private final String actionId;
    
    /**
     * Optional ID for this action.
     */
    private final String commandId;

    /**
     * Creates a new workbench action factory with the given id.
     * 
     * @param actionId
     *            the id of actions created by this action factory
     */
    protected ActionFactory(String actionId) {
    	this(actionId, null);
    }

	/**
	 * Create a new workbench action factory with the given IDs.
	 * 
	 * @param actionId
	 *            the id of actions created by this action factory
	 * @param commandId
	 *            the matching command id
	 * @since 3.5
	 */
    protected ActionFactory(String actionId, String commandId) {
    	this.actionId = actionId;
    	this.commandId = commandId;
    }

    /**
     * Creates a new standard action for the given workbench window. The action
     * has an id as specified by the particular factory.
     * <p>
     * Actions automatically register listeners against the workbench window so
     * that they can keep their enablement state up to date. Ordinarily, the
     * window's references to these listeners will be dropped automatically
     * when the window closes. However, if the client needs to get rid of an
     * action while the window is still open, the client must call
     * {@link IWorkbenchAction#dispose dispose}to give the action an
     * opportunity to deregister its listeners and to perform any other
     * cleanup.
     * </p>
     * 
     * @param window
     *            the workbench window
     * @return the workbench action
     */
    public abstract IWorkbenchAction create(IWorkbenchWindow window);

    /**
     * Returns the id of this action factory.
     * 
     * @return the id of actions created by this action factory
     */
    public String getId() {
        return actionId;
    }

	/**
	 * Return the command id of this action factory.
	 * 
	 * @return the command id of the action created by this action factory. May
	 *         be <code>null</code>.
	 * @since 3.5
	 */
    public String getCommandId() {
    	return commandId;
    }
}

Back to the top