trace/traceviewer/com.nokia.trace.eventview/src/com/nokia/trace/eventview/RemoveAllEventsAction.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  * Action to remove all entries from the list
       
    17  *
       
    18  */
       
    19 package com.nokia.trace.eventview;
       
    20 
       
    21 import org.eclipse.jface.action.Action;
       
    22 import org.eclipse.ui.ISharedImages;
       
    23 import org.eclipse.ui.PlatformUI;
       
    24 
       
    25 /**
       
    26  * Action to remove all entries from the list
       
    27  * 
       
    28  */
       
    29 final class RemoveAllEventsAction extends Action {
       
    30 
       
    31 	/**
       
    32 	 * Content provider
       
    33 	 */
       
    34 	private EventListContentProvider contentProvider;
       
    35 
       
    36 	/**
       
    37 	 * Constructor
       
    38 	 * 
       
    39 	 * @param provider
       
    40 	 *            content provider for entry removal
       
    41 	 */
       
    42 	RemoveAllEventsAction(EventListContentProvider provider) {
       
    43 		this.contentProvider = provider;
       
    44 		setText(Messages.getString("RemoveEventAction.DismissAllEventsAction")); //$NON-NLS-1$
       
    45 		setToolTipText(Messages
       
    46 				.getString("RemoveEventAction.DismissAllEventsActionTooltip")); //$NON-NLS-1$
       
    47 		setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
       
    48 				.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
       
    49 		setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
       
    50 				.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
       
    51 	}
       
    52 
       
    53 	/*
       
    54 	 * (non-Javadoc)
       
    55 	 * 
       
    56 	 * @see org.eclipse.jface.action.Action#run()
       
    57 	 */
       
    58 	@Override
       
    59 	public void run() {
       
    60 		contentProvider.removeAllEntries();
       
    61 	}
       
    62 }