trace/traceviewer/com.nokia.traceviewer/src/com/nokia/traceviewer/dialog/SearchHitEOFUpdater.java
changeset 11 5b9d4d8641ce
equal deleted inserted replaced
10:ed1c9f64298a 11:5b9d4d8641ce
       
     1 /*
       
     2  * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  *
       
    16  * Search hit EOF updater class
       
    17  *
       
    18  */
       
    19 package com.nokia.traceviewer.dialog;
       
    20 
       
    21 import com.nokia.traceviewer.engine.TraceViewerGlobals;
       
    22 
       
    23 /**
       
    24  * Handles search hitting EOF
       
    25  * 
       
    26  */
       
    27 public class SearchHitEOFUpdater implements Runnable {
       
    28 
       
    29 	/*
       
    30 	 * (non-Javadoc)
       
    31 	 * 
       
    32 	 * @see java.lang.Runnable#run()
       
    33 	 */
       
    34 	public void run() {
       
    35 		// Show not found dialog to user and ask if continue
       
    36 		String notFoundStr = Messages
       
    37 				.getString("SearchHitEOFUpdater.TextNotFoundStr"); //$NON-NLS-1$
       
    38 		boolean ret = TraceViewerGlobals.getTraceViewer().getDialogs()
       
    39 				.showConfirmationDialog(notFoundStr);
       
    40 
       
    41 		// Ok
       
    42 		if (ret) {
       
    43 			// Start new search from EOF
       
    44 			TraceViewerGlobals.getTraceViewer().getDataProcessorAccess()
       
    45 					.getSearchProcessor().getSearchDialog().endOfFile();
       
    46 		} else {
       
    47 			TraceViewerGlobals.getTraceViewer().getDataProcessorAccess()
       
    48 					.getSearchProcessor().getSearchDialog()
       
    49 					.enableSearchButton();
       
    50 		}
       
    51 	}
       
    52 
       
    53 }