org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/navigator/PackagingInformationDecorator.java
changeset 454 38d6944cff88
child 455 5da55957c779
equal deleted inserted replaced
452:68002774437e 454:38d6944cff88
       
     1 /**
       
     2  * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "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  * Symbian Foundation - initial contribution.
       
    11  * Contributors:
       
    12  * Description:
       
    13  * Overview:
       
    14  * Details:
       
    15  * Platforms/Drives/Compatibility:
       
    16  * Assumptions/Requirement/Pre-requisites:
       
    17  * Failures and causes:
       
    18  */
       
    19 package org.symbian.tools.mtw.ui.navigator;
       
    20 
       
    21 import org.eclipse.core.resources.IResource;
       
    22 import org.eclipse.core.runtime.IAdaptable;
       
    23 import org.eclipse.jface.viewers.IDecoration;
       
    24 import org.eclipse.jface.viewers.ILabelProviderListener;
       
    25 import org.eclipse.jface.viewers.ILightweightLabelDecorator;
       
    26 import org.symbian.tools.wrttools.core.WRTImages;
       
    27 import org.symbian.tools.wrttools.util.ProjectUtils;
       
    28 
       
    29 public class PackagingInformationDecorator implements ILightweightLabelDecorator {
       
    30 
       
    31     public void decorate(Object element, IDecoration decoration) {
       
    32         IResource resource = null;
       
    33         if (element instanceof IResource) {
       
    34             resource = (IResource) element;
       
    35         } else if (element instanceof IAdaptable) {
       
    36             resource = (IResource) ((IAdaptable) element).getAdapter(IResource.class);
       
    37         }
       
    38         if (resource != null && resource.isAccessible() && ProjectUtils.isExcluded(resource)) {
       
    39             decoration.addOverlay(WRTImages.getExcludedImageDescriptor(), IDecoration.TOP_RIGHT);
       
    40         }
       
    41     }
       
    42 
       
    43     public void addListener(ILabelProviderListener listener) {
       
    44         // Do nothing
       
    45 
       
    46     }
       
    47 
       
    48     public void dispose() {
       
    49         // Do nothing
       
    50 
       
    51     }
       
    52 
       
    53     public boolean isLabelProperty(Object element, String property) {
       
    54         // Do nothing
       
    55         return false;
       
    56     }
       
    57 
       
    58     public void removeListener(ILabelProviderListener listener) {
       
    59         // Do nohing
       
    60 
       
    61     }
       
    62 
       
    63 }