(Command c, Displayable displayable)
| 177 | } |
| 178 | |
| 179 | public boolean executeCommand(Command c, Displayable displayable) { |
| 180 | |
| 181 | body = textbox.getString(); |
| 182 | caretPos = getCaretPos(); |
| 183 | |
| 184 | if (body.length() == 0) |
| 185 | body = null; |
| 186 | |
| 187 | //#ifdef ARCHIVE |
| 188 | if (c==cmdArchive) { new ArchiveList(caretPos, 1, textbox); return true; } |
| 189 | //#endif |
| 190 | //#ifdef CLIPBOARD |
| 191 | if (c == cmdCopy) { |
| 192 | try { |
| 193 | ClipBoardIO.getInstance().setClipBoard(body); |
| 194 | if (!ClipBoardIO.getInstance().isEmpty()) { |
| 195 | textbox.addCommand(cmdCopyPlus); |
| 196 | } |
| 197 | } catch (Exception e) {/*no messages*/} |
| 198 | return true; |
| 199 | } |
| 200 | if (c==cmdCopyPlus) { |
| 201 | try { |
| 202 | ClipBoardIO.getInstance().append(body); |
| 203 | } catch (Exception e) {/*no messages*/} |
| 204 | return true; |
| 205 | } |
| 206 | if (c==cmdPasteText) { |
| 207 | insert(ClipBoardIO.getInstance().getClipBoard(), getCaretPos(), writespaces); |
| 208 | return true; } |
| 209 | //#endif |
| 210 | //#if TEMPLATES |
| 211 | if (c==cmdTemplate) { new ArchiveList(caretPos, 2, textbox); return true; } |
| 212 | //#endif |
| 213 | return false; |
| 214 | } |
| 215 | } |
no test coverage detected