1 |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
4 |
* Copyright (C) 2005, 2006 Grigor Kirilov Iliev |
5 |
* |
6 |
* This file is part of JSampler. |
7 |
* |
8 |
* JSampler is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License version 2 |
10 |
* as published by the Free Software Foundation. |
11 |
* |
12 |
* JSampler is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with JSampler; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
* MA 02111-1307 USA |
21 |
*/ |
22 |
|
23 |
package org.jsampler; |
24 |
|
25 |
import org.jsampler.event.LSConsoleListener; |
26 |
|
27 |
|
28 |
/** |
29 |
* A data model representing LS Console. |
30 |
* @author Grigor Iliev |
31 |
*/ |
32 |
public interface LSConsoleModel { |
33 |
/** |
34 |
* Registers the specified listener for receiving event messages. |
35 |
* @param l The <code>LSConsoleListener</code> to register. |
36 |
*/ |
37 |
public void addLSConsoleListener(LSConsoleListener l); |
38 |
|
39 |
/** |
40 |
* Removes the specified listener. |
41 |
* @param l The <code>LSConsoleListener</code> to remove. |
42 |
*/ |
43 |
public void removeLSConsoleListener(LSConsoleListener l); |
44 |
|
45 |
/** Executes the command specified in the command line. */ |
46 |
public void execCommand(); |
47 |
|
48 |
/** |
49 |
* Gets the last executed command. |
50 |
* @return The last command executed in the LS Console. |
51 |
*/ |
52 |
public String getLastExecutedCommand(); |
53 |
|
54 |
/** |
55 |
* Sets the text in the command line. |
56 |
* @param cmdLine The new command line text. |
57 |
*/ |
58 |
public void setCommandLineText(String cmdLine); |
59 |
|
60 |
/** |
61 |
* Gets the text in the command line. |
62 |
* @return The command line's text. |
63 |
*/ |
64 |
public String getCommandLineText(); |
65 |
|
66 |
/** |
67 |
* Gets the command history of the current session, including blank lines and comments. |
68 |
* @return The command history of the current session, including blank lines and comments. |
69 |
*/ |
70 |
public String[] getSessionHistory(); |
71 |
|
72 |
/** |
73 |
* Clears the session history. |
74 |
* @see #getSessionHistory |
75 |
*/ |
76 |
public void clearSessionHistory(); |
77 |
|
78 |
/** |
79 |
* Adds the specified <code>command</code> to command history. |
80 |
* @param command The command to be added to command history. |
81 |
*/ |
82 |
public void addToCommandHistory(String command); |
83 |
|
84 |
/** |
85 |
* Gets the complete command history, excluding blank lines and comments. |
86 |
* @return The complete command history, excluding blank lines and comments. |
87 |
*/ |
88 |
public String[] getCommandHistory(); |
89 |
|
90 |
/** |
91 |
* Determines the maximum number of lines to be kept in the command history. |
92 |
* @return The maximum number of lines to be kept in the command history. |
93 |
*/ |
94 |
public int getCommandHistorySize(); |
95 |
|
96 |
/** |
97 |
* Sets the maximum number of lines to be kept in the command history. |
98 |
* @param size Determines the maximum number of lines to be kept in the command history. |
99 |
*/ |
100 |
public void setCommandHistorySize(int size); |
101 |
|
102 |
/** |
103 |
* Clears the complete/multisession command history. |
104 |
* @see #getCommandHistory |
105 |
*/ |
106 |
public void clearCommandHistory(); |
107 |
|
108 |
/** |
109 |
* Gets a list of all LSCP commands. |
110 |
* @return A list of all LSCP commands. |
111 |
*/ |
112 |
public String[] getCommandList(); |
113 |
|
114 |
/** |
115 |
* Searches the LSCP command list for commands |
116 |
* containing the string returned by {@link #getCommandLineText}. |
117 |
* @return All commands that contains the string returned by {@link #getCommandLineText}. |
118 |
* @see #getCommandList |
119 |
*/ |
120 |
public String[] searchCommandList(); |
121 |
|
122 |
/** |
123 |
* Searches the LSCP command list for commands containing <code>substring</code>. |
124 |
* @param substring The substring to be used to perform the search. |
125 |
* @return All commands that contains <code>substring</code>. |
126 |
* @see #getCommandList |
127 |
*/ |
128 |
public String[] searchCommandList(String substring); |
129 |
|
130 |
/** |
131 |
* Searches the command history for commands |
132 |
* containing the string returned by {@link #getCommandLineText}. |
133 |
* @return All commands that contains the string returned by {@link #getCommandLineText}. |
134 |
* @see #getCommandHistory |
135 |
*/ |
136 |
public String[] searchCommandHistory(); |
137 |
|
138 |
/** |
139 |
* Searches the command history for commands containing <code>substring</code>. |
140 |
* @param substring The substring to be used to perform the search. |
141 |
* @return All commands that contains <code>substring</code>. |
142 |
* @see #getCommandList |
143 |
*/ |
144 |
public String[] searchCommandHistory(String substring); |
145 |
|
146 |
/** Browses the command history one line up. */ |
147 |
public void browseCommandHistoryUp(); |
148 |
|
149 |
/** Browses the command history one line down. */ |
150 |
public void browseCommandHistoryDown(); |
151 |
|
152 |
/** Browses to the first line of the command history. */ |
153 |
public void browseCommandHistoryFirst(); |
154 |
|
155 |
/** Browses to the last line of the command history. */ |
156 |
public void browseCommandHistoryLast(); |
157 |
} |