org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/navigator/PackagingInformationDecorator.java
changeset 455 5da55957c779
parent 454 38d6944cff88
equal deleted inserted replaced
454:38d6944cff88 455:5da55957c779
    21 import org.eclipse.core.resources.IResource;
    21 import org.eclipse.core.resources.IResource;
    22 import org.eclipse.core.runtime.IAdaptable;
    22 import org.eclipse.core.runtime.IAdaptable;
    23 import org.eclipse.jface.viewers.IDecoration;
    23 import org.eclipse.jface.viewers.IDecoration;
    24 import org.eclipse.jface.viewers.ILabelProviderListener;
    24 import org.eclipse.jface.viewers.ILabelProviderListener;
    25 import org.eclipse.jface.viewers.ILightweightLabelDecorator;
    25 import org.eclipse.jface.viewers.ILightweightLabelDecorator;
    26 import org.symbian.tools.wrttools.core.WRTImages;
    26 import org.symbian.tools.mtw.core.MTWCore;
    27 import org.symbian.tools.wrttools.util.ProjectUtils;
    27 import org.symbian.tools.mtw.core.projects.IMTWProject;
       
    28 import org.symbian.tools.mtw.core.runtimes.IPackager;
       
    29 import org.symbian.tools.mtw.ui.MTWCoreUI;
    28 
    30 
    29 public class PackagingInformationDecorator implements ILightweightLabelDecorator {
    31 public class PackagingInformationDecorator implements ILightweightLabelDecorator {
    30 
    32 
    31     public void decorate(Object element, IDecoration decoration) {
    33     public void decorate(Object element, IDecoration decoration) {
    32         IResource resource = null;
    34         IResource resource = null;
    33         if (element instanceof IResource) {
    35         if (element instanceof IResource) {
    34             resource = (IResource) element;
    36             resource = (IResource) element;
    35         } else if (element instanceof IAdaptable) {
    37         } else if (element instanceof IAdaptable) {
    36             resource = (IResource) ((IAdaptable) element).getAdapter(IResource.class);
    38             resource = (IResource) ((IAdaptable) element).getAdapter(IResource.class);
    37         }
    39         }
    38         if (resource != null && resource.isAccessible() && ProjectUtils.isExcluded(resource)) {
    40         if (resource != null && resource.isAccessible()) {
    39             decoration.addOverlay(WRTImages.getExcludedImageDescriptor(), IDecoration.TOP_RIGHT);
    41             IMTWProject project = MTWCore.getDefault().create(resource.getProject());
       
    42             if (project != null) {
       
    43                 IPackager packager = MTWCore.getDefault().getRuntimesManager().getPackager(project);
       
    44                 if (packager.getPathInPackage(resource) != null) {
       
    45                     decoration.addOverlay(MTWCoreUI.getImages().getExcludedIconDescriptor(), IDecoration.TOP_RIGHT);
       
    46                 }
       
    47             }
    40         }
    48         }
    41     }
    49     }
    42 
    50 
    43     public void addListener(ILabelProviderListener listener) {
    51     public void addListener(ILabelProviderListener listener) {
    44         // Do nothing
    52         // Do nothing