Author: scabanovich
Date: 2010-10-20 09:09:36 -0400 (Wed, 20 Oct 2010)
New Revision: 25944
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
12:50:35 UTC (rev 25943)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java 2010-10-20
13:09:36 UTC (rev 25944)
@@ -30,4 +30,5 @@
public static String REPORT_PROBLEM_DESCRIPTION;
public static String REPORT_PROBLEM_NO_DESCRIPTION;
public static String REPORT_PROBLEM_RESULT;
+ public static String REPORT_PROBLEM_COPY_BUTTON;
}
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
12:50:35 UTC (rev 25943)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties 2010-10-20
13:09:36 UTC (rev 25944)
@@ -7,4 +7,5 @@
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
+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.
+REPORT_PROBLEM_COPY_BUTTON=Copy path to clipboard
\ 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
12:50:35 UTC (rev 25943)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2010-10-20
13:09:36 UTC (rev 25944)
@@ -42,6 +42,9 @@
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
@@ -565,9 +568,29 @@
}
private void showConfirmDialog() {
- String filename = logFileName.getText();
+ final String filename = logFileName.getText();
String message = NLS.bind(UIMessages.REPORT_PROBLEM_RESULT, filename);
- MessageDialog.openInformation(problemDescription.getShell(), "Info",
message);
+
+ MessageDialog dialog = new MessageDialog(problemDescription.getShell(),
+ "Info",
+ null,
+ message,
+ MessageDialog.INFORMATION,
+ new String[]{UIMessages.REPORT_PROBLEM_COPY_BUTTON, "Close"},
+ 1) {
+ protected void buttonPressed(int buttonId) {
+ if(buttonId == 0) {
+ Clipboard clipboard= new Clipboard(problemDescription.getShell().getDisplay());
+ try {
+ clipboard.setContents(new String[] { filename }, new Transfer[] {
TextTransfer.getInstance() });
+ } finally {
+ clipboard.dispose();
+ }
+ }
+ super.buttonPressed(buttonId);
+ }
+ };
+ dialog.open();
}
private String formatContent(String content) {