1 /**********************************************************************
2 * Copyright (c) 2005, 2014 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
.tracecompass
.tmf
.ui
.views
.uml2sd
.handlers
;
15 import org
.eclipse
.swt
.SWT
;
16 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.Activator
;
17 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.ITmfImageConstants
;
18 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.uml2sd
.SDView
;
19 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.uml2sd
.dialogs
.SearchFilterDialog
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.uml2sd
.util
.Messages
;
23 * Action class implementation for 'Finding' of messages/lifelines.
29 public class OpenSDFindDialog
extends BaseSDAction
{
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
37 public static final String ID
= "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFind"; //$NON-NLS-1$
40 * The action definition ID.
42 public static final String ACTION_DEFINITION_ID
= "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
50 public OpenSDFindDialog() {
57 * @param view The view reference
59 public OpenSDFindDialog(SDView view
) {
61 setText(Messages
.SequenceDiagram_Find
+ "..."); //$NON-NLS-1$
62 setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_SEARCH_SEQ
));
64 setActionDefinitionId(ACTION_DEFINITION_ID
);
65 setToolTipText(Messages
.SequenceDiagram_Find
+ "..."); //$NON-NLS-1$
68 // ------------------------------------------------------------------------
70 // ------------------------------------------------------------------------
74 if (getView() == null) {
78 // Disable action while search is ongoing
79 this.setEnabled(false);
82 if ((getView().getExtendedFindProvider() != null) && (getView().getExtendedFindProvider().getFindAction() != null)) {
83 getView().getExtendedFindProvider().getFindAction().run();
84 } else if (getView().getSDFindProvider() != null) {
85 SearchFilterDialog dialog
= new SearchFilterDialog(getView(), getView().getSDFindProvider(), false, SWT
.NORMAL
);
89 // Enable action after finishing the search
90 this.setEnabled(true);