| 1 | /********************************************************************** |
| 2 | * Copyright (c) 2016 EfficiOS Inc. |
| 3 | * |
| 4 | * All rights reserved. This program and the accompanying materials are |
| 5 | * made available under the terms of the Eclipse Public License v1.0 which |
| 6 | * accompanies this distribution, and is available at |
| 7 | * http://www.eclipse.org/legal/epl-v10.html |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | package org.eclipse.tracecompass.tmf.ui.views; |
| 11 | |
| 12 | import java.text.MessageFormat; |
| 13 | |
| 14 | import org.eclipse.jface.action.Action; |
| 15 | import org.eclipse.jface.action.IAction; |
| 16 | import org.eclipse.tracecompass.internal.tmf.ui.Messages; |
| 17 | |
| 18 | /** |
| 19 | * Action to instantiate a new instance of views that support it. |
| 20 | * @author Jonathan Rajotte Julien |
| 21 | * @since 2.2 |
| 22 | */ |
| 23 | public class NewTmfViewAction extends Action { |
| 24 | |
| 25 | /** |
| 26 | * Creates a new <code>NewTmfViewAction</code>. |
| 27 | * |
| 28 | * @param view |
| 29 | * The view for which the action is created |
| 30 | */ |
| 31 | public NewTmfViewAction(TmfView view) { |
| 32 | super(MessageFormat.format(Messages.TmfView_NewTmfViewNameText, view.getTitle().toLowerCase()), IAction.AS_PUSH_BUTTON); |
| 33 | setToolTipText(MessageFormat.format(Messages.TmfView_NewTmfViewToolTipText, view.getTitle())); |
| 34 | } |
| 35 | } |