Author: max.andersen(a)jboss.com
Date: 2007-07-04 19:43:20 -0400 (Wed, 04 Jul 2007)
New Revision: 2294
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.properties
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
Log:
EXIN-240 more simplifications
JBIDE-560 fixed bug in abstractquerywizard message resource handling
fix various typos.
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2007-07-04
22:31:07 UTC (rev 2293)
+++
trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2007-07-04
23:43:20 UTC (rev 2294)
@@ -636,8 +636,9 @@
SharableVPEEditor.show_comments=Show Comments in Visual Editor
-ReportProblemWizard.WindowTitle=Report Problems
+ReportProblemWizard.WindowTitle=Report Problemsssss
ReportProblemWizard.Title=Red Hat Developer Studio
+ReportProblemWizard.Message=Creates a zip file with information useful when reporting and
debugging issues
SharableImportJSFProject.Register_Web_Context_in_server.xml=Register Web Context in
server.xml
SharableImportProject.Register_Web_Context_in_server.xml=Register Web Context in
server.xml
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.properties 2007-07-04
22:31:07 UTC (rev 2293)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.properties 2007-07-04
23:43:20 UTC (rev 2294)
@@ -22,12 +22,15 @@
strutsConfig.11=Struts Config 1.1
textProblemName=XML Problem
-strutsProblemName=Struts Verifification Problem
+strutsProblemName=Struts Verification Problem
actionSets.redhatMenu.label=Red Hat
actionSets.redhatMenu.description=Red Hat
actionSets.licenseMenu.label=License
-action.reportproblem.label=Report Problems
+action.reportproblem.label=Report Problem
+
+
+
action.visitsite.label=Red Hat Web Site
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java 2007-07-04
22:31:07 UTC (rev 2293)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java 2007-07-04
23:43:20 UTC (rev 2294)
@@ -33,21 +33,14 @@
public void run(IAction action) {
ClassLoaderUtil.init();
- try {
- ReportProblemWizard wizard = new ReportProblemWizard();
- Properties p = new Properties();
- p.setProperty("help", "ReportProblemWizard");
- wizard.setObject(p);
- wizard.execute();
- } catch (Exception t) {
- ModelUIPlugin.getPluginLog().logError( "Report Problems Wizard failed.",
t);
- }
+
+ ReportProblemWizard wizard = new ReportProblemWizard();
+ Properties p = new Properties();
+ p.setProperty("help", "ReportProblemWizard");
+ wizard.setObject(p);
+ wizard.execute();
}
public void selectionChanged(IAction action, ISelection selection) {}
-// protected String getUrl() {
-// return "http://www.redhat.com/strutsfeedback.htm";
-// }
-
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2007-07-04
22:31:07 UTC (rev 2293)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2007-07-04
23:43:20 UTC (rev 2294)
@@ -79,20 +79,18 @@
import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
-import org.osgi.framework.Bundle;
public class ReportProblemWizard extends AbstractQueryWizard {
public ReportProblemWizard() {
setView(new ReportProblemWizardView());
+
}
}
class ReportProblemWizardView extends AbstractQueryWizardView {
- static final char SEPARATOR = System.getProperty ("file.separator").charAt
(0);
-
/** LOG_DATE_FORMAT */
final private SimpleDateFormat LOG_DATE_FORMAT = new SimpleDateFormat(
"dd_MMM_yyyy__HH_mm_ss_SSS");
@@ -181,7 +179,7 @@
/**
*
*/
- private byte[] getStackTracesFile() {
+ private byte[] getEclipseLogContent() {
StringBuffer sb = new StringBuffer();
try {
@@ -204,7 +202,7 @@
/**
*
*/
- private byte[] getUsercommentFile() {
+ private byte[] getUserCommentContent() {
StringBuffer sb = new StringBuffer();
sb = sb.append("email : ").append(
@@ -255,7 +253,7 @@
}
/*
- * Appends the contents of all extentions to the configurationLogSections
+ * Appends the contents of all extensions to the configurationLogSections
* extension point.
*/
private void appendExtensions(PrintWriter writer) {
@@ -290,7 +288,7 @@
/**
*
*/
- private byte[] getEclipsePropertiesFile() {
+ private byte[] getEclipsePropertiesContent() {
StringWriter out = new StringWriter();
PrintWriter writer = new PrintWriter(out);
writer.println(NLS.bind(WorkbenchMessages.SystemSummary_timeStamp,
@@ -307,47 +305,35 @@
* create a ZIP file contain following files:
*/
private void createZipFile() throws IOException {
- byte tempBuffer[];
- String[] fileNames = new String[] { "stacktrace.txt",
- "usercomment.txt", "eclipse.properties" };
-
- //
- // ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
- //
- File filename = new File(logFileName.getText());
+ File zipFilename = new File(logFileName.getText());
- ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(filename));
- for (int i = 0; i < fileNames.length; i++) {
+ ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(zipFilename));
+ try {
+ addFileToZip(getEclipseLogContent(), "eclipse.log", zout);
+ addFileToZip(getUserCommentContent(), "usercomment.txt", zout);
+ addFileToZip(getEclipsePropertiesContent(), "eclipse.properties", zout);
- switch (i) {
- case 0:
- tempBuffer = getStackTracesFile();
- break;
- case 1:
- tempBuffer = getUsercommentFile();
- break;
- case 2:
- tempBuffer = getEclipsePropertiesFile();
- break;
- default:
- tempBuffer = "Unknown data".getBytes();
-
- }
-
- ZipEntry e = new ZipEntry(fileNames[i].replace(File.separatorChar, SEPARATOR));
- zout.putNextEntry(e);
- zout.write(tempBuffer, 0, tempBuffer.length);
- zout.closeEntry();
+ ModelUIPlugin.getDefault().logInfo("Wrote diagnostic info to " +
zipFilename);
+ } finally {
+ zout.close();
}
- zout.close();
- ModelUIPlugin.getDefault().logInfo("Wrote diagnostic info to " + filename);
+
//
// return byteBuffer.toString();
//
}
+ private void addFileToZip(byte[] tempBuffer, String fileName,
+ ZipOutputStream zout) throws IOException {
+
+ ZipEntry e = new ZipEntry(fileName);
+ zout.putNextEntry(e);
+ zout.write(tempBuffer, 0, tempBuffer.length);
+ zout.closeEntry();
+ }
+
/**
* Get a filename for zip-file
*