]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/function/DeleteSelectedRangeFunction.java
Version 14, October 2012
[GpsPrune.git] / tim / prune / function / DeleteSelectedRangeFunction.java
1 package tim.prune.function;
2
3 import tim.prune.App;
4
5 /**
6  * Class to provide the function to delete the currently selected range
7  */
8 public class DeleteSelectedRangeFunction extends DeleteBitOfTrackFunction
9 {
10         /**
11          * Constructor
12          * @param inApp application object for callback
13          */
14         public DeleteSelectedRangeFunction(App inApp)
15         {
16                 super(inApp);
17         }
18
19         /** Get the name key */
20         public String getNameKey() {
21                 return "function.deleterange";
22         }
23
24         /**
25          * @return name key for undo operation
26          */
27         protected String getUndoNameKey() {
28                 return "undo.deleterange";
29         }
30
31         /**
32          * Begin the function
33          */
34         public void begin()
35         {
36                 // Get the currently selected range and pass indexes to parent class
37                 final int startIndex = _app.getTrackInfo().getSelection().getStart();
38                 final int endIndex   = _app.getTrackInfo().getSelection().getEnd();
39                 deleteSection(startIndex, endIndex);
40         }
41 }