Changeset 12651 for trunk/gli/src/org/greenstone/gatherer
- Timestamp:
- 2006-09-01T14:38:30+12:00 (18 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/DebugStream.java
r8234 r12651 99 99 100 100 101 /** Print a stack trace to the debug stream . */101 /** Print a stack trace to the debug stream, and always to STDERR. */ 102 102 static synchronized public void printStackTrace(Exception exception) 103 103 { -
trunk/gli/src/org/greenstone/gatherer/cdm/MacrosManager.java
r12368 r12651 43 43 import org.greenstone.gatherer.collection.CollectionManager; 44 44 import org.greenstone.gatherer.Configuration; 45 import org.greenstone.gatherer.DebugStream; 45 46 import org.greenstone.gatherer.Dictionary; 46 47 import org.greenstone.gatherer.Gatherer; 47 48 import org.greenstone.gatherer.gui.DesignPaneHeader; 48 49 import org.greenstone.gatherer.gui.GLIButton; 50 49 51 50 52 public class MacrosManager { … … 187 189 188 190 br.close(); 189 } catch (Exception e) { 190 System.err.println("MacrosManager Exception: "+e.getMessage()); 191 } 192 catch (Exception exception) { 193 DebugStream.printStackTrace(exception); 191 194 } 192 195 } … … 194 197 195 198 private void writeMacroFile() { 196 File extra_dm = new File(CollectionManager.getCollectionDirectoryPath()+"macros"+File.separator+"extra.dm");199 File extra_dm_file = new File(CollectionManager.getCollectionDirectoryPath()+"macros"+File.separator+"extra.dm"); 197 200 try { 198 if (!extra_dm .exists()) {199 File parent_dir = extra_dm .getParentFile();201 if (!extra_dm_file.exists()) { 202 File parent_dir = extra_dm_file.getParentFile(); 200 203 parent_dir.mkdirs(); 201 extra_dm .createNewFile();204 extra_dm_file.createNewFile(); 202 205 } 203 206 204 BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(extra_dm ), "UTF-8"));207 BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(extra_dm_file), "UTF-8")); 205 208 String text = macros_textarea.getText(); 206 209 out.write(text, 0, text.length()); … … 208 211 out.flush(); 209 212 out.close(); 210 } catch (Exception e) { 211 System.err.println("MacrosManager Exception: "+e.getMessage()); 213 } 214 catch (Exception exception) { 215 DebugStream.printStackTrace(exception); 212 216 } 213 217 } … … 251 255 undo_button.setEnabled(true); 252 256 } 253 254 } catch (Exception e) {255 System.err.println("MacrosManager Exception: "+e.getMessage());257 } 258 catch (Exception exception) { 259 DebugStream.printStackTrace(exception); 256 260 } 257 261 } 258 262 } 259 263 260 private class RedoListener 261 implements ActionListener { 264 265 private class RedoListener 266 implements ActionListener { 262 267 263 public void actionPerformed(ActionEvent evt) { 264 try { 265 if (undo.canRedo()) { 266 int pos = macros_textarea.getCaretPosition(); 267 undo.redo(); 268 macros_textarea.setCaretPosition(pos+1); 269 macros_textarea.grabFocus(); 270 } 271 if (!undo.canRedo()){ 272 redo_button.setEnabled(false); 273 } 274 else{ 275 redo_button.setEnabled(true); 276 } 277 278 } catch (Exception e) { 279 System.err.println("MacrosManager Exception: "+e.getMessage()); 280 } 281 } 282 } 283 284 } 285 286 287 268 public void actionPerformed(ActionEvent evt) { 269 try { 270 if (undo.canRedo()) { 271 int pos = macros_textarea.getCaretPosition(); 272 undo.redo(); 273 macros_textarea.setCaretPosition(pos+1); 274 macros_textarea.grabFocus(); 275 } 276 if (!undo.canRedo()){ 277 redo_button.setEnabled(false); 278 } 279 else{ 280 redo_button.setEnabled(true); 281 } 282 } 283 catch (Exception exception) { 284 DebugStream.printStackTrace(exception); 285 } 286 } 287 } 288 } 288 289 }
Note:
See TracChangeset
for help on using the changeset viewer.