Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 182343
Collapse All | Expand All

(-)profiler/src/org/netbeans/modules/profiler/Bundle.properties (+1 lines)
 Lines 106-111    Link Here 
106
ExportAction_OverwriteFileCaption=Overwrite Existing File
106
ExportAction_OverwriteFileCaption=Overwrite Existing File
107
ExportAction_OverwriteFileMsg=<html><b>File {0} already exists.</b><br><br>Do you want to replace it?</html>
107
ExportAction_OverwriteFileMsg=<html><b>File {0} already exists.</b><br><br>Do you want to replace it?</html>
108
ExportAction_CannotOverwriteFileMsg=File {0} cannot be replaced. Check permissions.
108
ExportAction_CannotOverwriteFileMsg=File {0} cannot be replaced. Check permissions.
109
ExportAction_FileWriteErrorMsg=Unable to write {0} file
109
ExportAction_ExportDialogTitle=Select File or Directory
110
ExportAction_ExportDialogTitle=Select File or Directory
110
ExportAction_ExportDialogButton=Export
111
ExportAction_ExportDialogButton=Export
111
ExportAction_ExportDialogCSVFilter=CSV File (*.csv)
112
ExportAction_ExportDialogCSVFilter=CSV File (*.csv)
(-)profiler/src/org/netbeans/modules/profiler/SaveViewAction.java (-4 / +15 lines)
 Lines 54-64    Link Here 
54
import java.awt.event.ActionListener;
54
import java.awt.event.ActionListener;
55
import java.awt.image.BufferedImage;
55
import java.awt.image.BufferedImage;
56
import java.io.File;
56
import java.io.File;
57
import java.io.FileNotFoundException;
57
import java.io.IOException;
58
import java.io.IOException;
58
import java.text.MessageFormat;
59
import java.text.MessageFormat;
59
import javax.imageio.ImageIO;
60
import javax.imageio.ImageIO;
61
import javax.imageio.stream.FileImageOutputStream;
60
import javax.swing.*;
62
import javax.swing.*;
61
import javax.swing.filechooser.FileFilter;
63
import javax.swing.filechooser.FileFilter;
64
import org.openide.DialogDisplayer;
62
65
63
66
64
class SaveViewAction extends AbstractAction {
67
class SaveViewAction extends AbstractAction {
 Lines 207-218    Link Here 
207
                        pHandle.start();
210
                        pHandle.start();
208
                        
211
                        
209
                        BufferedImage img = (bImage == null) ? viewProvider.getViewImage(visibleArea) : bImage;
212
                        BufferedImage img = (bImage == null) ? viewProvider.getViewImage(visibleArea) : bImage;
210
                        if (img != null) ImageIO.write(img, "png", file); //NOI18N
213
                        FileImageOutputStream stream = new FileImageOutputStream( file );
211
                    } catch (IOException ex) {
214
                        if (img != null) ImageIO.write(img, "png", stream); //NOI18N
212
                        //ex.printStackTrace();
213
                    } catch (OutOfMemoryError e) {
215
                    } catch (OutOfMemoryError e) {
214
                        NetBeansProfiler.getDefaultNB().displayError(OOME_SAVING_MSG);
216
                        NetBeansProfiler.getDefaultNB().displayError(OOME_SAVING_MSG);
215
                    } finally {
217
                    } catch (FileNotFoundException fnfex) {
218
                        NotifyDescriptor descriptor = new NotifyDescriptor.Message( 
219
                        NbBundle.getMessage (SaveViewAction.class, 
220
                                "ExportAction_FileWriteErrorMsg", file.getAbsolutePath ()) , 
221
                        NotifyDescriptor.ERROR_MESSAGE );
222
                        DialogDisplayer.getDefault().notify( descriptor );
223
                    } catch (IOException ex) {
224
                        //ex.printStackTrace();
225
                    }
226
                    finally {
216
                        if (bImage != null) {
227
                        if (bImage != null) {
217
                            bImage.flush();
228
                            bImage.flush();
218
                        }
229
                        }

Return to bug 182343
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo