blob: be42d19c26fe40f0cdcd8bd00ce244530181e7f0 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2012 EclipseSource Muenchen GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
******************************************************************************/
package org.eclipse.emf.emfstore.client.ui.errorreporting;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.eclipse.emf.emfstore.common.CommonUtil;
/**
* Error reporting configuration provider with default values.<br/>
* Only the E-Mail address must be configured.
*
* @author emueller
*
*/
public abstract class DefaultMailBugConfigurationProvider implements IMailBugConfigurationProvider {
private static final String EMAIL_BODY = "Thank you for reporting this bug. Please help us to fix the problem by following these steps:\n\n"
+ "1. Give a summary\n"
+ "<Description>\n\n"
+ "2. Describe steps to reproduce the error\n"
+ "\t1. <Step 1>\n" + "\t2. <Step 2>\n\n";
private static final String EMAIL_BODY_ADDITIONAL_TEXT = "3. Paste (Ctrl+v) the content of the clipboard below (parts of the log file have been copied to it)\n"
+ "\t<Content from Log File>";
/**
* {@inheritDoc}
*/
public String getEmailSubject() {
return "EMFStore Error Report";
}
/**
* {@inheritDoc}
*/
public String getEmailBody(boolean errorDiagnosisCaptured) {
StringBuffer body = new StringBuffer(EMAIL_BODY);
if (errorDiagnosisCaptured) {
try {
body.append(URLEncoder.encode(EMAIL_BODY_ADDITIONAL_TEXT, CommonUtil.getEncoding()));
} catch (UnsupportedEncodingException e) {
// ignore
}
}
return body.toString();
}
}