| /******************************************************************************* |
| * 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 org.eclipse.jface.dialogs.Dialog; |
| import org.eclipse.swt.SWT; |
| import org.eclipse.swt.events.SelectionAdapter; |
| import org.eclipse.swt.events.SelectionEvent; |
| import org.eclipse.swt.widgets.Composite; |
| import org.eclipse.swt.widgets.Control; |
| import org.eclipse.swt.widgets.Link; |
| import org.eclipse.ui.IWorkbenchWindow; |
| import org.eclipse.ui.PlatformUI; |
| import org.eclipse.ui.statushandlers.AbstractStatusAreaProvider; |
| import org.eclipse.ui.statushandlers.StatusAdapter; |
| |
| /** |
| * Status area provider for sending a bug report via mail. |
| * |
| * @author Maximilian Koegel |
| * |
| */ |
| public class MailBugStatusAreaProvider extends AbstractStatusAreaProvider { |
| |
| /** |
| * {@inheritDoc} |
| */ |
| public Control createSupportArea(final Composite parent, final StatusAdapter statusAdapter) { |
| Link link = new Link(parent, SWT.NONE); |
| IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
| final MailBugHandler bugHandler = new MailBugHandler(window, statusAdapter); |
| link.setText("Please <a>send us a bug report</a>. Clicking\nthe link will create a new mail with\nyour default mail program. Before\nsending the mail please follow the\ninstructions in the mail body."); |
| link.setToolTipText("Mail a bug report"); |
| link.addSelectionListener(new SelectionAdapter() { |
| public void widgetSelected(SelectionEvent e) { |
| bugHandler.execute(); |
| } |
| }); |
| Dialog.applyDialogFont(link); |
| return parent; |
| } |
| |
| } |