Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 129842 Details for
Bug 266114
Add Export feature to sleak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
export errors patch v2
patch.txt (text/plain), 3.95 KB, created by
Jacek Pospychala
on 2009-03-25 10:24:15 EDT
(
hide
)
Description:
export errors patch v2
Filename:
MIME Type:
Creator:
Jacek Pospychala
Created:
2009-03-25 10:24:15 EDT
Size:
3.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt.tools >Index: Sleak/org/eclipse/swt/tools/internal/Sleak.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt.tools/Sleak/org/eclipse/swt/tools/internal/Sleak.java,v >retrieving revision 1.8 >diff -u -r1.8 Sleak.java >--- Sleak/org/eclipse/swt/tools/internal/Sleak.java 5 Sep 2008 14:02:30 -0000 1.8 >+++ Sleak/org/eclipse/swt/tools/internal/Sleak.java 25 Mar 2009 14:18:49 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 IBM Corporation and others. >+ * Copyright (c) 2007, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -27,7 +27,7 @@ > Shell shell; > List list; > Canvas canvas; >- Button start, stop, check; >+ Button start, stop, check, print; > Text text; > Label label; > >@@ -90,6 +90,8 @@ > start.addListener (SWT.Selection, new Listener () { > public void handleEvent (Event event) { > refreshAll (); >+ if (print.getSelection()) >+ exportDifference (); > } > }); > stop = new Button (shell, SWT.PUSH); >@@ -97,8 +99,13 @@ > stop.addListener (SWT.Selection, new Listener () { > public void handleEvent (Event event) { > refreshDifference (); >+ if (print.getSelection()) >+ exportDifference (); > } > }); >+ print = new Button (shell, SWT.CHECK); >+ print.setText ("Dump to file"); >+ print.setToolTipText ("Dumps Snaps/Diffs stack traces to file"); > label = new Label (shell, SWT.BORDER); > label.setText ("0 object(s)"); > shell.addListener (SWT.Resize, new Listener () { >@@ -185,6 +192,35 @@ > layout (); > } > >+void exportDifference () { >+ File file = new File(Long.toString(System.currentTimeMillis()) + ".sleakdump"); >+ PrintStream pw = null; >+ try { >+ pw = new PrintStream(new FileOutputStream(file)); >+ } catch (FileNotFoundException e) { >+ MessageBox dialog = new MessageBox (shell, SWT.ICON_WARNING | SWT.OK); >+ dialog.setText (shell.getText ()); >+ dialog.setMessage (e.getMessage()+" Difference will be printed to standard output."); >+ dialog.open (); >+ pw = System.out; >+ } >+ try { >+ for (int i=0; i<objects.length; i++) { >+ pw.println(objects [i].toString()); >+ errors[i].printStackTrace(pw); >+ pw.println(); >+ } >+ } finally { >+ if (pw != null && pw != System.out) >+ pw.close(); >+ } >+ >+ MessageBox dialog = new MessageBox (shell, SWT.ICON_WARNING | SWT.OK); >+ dialog.setText (shell.getText ()); >+ dialog.setMessage ("Difference exported to file "+file.getAbsolutePath()); >+ dialog.open (); >+} >+ > void toggleStackTrace () { > refreshObject (); > layout (); >@@ -304,13 +340,15 @@ > Point size2 = stop.computeSize (SWT.DEFAULT, SWT.DEFAULT); > Point size3 = check.computeSize (SWT.DEFAULT, SWT.DEFAULT); > Point size4 = label.computeSize (SWT.DEFAULT, SWT.DEFAULT); >- width = Math.max (size1.x, Math.max (size2.x, Math.max (size3.x, width))); >+ Point size5 = print.computeSize(SWT.DEFAULT, SWT.DEFAULT); >+ width = Math.max (size1.x, Math.max (size2.x, Math.max (size3.x, Math.max(size5.x, width)))); > width = Math.max (64, Math.max (size4.x, list.computeSize (width, SWT.DEFAULT).x)); > start.setBounds (0, 0, width, size1.y); > stop.setBounds (0, size1.y, width, size2.y); >- check.setBounds (0, size1.y + size2.y, width, size3.y); >+ print.setBounds(0, size1.y + size2.y, width, size5.y); >+ check.setBounds (0, size1.y + size2.y + size5.y, width, size3.y); > label.setBounds (0, rect.height - size4.y, width, size4.y); >- int height = size1.y + size2.y + size3.y; >+ int height = size1.y + size2.y + size3.y + size5.y; > list.setBounds (0, height, width, rect.height - height - size4.y); > text.setBounds (width, 0, rect.width - width, rect.height); > canvas.setBounds (width, 0, rect.width - width, rect.height);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 266114
:
128365
| 129842 |
129844