View | Details | Raw Unified | Return to bug 234376
Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/templates/ide/PropertyPageTemplate.java (-15 / +16 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 7-34 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 234376
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.templates.ide;
12
package org.eclipse.pde.internal.ui.templates.ide;
12
13
13
import java.util.ArrayList;
14
import java.util.ArrayList;
14
15
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.core.runtime.IProgressMonitor;
17
import org.eclipse.jface.wizard.Wizard;
17
import org.eclipse.jface.wizard.Wizard;
18
import org.eclipse.jface.wizard.WizardPage;
18
import org.eclipse.jface.wizard.WizardPage;
19
import org.eclipse.pde.core.plugin.IPluginBase;
19
import org.eclipse.pde.core.plugin.*;
20
import org.eclipse.pde.core.plugin.IPluginElement;
20
import org.eclipse.pde.internal.ui.templates.*;
21
import org.eclipse.pde.core.plugin.IPluginExtension;
22
import org.eclipse.pde.core.plugin.IPluginModelBase;
23
import org.eclipse.pde.core.plugin.IPluginModelFactory;
24
import org.eclipse.pde.core.plugin.IPluginReference;
25
import org.eclipse.pde.internal.ui.templates.IHelpContextIds;
26
import org.eclipse.pde.internal.ui.templates.PDETemplateMessages;
27
import org.eclipse.pde.internal.ui.templates.PDETemplateSection;
28
import org.eclipse.pde.ui.IFieldData;
21
import org.eclipse.pde.ui.IFieldData;
29
import org.eclipse.pde.ui.templates.AbstractTemplateSection;
22
import org.eclipse.pde.ui.templates.*;
30
import org.eclipse.pde.ui.templates.ITemplateSection;
31
import org.eclipse.pde.ui.templates.PluginReference;
32
23
33
public class PropertyPageTemplate extends PDETemplateSection {
24
public class PropertyPageTemplate extends PDETemplateSection {
34
	public static final String KEY_CLASSNAME = "className"; //$NON-NLS-1$
25
	public static final String KEY_CLASSNAME = "className"; //$NON-NLS-1$
Lines 101-107 Link Here
101
		pageElement.setAttribute("id", //$NON-NLS-1$
92
		pageElement.setAttribute("id", //$NON-NLS-1$
102
				getStringOption(KEY_PACKAGE_NAME) + ".samplePropertyPage"); //$NON-NLS-1$
93
				getStringOption(KEY_PACKAGE_NAME) + ".samplePropertyPage"); //$NON-NLS-1$
103
		pageElement.setAttribute("name", getStringOption(KEY_PAGE_NAME)); //$NON-NLS-1$
94
		pageElement.setAttribute("name", getStringOption(KEY_PAGE_NAME)); //$NON-NLS-1$
104
		pageElement.setAttribute("objectClass", getStringOption(KEY_TARGET_CLASS)); //$NON-NLS-1$
95
		if (getTargetVersion() < 3.3) {
96
			pageElement.setAttribute("objectClass", getStringOption(KEY_TARGET_CLASS)); //$NON-NLS-1$
97
		} else {
98
			IPluginElement enabledWhen = factory.createElement(pageElement);
99
			pageElement.add(enabledWhen);
100
			enabledWhen.setName("enabledWhen"); //$NON-NLS-1$
101
			IPluginElement instanceOf = factory.createElement(enabledWhen);
102
			enabledWhen.add(instanceOf);
103
			instanceOf.setName("instanceof"); //$NON-NLS-1$
104
			instanceOf.setAttribute("value", getStringOption(KEY_TARGET_CLASS)); //$NON-NLS-1$
105
		}
105
		pageElement.setAttribute("class", //$NON-NLS-1$
106
		pageElement.setAttribute("class", //$NON-NLS-1$
106
				getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_CLASSNAME)); //$NON-NLS-1$
107
				getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_CLASSNAME)); //$NON-NLS-1$
107
		pageElement.setAttribute("nameFilter", getStringOption(KEY_NAME_FILTER)); //$NON-NLS-1$
108
		pageElement.setAttribute("nameFilter", getStringOption(KEY_NAME_FILTER)); //$NON-NLS-1$

Return to bug 234376