ss: Move plugins to Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / OpenSDFindDialog.java
index fa5f3b121ccd5a80482a0a61e11615582f91a06b..92cffd8713d81a51508040610180c2f1954a113b 100755 (executable)
@@ -1,54 +1,45 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- * 
+ * Copyright (c) 2005, 2013 IBM Corporation, Ericsson
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ *
+ * Contributors:
+ *     IBM - Initial API and implementation
+ *     Bernd Hufmann - Updated for TMF
  **********************************************************************/
+
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
 import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.SearchFilterDialog;
-import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
 import org.eclipse.swt.SWT;
 
 /**
  * Action class implementation for 'Finding' of messages/lifelines.
- * 
+ *
  * @version 1.0
  * @author sveyrier
- * 
+ *
  */
-public class OpenSDFindDialog extends Action {
-    
+public class OpenSDFindDialog extends BaseSDAction {
+
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
     /**
      * The action ID.
      */
-    public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFind"; //$NON-NLS-1$
-    /**
-     * The action definition ID.
-     */
-    public final static String ACTION_DEFINITION_ID = "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
+    public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFind"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
     /**
-     * The sequence diagram view reference
+     * The action definition ID.
      */
-    protected SDView fView;
+    public static final String ACTION_DEFINITION_ID = "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -61,40 +52,37 @@ public class OpenSDFindDialog extends Action {
     }
 
     /**
-     * Constructor 
-     * 
-     * @param theView The view reference
+     * Constructor
+     *
+     * @param view The view reference
      */
-    public OpenSDFindDialog(SDView theView) {
-        super(SDMessages._41);
-        setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_SEQ));
+    public OpenSDFindDialog(SDView view) {
+        super(view);
+        setText(Messages.SequenceDiagram_Find + "..."); //$NON-NLS-1$
+        setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_SEQ));
         setId(ID);
         setActionDefinitionId(ACTION_DEFINITION_ID);
-        setToolTipText(SDMessages._41);
-        fView = theView;
+        setToolTipText(Messages.SequenceDiagram_Find + "..."); //$NON-NLS-1$
     }
 
     // ------------------------------------------------------------------------
     // Methods
     // ------------------------------------------------------------------------
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.jface.action.Action#run()
-     */
+
     @Override
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
-        
+
         // Disable action while search is ongoing
         this.setEnabled(false);
-        
+
         try {
-            if ((fView.getExtendedFindProvider() != null) && (fView.getExtendedFindProvider().getFindAction() != null)) {
-                fView.getExtendedFindProvider().getFindAction().run();
-            } else if (fView.getSDFindProvider() != null) {
-                SearchFilterDialog dialog = new SearchFilterDialog(fView, fView.getSDFindProvider(), false, SWT.NORMAL);
+            if ((getView().getExtendedFindProvider() != null) && (getView().getExtendedFindProvider().getFindAction() != null)) {
+                getView().getExtendedFindProvider().getFindAction().run();
+            } else if (getView().getSDFindProvider() != null) {
+                SearchFilterDialog dialog = new SearchFilterDialog(getView(), getView().getSDFindProvider(), false, SWT.NORMAL);
                 dialog.open();
             }
         } finally {
@@ -102,13 +90,4 @@ public class OpenSDFindDialog extends Action {
             this.setEnabled(true);
         }
     }
-    
-    /**
-     * Sets the active SD view.
-     * 
-     * @param view The SD view.
-     */
-   public void setView(SDView view) {
-        fView = view;
-    }
 }
This page took 0.038967 seconds and 5 git commands to generate.