Author: scabanovich
Date: 2010-10-20 08:40:28 -0400 (Wed, 20 Oct 2010)
New Revision: 25941
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
Log:
JBDS-1206
https://jira.jboss.org/browse/JBDS-1206
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java 2010-10-20
11:12:54 UTC (rev 25940)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java 2010-10-20
12:40:28 UTC (rev 25941)
@@ -26,4 +26,8 @@
public static String PROPERTIES_EDITOR_EXPRESSION;
public static String PROPERTIES_EDITOR_ILLEGAL_NAME_EXPRESSION;
public static String PROPERTIES_EDITOR_ILLEGAL_VALUE_EXPRESSION;
+
+ public static String REPORT_PROBLEM_DESCRIPTION;
+ public static String REPORT_PROBLEM_NO_DESCRIPTION;
+ public static String REPORT_PROBLEM_RESULT;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties 2010-10-20
11:12:54 UTC (rev 25940)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties 2010-10-20
12:40:28 UTC (rev 25941)
@@ -3,4 +3,8 @@
PROPERTIES_EDITOR_EXPRESSION=Expression
PROPERTIES_EDITOR_ILLEGAL_NAME_EXPRESSION=Illegal name expression: {0}
PROPERTIES_EDITOR_ILLEGAL_VALUE_EXPRESSION=Illegal value expression: {0}
-PROPERTIES_EDITOR_FILTER_MATCHES=Filter matched {0} out of {1} items.
\ No newline at end of file
+PROPERTIES_EDITOR_FILTER_MATCHES=Filter matched {0} out of {1} items.
+
+REPORT_PROBLEM_DESCRIPTION=This wizard takes the description and info below and in
addition collects various logs from eclipse and creates a zipped file which can be
attached to issues or emails when reporting problems.
+REPORT_PROBLEM_NO_DESCRIPTION=Description must be set.
+REPORT_PROBLEM_RESULT=Logs and your entered information have been gathered and stored at:
\n{0},\n now attach this to your issue or email discussing the problem.
\ No newline at end of file
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 2010-10-20
11:12:54 UTC (rev 25940)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2010-10-20
12:40:28 UTC (rev 25941)
@@ -37,6 +37,8 @@
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
@@ -57,6 +59,7 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.about.ISystemSummarySection;
@@ -74,18 +77,21 @@
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
+import org.jboss.tools.common.model.ui.messages.UIMessages;
import org.jboss.tools.common.model.ui.widgets.ReferenceListener;
import org.jboss.tools.common.model.ui.widgets.TextAndReferenceComponent;
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.model.ui.wizards.query.IQueryDialog;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
public class ReportProblemWizard extends AbstractQueryWizard {
public ReportProblemWizard() {
setView(new ReportProblemWizardView());
-
+ getView().setMessage(UIMessages.REPORT_PROBLEM_DESCRIPTION);
}
+
}
/**
@@ -192,11 +198,22 @@
getCommandBar().setEnabled(OK, !isMessageEmpty());
}
+ void validate() {
+ if(problemDescription == null || problemDescription.isDisposed()) return;
+ String text = problemDescription.getText();
+ if(text == null || text.trim().length() == 0) {
+ setErrorMessage(UIMessages.REPORT_PROBLEM_NO_DESCRIPTION);
+ } else {
+ setErrorMessage(null);
+ setMessage(UIMessages.REPORT_PROBLEM_DESCRIPTION);
+ }
+ }
+
/* (non-Javadoc)
* @see
org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView#getPreferredSize()
*/
public Point getPreferredSize() {
- return new Point(400, 500);
+ return new Point(750, 500);
}
/* (non-Javadoc)
@@ -456,6 +473,7 @@
problemDescription.setLayoutData(new GridData(GridData.FILL_BOTH));
problemDescription.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
+ validate();
updateBar();
}
});
@@ -471,6 +489,11 @@
infoSupport.setLayout(getDefaultSupportLayout());
Control c = infoSupport.createControl(g);
c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ infoSupport.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ validate();
+ }
+ });
}
private void createStackTracesLabelControl(Composite parent) {
@@ -529,6 +552,7 @@
// Submit.getInstance().submit(reportText, addRedHatLog);
// ProblemReportingHelper.buffer.report(text, email, other,
// addRedHatLog);
+ showConfirmDialog();
} catch (IOException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
@@ -540,6 +564,11 @@
}
}
+ private void showConfirmDialog() {
+ String filename = logFileName.getText();
+ String message = NLS.bind(UIMessages.REPORT_PROBLEM_RESULT, filename);
+ MessageDialog.openInformation(problemDescription.getShell(), "Info",
message);
+ }
private String formatContent(String content) {
StringBuffer sb = new StringBuffer();