trace/traceviewer/com.nokia.traceviewer/src/com/nokia/traceviewer/action/LogNewBinaryGlobalAction.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  * Handler for new binary log global command
       
    17  *
       
    18  */
       
    19 package com.nokia.traceviewer.action;
       
    20 
       
    21 import com.nokia.traceviewer.engine.TraceViewerGlobals;
       
    22 import com.nokia.traceviewer.engine.dataprocessor.Logger;
       
    23 
       
    24 /**
       
    25  * Handler for new binary log global command
       
    26  */
       
    27 public final class LogNewBinaryGlobalAction extends TraceViewerGlobalAction {
       
    28 
       
    29 	/*
       
    30 	 * (non-Javadoc)
       
    31 	 * 
       
    32 	 * @see com.nokia.traceviewer.action.TraceViewerGlobalAction#doRun()
       
    33 	 */
       
    34 	@Override
       
    35 	protected void doRun() {
       
    36 		// Get the logger DataProcessor
       
    37 		Logger logger = TraceViewerGlobals.getTraceViewer()
       
    38 				.getDataProcessorAccess().getLogger();
       
    39 
       
    40 		boolean binaryLogging = logger.isBinLogging();
       
    41 		boolean logFileOpened = logger.isLogFileOpened();
       
    42 
       
    43 		// Binary logging must be off to be able to start it
       
    44 		if (!binaryLogging && !logFileOpened) {
       
    45 
       
    46 			TraceViewerGlobals.getTraceViewer().getView().getActionFactory()
       
    47 					.getLogNewBinaryAction().run();
       
    48 		}
       
    49 	}
       
    50 
       
    51 }