View | Details | Raw Unified | Return to bug 256562 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ui/registry/TeamContentProviderDescriptor.java (-12 / +20 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 55-83 Link Here
55
	 * Initialize this descriptor based on the provided extension point.
55
	 * Initialize this descriptor based on the provided extension point.
56
	 */
56
	 */
57
	protected void readExtension(IExtension extension) throws CoreException {
57
	protected void readExtension(IExtension extension) throws CoreException {
58
		//read the extension
58
		// read the extension
59
		String id = extension.getUniqueIdentifier(); // id not required
59
		String id = extension.getUniqueIdentifier(); // id not required
60
		IConfigurationElement[] elements = extension.getConfigurationElements();
60
		IConfigurationElement[] elements = extension.getConfigurationElements();
61
		int count = elements.length;
61
62
		for (int i = 0; i < count; i++) {
62
		// there has to be exactly one team content provider element
63
			IConfigurationElement element = elements[i];
63
		// in the provided extension (see teamContentProviders.exsd)
64
			configElement = element;
64
		if (elements.length > 0) {
65
			IConfigurationElement element = elements[0];
65
			String name = element.getName();
66
			String name = element.getName();
66
			if (name.equalsIgnoreCase(TAG_TEAM_CONTENT_PROVIDER)) {
67
			if (name.equalsIgnoreCase(TAG_TEAM_CONTENT_PROVIDER)) {
68
				configElement = element;
67
				modelProviderId = element.getAttribute(ATT_MODEL_PROVIDER_ID);
69
				modelProviderId = element.getAttribute(ATT_MODEL_PROVIDER_ID);
68
				contentExtensionId = element.getAttribute(ATT_CONTENT_EXTENSION_ID);
70
				contentExtensionId = element
69
				String supportsFlatLayoutString = element.getAttribute(ATT_SUPPORTS_FLAT_LAYOUT);
71
						.getAttribute(ATT_CONTENT_EXTENSION_ID);
72
				String supportsFlatLayoutString = element
73
						.getAttribute(ATT_SUPPORTS_FLAT_LAYOUT);
70
				if (supportsFlatLayoutString != null) {
74
				if (supportsFlatLayoutString != null) {
71
					supportsFlatLayout = Boolean.valueOf(supportsFlatLayoutString).booleanValue();
75
					supportsFlatLayout = Boolean.valueOf(
76
							supportsFlatLayoutString).booleanValue();
72
				}
77
				}
73
				contentProviderName = extension.getLabel();
78
				contentProviderName = extension.getLabel();
74
			}
79
			}
75
			break;
76
		}
80
		}
77
		if (modelProviderId == null)
81
		if (modelProviderId == null)
78
			fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { ATT_MODEL_PROVIDER_ID, TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id})); //$NON-NLS-1$
82
			fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1,
83
					new String[] { ATT_MODEL_PROVIDER_ID,
84
							TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id })); //$NON-NLS-1$
79
		if (contentExtensionId == null)
85
		if (contentExtensionId == null)
80
			fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1, new String[] { ATT_CONTENT_EXTENSION_ID, TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id})); //$NON-NLS-1$
86
			fail(NLS.bind(TeamUIMessages.TeamContentProviderDescriptor_1,
87
					new String[] { ATT_CONTENT_EXTENSION_ID,
88
							TAG_TEAM_CONTENT_PROVIDER, id == null ? "" : id })); //$NON-NLS-1$
81
	}
89
	}
82
	
90
	
83
	protected void fail(String reason) throws CoreException {
91
	protected void fail(String reason) throws CoreException {

Return to bug 256562