| 1 | /********************************************************************** |
| 2 | * Copyright (c) 2005, 2012 IBM Corporation, Ericsson |
| 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
| 7 | * |
| 8 | * Contributors: |
| 9 | * IBM - Initial API and implementation |
| 10 | * Bernd Hufmann - Updated for TMF |
| 11 | **********************************************************************/ |
| 12 | |
| 13 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers; |
| 14 | |
| 15 | import org.eclipse.jface.action.Action; |
| 16 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; |
| 17 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.MinMaxDialog; |
| 18 | import org.eclipse.ui.IViewPart; |
| 19 | |
| 20 | /** |
| 21 | * Action class implementation to configure minimum and maximum time range values. |
| 22 | * |
| 23 | * @version 1.0 |
| 24 | * @author sveyrier |
| 25 | * |
| 26 | */ |
| 27 | public class ConfigureMinMax extends Action { |
| 28 | |
| 29 | // ------------------------------------------------------------------------ |
| 30 | // Attributes |
| 31 | // ------------------------------------------------------------------------ |
| 32 | /** |
| 33 | * The corresponding sequence diagram view reference. |
| 34 | */ |
| 35 | protected SDView fView = null; |
| 36 | |
| 37 | // ------------------------------------------------------------------------ |
| 38 | // Constructors |
| 39 | // ------------------------------------------------------------------------ |
| 40 | |
| 41 | /** |
| 42 | * Standard constructor. |
| 43 | * |
| 44 | * @param view The sequence diagram view for the action |
| 45 | */ |
| 46 | public ConfigureMinMax(IViewPart view) { |
| 47 | super(); |
| 48 | if (view instanceof SDView) { |
| 49 | fView = (SDView) view; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // ------------------------------------------------------------------------ |
| 54 | // Methods |
| 55 | // ------------------------------------------------------------------------ |
| 56 | |
| 57 | /* |
| 58 | * (non-Javadoc) |
| 59 | * @see org.eclipse.jface.action.Action#run() |
| 60 | */ |
| 61 | @Override |
| 62 | public void run() { |
| 63 | if ((fView != null) && (fView.getSDWidget() != null)) { |
| 64 | MinMaxDialog minMax = new MinMaxDialog(fView.getSite().getShell(), fView.getSDWidget()); |
| 65 | minMax.open(); |
| 66 | } |
| 67 | } |
| 68 | } |