Index: core/src/org/netbeans/core/output/OutputTabTerm.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/output/OutputTabTerm.java,v retrieving revision 1.52 diff -u -r1.52 OutputTabTerm.java --- core/src/org/netbeans/core/output/OutputTabTerm.java 1 Mar 2002 08:50:42 -0000 1.52 +++ core/src/org/netbeans/core/output/OutputTabTerm.java 20 Mar 2002 17:27:05 -0000 @@ -7,11 +7,10 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun * Microsystems, Inc. All Rights Reserved. */ - package org.netbeans.core.output; import java.util.WeakHashMap; @@ -75,12 +74,10 @@ import org.netbeans.core.compiler.*; import org.netbeans.lib.terminalemulator.*; + /** - * * @author Pavel Buzek, Ales Kemr, Radek Matous - * */ - public class OutputTabTerm extends TopComponent implements InputOutput, WellKnownModeNames, TopComponentListener { @@ -136,7 +133,7 @@ fos.write(s.getBytes()); fos.close(); } catch (java.io.IOException e) { - e.printStackTrace(); + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } @@ -404,7 +401,7 @@ try { inReader = new PipedReader(inWriter); } catch (java.io.IOException ex) { - TopManager.getDefault().notifyException(ex); + ErrorManager.getDefault().notify(ex); return null; } return inReader; @@ -1147,7 +1144,9 @@ if ( redirWriter != null ) try { redirWriter.flush(); - } catch (IOException e) {} + } catch (IOException e) { + // XXX really ignore? + } } public void close() { @@ -1159,25 +1158,28 @@ /** ----------------- Private helper methods -----------------*/ private void redirOpen() { + File redirFile = null; try { File redirDirFile = outputSettings ().getDirectory(); String name = ""; if (tab != null) { name = tab.getName(); - int ispace = tab.getName().indexOf(' '); + int ispace = name.indexOf(' '); if (ispace > 0) name = name.substring( 0, ispace ); } + name = name.replace(File.separatorChar, '_'); name = name + REDIR_EXT; - File redirFile = new File (redirDirFile, name); + redirFile = new File (redirDirFile, name); redirFile.createNewFile(); redirWriter = new FileWriter(redirFile.getAbsolutePath(),true); redirOpened = true; } catch (Exception e) { - e.printStackTrace(); + ErrorManager.getDefault().annotate(e, ErrorManager.UNKNOWN, "Redir file: " + redirFile, null, null, null); // NOI18N + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } @@ -1187,27 +1189,29 @@ redirWriter.close(); redirWriter = null; } catch (IOException e) { - e.printStackTrace(); + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } private void redirPrint(char[] chars,int offs, int len) { if ( redirWriter == null ) redirOpen(); + if (redirWriter == null) return; try { redirWriter.write(chars, offs, len); } catch (IOException e) { - e.printStackTrace(); + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } private void redirPrint(String str) { if ( redirWriter == null ) redirOpen(); + if (redirWriter == null) return; try { redirWriter.write(str); } catch (IOException e) { - e.printStackTrace(); + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } @@ -1327,7 +1331,9 @@ if (aterm.getHistoryBuffSize () - aterm.getHistorySize () > 0) { try { reset (); - } catch (Exception exc) {} + } catch (Exception exc) { + // XXX really ignore? + } } } @@ -1450,12 +1456,14 @@ try { tab.inWriter.write(c); } catch (Exception x) { + // XXX really ignore? } } public void sendChars(char[] c, int offset, int n) { try { tab.inWriter.write(c, offset, n); } catch (Exception x) { + // XXX really ignore? } } } @@ -1465,6 +1473,7 @@ updateCopyCutAction (); if (csa == null) { try { + // XXX what is wrong with SystemAction.get(PopupAction.class)? Class popup = Class.forName("org.openide.actions.PopupAction"); // NOI18N csa = (CallbackSystemAction) CallbackSystemAction.get(popup); } catch (ClassNotFoundException e) {