org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/internal/deployment/DeploymentTargetWrapper.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Mon, 09 Aug 2010 15:18:34 -0700
changeset 461 7a8f9fa8d278
permissions -rw-r--r--
Project model introduction and JSDT classpath support
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
461
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     1
/**
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     2
 * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     3
 * All rights reserved.
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     8
 *
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     9
 * Initial Contributors:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    10
 * Symbian Foundation - initial contribution.
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    11
 * Contributors:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    12
 * Description:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    13
 * Overview:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    14
 * Details:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    15
 * Platforms/Drives/Compatibility:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    16
 * Assumptions/Requirement/Pre-requisites:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    17
 * Failures and causes:
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    18
 */
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    19
package org.symbian.tools.tmw.internal.deployment;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    20
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    21
import org.eclipse.core.runtime.CoreException;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    22
import org.eclipse.core.runtime.IProgressMonitor;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    23
import org.eclipse.core.runtime.IStatus;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    24
import org.eclipse.jface.resource.ImageDescriptor;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    25
import org.eclipse.swt.graphics.FontData;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    26
import org.eclipse.swt.graphics.RGB;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    27
import org.eclipse.ui.IMemento;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    28
import org.eclipse.ui.model.IWorkbenchAdapter;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    29
import org.eclipse.ui.model.IWorkbenchAdapter2;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    30
import org.symbian.tools.tmw.core.projects.IMTWProject;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    31
import org.symbian.tools.tmw.core.runtimes.IPackager;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    32
import org.symbian.tools.tmw.ui.deployment.IDeploymentTarget;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    33
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    34
public class DeploymentTargetWrapper implements IDeploymentTarget {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    35
    public class WorkbenchAdapter2Wrapper implements IWorkbenchAdapter2 {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    36
        private final IWorkbenchAdapter2 adapter;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    37
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    38
        public WorkbenchAdapter2Wrapper(IWorkbenchAdapter2 adapter) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    39
            this.adapter = adapter;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    40
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    41
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    42
        public RGB getForeground(Object element) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    43
            return adapter.getForeground(((DeploymentTargetWrapper) element).getActualTarget());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    44
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    45
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    46
        public RGB getBackground(Object element) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    47
            return adapter.getBackground(((DeploymentTargetWrapper) element).getActualTarget());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    48
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    49
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    50
        public FontData getFont(Object element) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    51
            return adapter.getFont(((DeploymentTargetWrapper) element).getActualTarget());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    52
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    53
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    54
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    55
    public class WorkbenchAdapterWrapper implements IWorkbenchAdapter {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    56
        private final IWorkbenchAdapter adapter;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    57
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    58
        public WorkbenchAdapterWrapper(IWorkbenchAdapter adapter) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    59
            this.adapter = adapter;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    60
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    61
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    62
        public Object[] getChildren(Object o) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    63
            return adapter.getChildren(((DeploymentTargetWrapper) o).getActualTarget());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    64
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    65
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    66
        public ImageDescriptor getImageDescriptor(Object object) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    67
            return adapter.getImageDescriptor(((DeploymentTargetWrapper) object).getActualTarget());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    68
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    69
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    70
        public String getLabel(Object o) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    71
            return adapter.getLabel(((DeploymentTargetWrapper) o).getActualTarget());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    72
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    73
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    74
        public Object getParent(Object o) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    75
            return adapter.getParent(((DeploymentTargetWrapper) o).getActualTarget());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    76
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    77
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    78
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    79
    private final DeploymentTargetTypeDescriptor type;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    80
    private final IDeploymentTarget target;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    81
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    82
    public void save(IMemento memento) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    83
        target.save(memento);
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    84
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    85
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    86
    public void init(IMTWProject project, IPackager packager, IMemento memento) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    87
        target.init(project, packager, memento);
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    88
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    89
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    90
    public DeploymentTargetWrapper(IDeploymentTarget target, DeploymentTargetTypeDescriptor type) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    91
        this.target = target;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    92
        this.type = type;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    93
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    94
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    95
    public IStatus deploy(IMTWProject project, IPackager packager, IProgressMonitor monitor)
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    96
            throws CoreException {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    97
        return target.deploy(project, packager, monitor);
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    98
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    99
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   100
    @Override
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   101
    public boolean equals(Object obj) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   102
        if (this == obj) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   103
            return true;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   104
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   105
        if (obj == null) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   106
            return false;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   107
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   108
        if (getClass() != obj.getClass()) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   109
            return false;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   110
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   111
        DeploymentTargetWrapper other = (DeploymentTargetWrapper) obj;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   112
        if (target == null) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   113
            if (other.target != null) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   114
                return false;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   115
            }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   116
        } else if (!target.equals(other.target)) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   117
            return false;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   118
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   119
        return true;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   120
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   121
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   122
    public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   123
        Object a = target.getAdapter(adapter);
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   124
        if (IWorkbenchAdapter.class.isAssignableFrom(adapter)) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   125
            return a == null ? new TargetWorkbenchAdapter(this) : new WorkbenchAdapterWrapper((IWorkbenchAdapter) a);
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   126
        } else if (IWorkbenchAdapter2.class.isAssignableFrom(adapter)) {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   127
            return a == null ? new TargetWorkbenchAdapter(this) : new WorkbenchAdapter2Wrapper((IWorkbenchAdapter2) a);
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   128
        } else {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   129
            return a;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   130
        }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   131
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   132
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   133
    public int getCategory() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   134
        return type.getPriority() * 0xFFFF + (type.getId().hashCode() & 0xFFFF);
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   135
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   136
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   137
    public String getId() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   138
        return target.getId();
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   139
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   140
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   141
    public String getName() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   142
        return target.getName();
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   143
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   144
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   145
    public String getProviderId() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   146
        return type.getId();
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   147
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   148
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   149
    @Override
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   150
    public int hashCode() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   151
        final int prime = 31;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   152
        int result = 1;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   153
        result = prime * result + ((target == null) ? 0 : target.hashCode());
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   154
        return result;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   155
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   156
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   157
    public DeploymentTargetTypeDescriptor getType() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   158
        return type;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   159
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   160
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   161
    public IDeploymentTarget getActualTarget() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   162
        return target;
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   163
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   164
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   165
    public String getDescription() {
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   166
        return target.getDescription();
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   167
    }
7a8f9fa8d278 Project model introduction and JSDT classpath support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   168
}