Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 201827
Collapse All | Expand All

(-)src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/UIUtil.java (-6 / +10 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials 
3
 * All rights reserved. This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 44-53 Link Here
44
44
45
/**
45
/**
46
 * Contains UI utility methods.
46
 * Contains UI utility methods.
47
 * <p/>
47
 * 
48
 * 
48
 * @author marcelop
49
 * 
49
 * @author popescu
50
 * @author  Marcelo Paternostro
50
 * @since 0.0.1
51
 * @author  Valentina Popescu
52
 * @author  Paul E. Slauenwhite
53
 * @version April 11, 2008
54
 * @since   August 16, 2006
51
 */
55
 */
52
public class UIUtil
56
public class UIUtil
53
{
57
{
Lines 319-326 Link Here
319
		try
323
		try
320
		{
324
		{
321
			
325
			
322
	    	//Refresh the parent project:
326
	    	//Refresh the file:
323
	    	file.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
327
	    	file.refreshLocal(IResource.DEPTH_ZERO, null);
324
328
325
			if(editorId == null)
329
			if(editorId == null)
326
			{
330
			{
(-)src/org/eclipse/tptp/test/samples/internal/resources/SamplesPluginResourceBundle.java (-2 / +1 lines)
Lines 19-25 Link Here
19
 * 
19
 * 
20
 * 
20
 * 
21
 * @author      Paul E. Slauenwhite
21
 * @author      Paul E. Slauenwhite
22
 * @version     April 10, 2008
22
 * @version     April 11, 2008
23
 * @since       March 15, 2007
23
 * @since       March 15, 2007
24
 */
24
 */
25
public final class SamplesPluginResourceBundle extends NLS {
25
public final class SamplesPluginResourceBundle extends NLS {
Lines 113-119 Link Here
113
	public static String ReportGraph_13;
113
	public static String ReportGraph_13;
114
	public static String ReportGraph_14;
114
	public static String ReportGraph_14;
115
	public static String ReportGraph_15;
115
	public static String ReportGraph_15;
116
	public static String OUTPUT_STREAM_ERROR_;
117
	
116
	
118
	static {
117
	static {
119
		NLS.initializeMessages(BUNDLE_NAME, SamplesPluginResourceBundle.class);
118
		NLS.initializeMessages(BUNDLE_NAME, SamplesPluginResourceBundle.class);
(-)src/org/eclipse/tptp/test/samples/internal/resources/messages.properties (-2 lines)
Lines 116-121 Link Here
116
ReportGraph_14=Expected Fail
116
ReportGraph_14=Expected Fail
117
ReportGraph_15=Expected Inconclusive
117
ReportGraph_15=Expected Inconclusive
118
118
119
OUTPUT_STREAM_ERROR_ = Report generation exception: Unable to close the output stream.
120
121
119
(-)src/org/eclipse/hyades/test/tools/ui/common/internal/report/ReportWindowWizard.java (-41 / +11 lines)
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
    /**
(-)src/org/eclipse/hyades/test/ui/internal/wizard/ReportWizard.java (-14 / +17 lines)
Lines 18-23 Link Here
18
import java.util.List;
18
import java.util.List;
19
19
20
import org.eclipse.core.resources.IFile;
20
import org.eclipse.core.resources.IFile;
21
import org.eclipse.core.resources.IResource;
22
import org.eclipse.core.runtime.CoreException;
21
import org.eclipse.core.runtime.IConfigurationElement;
23
import org.eclipse.core.runtime.IConfigurationElement;
22
import org.eclipse.core.runtime.IProgressMonitor;
24
import org.eclipse.core.runtime.IProgressMonitor;
23
import org.eclipse.core.runtime.Platform;
25
import org.eclipse.core.runtime.Platform;
Lines 41-47 Link Here
41
import org.eclipse.jface.wizard.IWizard;
43
import org.eclipse.jface.wizard.IWizard;
42
import org.eclipse.osgi.util.NLS;
44
import org.eclipse.osgi.util.NLS;
43
import org.eclipse.ui.actions.WorkspaceModifyOperation;
45
import org.eclipse.ui.actions.WorkspaceModifyOperation;
44
import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
45
import org.osgi.framework.Bundle;
46
import org.osgi.framework.Bundle;
46
47
47
/**
48
/**
Lines 51-57 Link Here
51
 * 
52
 * 
52
 * @author  Paul E. Slauenwhite
53
 * @author  Paul E. Slauenwhite
53
 * @author  Patrick Nedelec
54
 * @author  Patrick Nedelec
54
 * @version April 2, 2008
55
 * @version April 11, 2008
55
 * @since   February 1, 2005
56
 * @since   February 1, 2005
56
 */
57
 */
57
public class ReportWizard extends HyadesWizard {
58
public class ReportWizard extends HyadesWizard {
Lines 151-163 Link Here
151
            FinishOperation op = new FinishOperation();
152
            FinishOperation op = new FinishOperation();
152
            getContainer().run(false, false, op);
153
            getContainer().run(false, false, op);
153
            IFile reportFile = op.getReportFile();
154
            IFile reportFile = op.getReportFile();
154
            String editorId = op.getEditorId();
155
            reportSelectionPage.saveWidgetValues();
155
            reportSelectionPage.saveWidgetValues();
156
            if (reportFile == null) {
156
            if (reportFile == null) {
157
                return false;
157
                return false;
158
            }
158
            }
159
            BasicNewResourceWizard.selectAndReveal(reportFile, getWorkbench().getActiveWorkbenchWindow());
159
            
160
            open(reportFile, editorId);
160
            //Attempt to refresh the project containing the report file:
161
            try {
162
            	reportFile.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
163
			} 
164
            catch (CoreException c) {
165
				//Ignore since the project containing the report file could not be refreshed.
166
			}
167
            
168
    		//Attempt to open the Test Perspective:
169
    		TestUIUtilities.openTestPerspective();
170
    		
171
    		//Attempt to open the editor:
172
    		TestUIUtilities.openEditor(reportFile, op.getEditorId());
161
        } catch (InterruptedException e) {
173
        } catch (InterruptedException e) {
162
            UiPlugin.logError(e);
174
            UiPlugin.logError(e);
163
            return false;
175
            return false;
Lines 176-190 Link Here
176
        return true;
188
        return true;
177
    }
189
    }
178
190
179
    private void open(IFile file, String editorId) {
180
181
		//Attempt to open the Test Perspective:
182
		TestUIUtilities.openTestPerspective();
183
		
184
		//Attempt to open the editor:
185
		TestUIUtilities.openEditor(file, editorId);
186
    }
187
188
    class FinishOperation extends WorkspaceModifyOperation {
191
    class FinishOperation extends WorkspaceModifyOperation {
189
        private IFile indexReport = null;
192
        private IFile indexReport = null;
190
        private String editorid = null;
193
        private String editorid = null;

Return to bug 201827