|
Lines 54-60
Link Here
|
| 54 |
import org.eclipse.tptp.platform.report.drivers.html.DHtmlWriter; |
54 |
import org.eclipse.tptp.platform.report.drivers.html.DHtmlWriter; |
| 55 |
import org.eclipse.tptp.platform.report.drivers.html.DHtmlWriterException; |
55 |
import org.eclipse.tptp.platform.report.drivers.html.DHtmlWriterException; |
| 56 |
import org.eclipse.tptp.platform.report.drivers.html.DOneDocumentPolicy; |
56 |
import org.eclipse.tptp.platform.report.drivers.html.DOneDocumentPolicy; |
| 57 |
import org.eclipse.tptp.platform.report.drivers.internal.Item; |
|
|
| 58 |
import org.eclipse.tptp.platform.report.extension.internal.DExtensible; |
57 |
import org.eclipse.tptp.platform.report.extension.internal.DExtensible; |
| 59 |
import org.eclipse.tptp.platform.report.tools.internal.IDIImageProvider; |
58 |
import org.eclipse.tptp.platform.report.tools.internal.IDIImageProvider; |
| 60 |
import org.eclipse.tptp.test.samples.internal.resources.SamplesPluginImageManager; |
59 |
import org.eclipse.tptp.test.samples.internal.resources.SamplesPluginImageManager; |
|
Lines 71-77
Link Here
|
| 71 |
* |
70 |
* |
| 72 |
* @author Patrick Nedelec |
71 |
* @author Patrick Nedelec |
| 73 |
* @author Paul E. Slauenwhite |
72 |
* @author Paul E. Slauenwhite |
| 74 |
* @version April 10, 2008 |
73 |
* @version April 11, 2008 |
| 75 |
* @since June 6, 2005 |
74 |
* @since June 6, 2005 |
| 76 |
*/ |
75 |
*/ |
| 77 |
public class ReportWindowWizard extends ReportGeneratorWizard { |
76 |
public class ReportWindowWizard extends ReportGeneratorWizard { |
|
Lines 166-173
Link Here
|
| 166 |
*/ |
165 |
*/ |
| 167 |
public IFile generate(IProgressMonitor monitor) throws Exception { |
166 |
public IFile generate(IProgressMonitor monitor) throws Exception { |
| 168 |
|
167 |
|
| 169 |
FileOutputStream outputStream = null; |
|
|
| 170 |
|
| 171 |
try { |
168 |
try { |
| 172 |
|
169 |
|
| 173 |
monitor.beginTask("", 4); //$NON-NLS-1$ |
170 |
monitor.beginTask("", 4); //$NON-NLS-1$ |
|
Lines 198-242
Link Here
|
| 198 |
|
195 |
|
| 199 |
// create the main document |
196 |
// create the main document |
| 200 |
DDocument doc = new DDocument("report_document", reportFile.getName()); //$NON-NLS-1$ |
197 |
DDocument doc = new DDocument("report_document", reportFile.getName()); //$NON-NLS-1$ |
| 201 |
for (int i=0; i< docs.length; i++) |
198 |
for (int i=0; i< docs.length; i++){ |
| 202 |
doc.addChild(docs[i]); |
199 |
doc.addChild(docs[i]); |
|
|
200 |
} |
| 203 |
|
201 |
|
| 204 |
//DXmlDocumentWriter dxdw = new DXmlDocumentWriter(); |
|
|
| 205 |
|
| 206 |
//- Writes the .rxml file: |
| 207 |
File f = new File(reportFile.getLocation().toOSString()); |
| 208 |
//outputStream = new FileOutputStream(f); |
| 209 |
//dxdw.write(outputStream, docs); |
| 210 |
monitor.worked(1); |
202 |
monitor.worked(1); |
| 211 |
|
203 |
|
| 212 |
//- Writes the .html file: |
204 |
//- Writes the .html file: |
| 213 |
DDocument[] documents = new DDocument[1]; |
205 |
DDocument[] documents = new DDocument[1]; |
| 214 |
documents[0] = doc; |
206 |
documents[0] = doc; |
| 215 |
//TODO: because NPE |
207 |
|
| 216 |
generateHtml(documents, f); |
208 |
generateHtml(documents, new File(reportFile.getLocation().toOSString())); |
|
|
209 |
|
| 217 |
monitor.worked(1); |
210 |
monitor.worked(1); |
| 218 |
|
211 |
|
| 219 |
// opens the document in a view |
|
|
| 220 |
// IPreferenceStore store = UiPlugin.getDefault().getPreferenceStore(); |
| 221 |
// |
| 222 |
// if (store.getBoolean(TestUI.REPORT_OPEN_EDITOR)) |
| 223 |
// { |
| 224 |
// |
| 225 |
// ReportView view = (ReportView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ReportView.ID); |
| 226 |
// if(view!=null) { |
| 227 |
// view.setDocument(doc); |
| 228 |
// view.setFocus();} |
| 229 |
// } |
| 230 |
return reportFile; |
212 |
return reportFile; |
| 231 |
} finally { |
213 |
} |
| 232 |
try { |
214 |
finally { |
| 233 |
if (outputStream != null) { |
|
|
| 234 |
outputStream.close(); |
| 235 |
} |
| 236 |
} catch (Throwable e) { |
| 237 |
throw new Exception(SamplesPluginResourceBundle.OUTPUT_STREAM_ERROR_); |
| 238 |
} |
| 239 |
|
| 240 |
monitor.done(); |
215 |
monitor.done(); |
| 241 |
} |
216 |
} |
| 242 |
} |
217 |
} |
|
Lines 248-261
Link Here
|
| 248 |
super(wh, basePath, imgp); |
223 |
super(wh, basePath, imgp); |
| 249 |
} |
224 |
} |
| 250 |
|
225 |
|
| 251 |
public void doMethod(DLink item, DExtensible ext, Object arg) throws DHtmlWriterException { |
226 |
public void doMethod(DLink item, DExtensible ext, Object arg) throws DHtmlWriterException { |
| 252 |
|
227 |
getWriter().doChildrenItem(item, getWriter().getItem(item),ext,arg); |
| 253 |
Item hitem = getWriter().getItem(item); |
|
|
| 254 |
//getWriter().updateStyleVariables(item); |
| 255 |
getWriter().doChildrenItem(item, hitem,ext,arg); |
| 256 |
} |
228 |
} |
| 257 |
|
|
|
| 258 |
|
| 259 |
} |
229 |
} |
| 260 |
|
230 |
|
| 261 |
/** |
231 |
/** |