@@ -82,6 +82,15 @@ public void handleEditKey(KeyEvent e, IStructuredSelection selection)
82
82
tx .withAccountTransaction ().ifPresent (t -> createEditAccountTransactionAction (t ).run ());
83
83
tx .withPortfolioTransaction ().ifPresent (t -> createEditPortfolioTransactionAction (t ).run ());
84
84
}
85
+ if (e .keyCode == 'd' && e .stateMask == SWT .MOD1 )
86
+ {
87
+ if (selection .isEmpty ())
88
+ return ;
89
+
90
+ TransactionPair <?> tx = (TransactionPair <?>) selection .getFirstElement ();
91
+ tx .withAccountTransaction ().ifPresent (t -> createCopyAccountTransactionAction (t ).run ());
92
+ tx .withPortfolioTransaction ().ifPresent (t -> createCopyPortfolioTransactionAction (t ).run ());
93
+ }
85
94
}
86
95
87
96
private void fillContextMenuPortfolioTxList (IMenuManager manager , IStructuredSelection selection )
@@ -131,7 +140,9 @@ private void fillContextMenuAccountTx(IMenuManager manager, boolean fullContextM
131
140
action .setAccelerator (SWT .MOD1 | 'E' );
132
141
manager .add (action );
133
142
134
- manager .add (createCopyAccountTransactionAction (tx ));
143
+ Action duplicateAction = createCopyAccountTransactionAction (tx );
144
+ duplicateAction .setAccelerator (SWT .MOD1 | 'D' );
145
+ manager .add (duplicateAction );
135
146
136
147
if (fullContextMenu )
137
148
{
@@ -150,7 +161,9 @@ private void fillContextMenuPortfolioTx(IMenuManager manager, boolean fullContex
150
161
editAction .setAccelerator (SWT .MOD1 | 'E' );
151
162
manager .add (editAction );
152
163
153
- manager .add (createCopyPortfolioTransactionAction (tx ));
164
+ Action duplicateAction = createCopyPortfolioTransactionAction (tx );
165
+ duplicateAction .setAccelerator (SWT .MOD1 | 'D' );
166
+ manager .add (duplicateAction );
154
167
155
168
manager .add (new Separator ());
156
169
0 commit comments