org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/ui/Images.java
changeset 461 7a8f9fa8d278
equal deleted inserted replaced
460:c0bff5ed874c 461:7a8f9fa8d278
       
     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.tmw.ui;
       
    20 
       
    21 import org.eclipse.jface.resource.ImageDescriptor;
       
    22 import org.eclipse.jface.resource.ImageRegistry;
       
    23 import org.eclipse.swt.graphics.Image;
       
    24 
       
    25 public final class Images {
       
    26     private final String DISCOVER_ICON = "icons/full/obj16/discover.gif";
       
    27     private final String EXCLUDED_ICON = "icons/full/obj16/excluded.gif";
       
    28     private final String BLUETOOTH_ICON = "icons/full/obj16/bluetooth.gif";
       
    29 
       
    30     private final ImageRegistry registry;
       
    31 
       
    32     Images(final ImageRegistry registry) {
       
    33         this.registry = registry;
       
    34         add(registry, DISCOVER_ICON);
       
    35         add(registry, EXCLUDED_ICON);
       
    36         add(registry, BLUETOOTH_ICON);
       
    37     }
       
    38 
       
    39     private void add(final ImageRegistry registry, String icon) {
       
    40         ImageDescriptor descriptor = TMWCoreUI.imageDescriptorFromPlugin(TMWCoreUI.PLUGIN_ID, icon);
       
    41         registry.put(icon, descriptor);
       
    42     }
       
    43 
       
    44     public Image getDiscoverButtonIcon() {
       
    45         return registry.get(DISCOVER_ICON);
       
    46     }
       
    47 
       
    48     public ImageDescriptor getExcludedIconDescriptor() {
       
    49         return registry.getDescriptor(EXCLUDED_ICON);
       
    50     }
       
    51 
       
    52     public ImageDescriptor getBluetoothImageDescriptor() {
       
    53         return registry.getDescriptor(BLUETOOTH_ICON);
       
    54     }
       
    55 }