Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2606742d561263f3494bef0d78dd97ca9d819db6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*******************************************************************************
 * Copyright (c) 2008 IONA Technologies PLC
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IONA Technologies PLC - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.ws.internal.cxf.ui.viewers;

import java.util.Map;

import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jst.ws.internal.cxf.core.model.WSDL2JavaDataModel;
import org.eclipse.jst.ws.jaxws.core.utils.WSDLUtils;

public class PackageNameColumnLabelProvider extends ColumnLabelProvider {
    private Map<String, String> includedNamespaces;

    public PackageNameColumnLabelProvider(WSDL2JavaDataModel model) {
        includedNamespaces = model.getIncludedNamespaces();
    }

    @Override
    public String getText(Object element) {
        if (includedNamespaces.containsKey(element.toString())) {
            return includedNamespaces.get(element.toString());
        }
        return WSDLUtils.getPackageNameFromNamespace(element.toString());
    }

}

Back to the top