org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/TargetWorkbenchAdapter.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Thu, 29 Jul 2010 10:51:59 -0700
changeset 459 c278f0c8917f
parent 456 12b549765c34
child 460 c0bff5ed874c
permissions -rw-r--r--
Refactored packager and deployer interfaces
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
456
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     1
/**
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     2
 * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     3
 * All rights reserved.
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     8
 *
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     9
 * Initial Contributors:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    10
 * Symbian Foundation - initial contribution.
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    11
 * Contributors:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    12
 * Description:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    13
 * Overview:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    14
 * Details:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    15
 * Platforms/Drives/Compatibility:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    16
 * Assumptions/Requirement/Pre-requisites:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    17
 * Failures and causes:
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    18
 */
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    19
package org.symbian.tools.mtw.internal.deployment;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    20
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    21
import org.eclipse.jface.resource.ImageDescriptor;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    22
import org.eclipse.swt.graphics.FontData;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    23
import org.eclipse.swt.graphics.RGB;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    24
import org.eclipse.ui.model.IWorkbenchAdapter;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    25
import org.eclipse.ui.model.IWorkbenchAdapter2;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    26
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    27
public class TargetWorkbenchAdapter implements IWorkbenchAdapter, IWorkbenchAdapter2 {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    28
    /**
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    29
     * 
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    30
     */
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    31
    private final DeploymentTargetWrapper deploymentTargetWrapper;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    32
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    33
    /**
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    34
     * @param deploymentTargetWrapper
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    35
     */
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    36
    TargetWorkbenchAdapter(DeploymentTargetWrapper deploymentTargetWrapper) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    37
        this.deploymentTargetWrapper = deploymentTargetWrapper;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    38
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    39
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    40
    public String getLabel(Object object) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    41
        return this.deploymentTargetWrapper.getName();
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    42
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    43
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    44
    public ImageDescriptor getImageDescriptor(Object object) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    45
        return this.deploymentTargetWrapper.type.getImageDescriptor();
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    46
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    47
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    48
    public RGB getForeground(Object element) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    49
        // TODO Auto-generated method stub
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    50
        return null;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    51
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    52
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    53
    public RGB getBackground(Object element) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    54
        // TODO Auto-generated method stub
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    55
        return null;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    56
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    57
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    58
    public FontData getFont(Object element) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    59
        // TODO Auto-generated method stub
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    60
        return null;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    61
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    62
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    63
    public Object[] getChildren(Object o) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    64
        // TODO Auto-generated method stub
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    65
        return null;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    66
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    67
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    68
    public Object getParent(Object o) {
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    69
        // TODO Auto-generated method stub
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    70
        return null;
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    71
    }
12b549765c34 Refactoring and adding better bluetooth target decoration
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    72
}