92 |
*/ |
*/ |
93 |
public Set markedCells = new HashSet(); |
public Set markedCells = new HashSet(); |
94 |
|
|
95 |
/** A string describing the last error that occurred, if any. |
/** The last client exception that occurred, if any. |
96 |
*/ |
*/ |
97 |
public String errstring = null; |
public ClientException lastClientException; |
98 |
|
|
99 |
public DefaultBinder(Fallback fallback) { |
public DefaultBinder(Fallback fallback) { |
100 |
this.fallback = fallback; |
this.fallback = fallback; |
101 |
} |
} |
102 |
|
|
103 |
|
|
104 |
void dir(int win, int dim, int dir) { |
void dir(int win, int dim, int dir) throws ClientException { |
105 |
Fallback.Win w = fallback.windows[win]; |
Fallback.Win w = fallback.windows[win]; |
106 |
Fallback.Win other = fallback.windows[1-win]; |
Fallback.Win other = fallback.windows[1-win]; |
107 |
Dim[] dims = w.dims; |
Dim[] dims = w.dims; |
198 |
} |
} |
199 |
|
|
200 |
wasInWindow = (Fallback.Win)win; |
wasInWindow = (Fallback.Win)win; |
201 |
errstring = null; |
lastClientException = null; |
202 |
|
|
203 |
try { |
try { |
204 |
if(fallback.mode == NORMAL) |
if(fallback.mode == NORMAL) |
220 |
directOp = NONE; throw e; |
directOp = NONE; throw e; |
221 |
} catch(RuntimeException e) { |
} catch(RuntimeException e) { |
222 |
directOp = NONE; throw e; |
directOp = NONE; throw e; |
223 |
|
} catch(ClientException e) { |
224 |
|
lastClientException = e; |
225 |
|
directOp = NONE; |
226 |
} finally { |
} finally { |
227 |
AbstractUpdateManager.chg(); |
AbstractUpdateManager.chg(); |
228 |
} |
} |
229 |
} |
} |
230 |
|
|
231 |
public void normalModeKeystroke(String k) { |
public void normalModeKeystroke(String k) throws ClientException { |
232 |
if(k.equals("Tab")) { |
if(k.equals("Tab")) { |
233 |
if(dbg) pa("Switching to text edit mode."); |
if(dbg) pa("Switching to text edit mode."); |
234 |
fallback.mode = TEXT_1; |
fallback.mode = TEXT_1; |
270 |
cell.delete(); |
cell.delete(); |
271 |
fallback.windows[1].cursor = home; |
fallback.windows[1].cursor = home; |
272 |
} else { |
} else { |
273 |
errstring = "Sorry, I can't delete the home cell."; |
throw new ClientException( |
274 |
|
"Sorry, I can't delete the home cell."); |
275 |
} |
} |
276 |
} else if(k.length() == 1) { |
} else if(k.length() == 1) { |
277 |
switch(k.charAt(0)) { |
switch(k.charAt(0)) { |