1 /**********************************************************************
2 * Copyright (c) 2005, 2008 IBM Corporation and others.
3 * Copyright (c) 2011, 2012 Ericsson.
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
11 * IBM - Initial API and implementation
12 * Bernd Hufmann - Updated for TMF
13 **********************************************************************/
14 package org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.handlers
;
16 import org
.eclipse
.jface
.action
.Action
;
17 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.ITmfImageConstants
;
18 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.Activator
;
19 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.SDView
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.dialogs
.SearchFilterDialog
;
21 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.util
.SDMessages
;
22 import org
.eclipse
.swt
.SWT
;
25 * Action class implementation for 'Finding' of messages/lifelines.
31 public class OpenSDFindDialog
extends Action
{
33 // ------------------------------------------------------------------------
35 // ------------------------------------------------------------------------
39 public final static String ID
= "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFind"; //$NON-NLS-1$
41 * The action definition ID.
43 public final static String ACTION_DEFINITION_ID
= "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
45 // ------------------------------------------------------------------------
47 // ------------------------------------------------------------------------
49 * The sequence diagram view reference
51 protected SDView fView
;
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
59 public OpenSDFindDialog() {
66 * @param view The view reference
68 public OpenSDFindDialog(SDView view
) {
69 super(SDMessages
._41
);
70 setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_SEARCH_SEQ
));
72 setActionDefinitionId(ACTION_DEFINITION_ID
);
73 setToolTipText(SDMessages
._41
);
77 // ------------------------------------------------------------------------
79 // ------------------------------------------------------------------------
82 * @see org.eclipse.jface.action.Action#run()
90 // Disable action while search is ongoing
91 this.setEnabled(false);
94 if ((fView
.getExtendedFindProvider() != null) && (fView
.getExtendedFindProvider().getFindAction() != null)) {
95 fView
.getExtendedFindProvider().getFindAction().run();
96 } else if (fView
.getSDFindProvider() != null) {
97 SearchFilterDialog dialog
= new SearchFilterDialog(fView
, fView
.getSDFindProvider(), false, SWT
.NORMAL
);
101 // Enable action after finishing the search
102 this.setEnabled(true);
107 * Sets the active SD view.
109 * @param view The SD view.
111 public void setView(SDView view
) {