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
9 * IBM - Initial API and implementation
10 * Bernd Hufmann - Updated for TMF
11 **********************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.handlers
;
15 import org
.eclipse
.jface
.action
.Action
;
16 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.ITmfImageConstants
;
17 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.Activator
;
18 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.SDView
;
19 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.dialogs
.SearchFilterDialog
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.views
.uml2sd
.util
.SDMessages
;
21 import org
.eclipse
.swt
.SWT
;
24 * Action class implementation for 'Finding' of messages/lifelines.
30 public class OpenSDFindDialog
extends Action
{
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
38 public final static String ID
= "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFind"; //$NON-NLS-1$
40 * The action definition ID.
42 public final static String ACTION_DEFINITION_ID
= "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
48 * The sequence diagram view reference
50 protected SDView fView
;
52 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
58 public OpenSDFindDialog() {
65 * @param view The view reference
67 public OpenSDFindDialog(SDView view
) {
68 super(SDMessages
._41
);
69 setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_SEARCH_SEQ
));
71 setActionDefinitionId(ACTION_DEFINITION_ID
);
72 setToolTipText(SDMessages
._41
);
76 // ------------------------------------------------------------------------
78 // ------------------------------------------------------------------------
81 * @see org.eclipse.jface.action.Action#run()
89 // Disable action while search is ongoing
90 this.setEnabled(false);
93 if ((fView
.getExtendedFindProvider() != null) && (fView
.getExtendedFindProvider().getFindAction() != null)) {
94 fView
.getExtendedFindProvider().getFindAction().run();
95 } else if (fView
.getSDFindProvider() != null) {
96 SearchFilterDialog dialog
= new SearchFilterDialog(fView
, fView
.getSDFindProvider(), false, SWT
.NORMAL
);
100 // Enable action after finishing the search
101 this.setEnabled(true);
106 * Sets the active SD view.
108 * @param view The SD view.
110 public void setView(SDView view
) {