| 123 | } |
| 124 | |
| 125 | protected void checkPassword(final String password, final OnException onException) { |
| 126 | worker.add(new Worker.Task() { |
| 127 | boolean passwordOK = false; |
| 128 | public void work() { |
| 129 | passwordOK = doc.authenticatePassword(password); |
| 130 | } |
| 131 | public void run() { |
| 132 | if (!passwordOK) { |
| 133 | String password = callback.askPassword(); |
| 134 | if (password != null) |
| 135 | checkPassword(password, onException); |
| 136 | } |
| 137 | else |
| 138 | loadDocument(onException); |
| 139 | } |
| 140 | public void exception(Throwable t) { |
| 141 | ViewerCore.this.documentPath = null; |
| 142 | ViewerCore.this.acceleratorPath = null; |
| 143 | ViewerCore.this.doc = null; |
| 144 | if (onException != null) |
| 145 | onException.run(t); |
| 146 | } |
| 147 | }); |
| 148 | } |
| 149 | |
| 150 | public void refreshMetadata(final OnException onException) { |
| 151 | worker.add(new Worker.Task() { |