File: DeleteSelectedRangeFunction.java

package info (click to toggle)
gpsprune 19.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,516 kB
  • sloc: java: 42,704; sh: 25; makefile: 24; python: 15
file content (41 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (6)
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
package tim.prune.function;

import tim.prune.App;

/**
 * Class to provide the function to delete the currently selected range
 */
public class DeleteSelectedRangeFunction extends DeleteBitOfTrackFunction
{
	/**
	 * Constructor
	 * @param inApp application object for callback
	 */
	public DeleteSelectedRangeFunction(App inApp)
	{
		super(inApp);
	}

	/** Get the name key */
	public String getNameKey() {
		return "function.deleterange";
	}

	/**
	 * @return name key for undo operation
	 */
	protected String getUndoNameKey() {
		return "undo.deleterange";
	}

	/**
	 * Begin the function
	 */
	public void begin()
	{
		// Get the currently selected range and pass indexes to parent class
		final int startIndex = _app.getTrackInfo().getSelection().getStart();
		final int endIndex   = _app.getTrackInfo().getSelection().getEnd();
		deleteSection(startIndex, endIndex);
	}
}