01: /*******************************************************************************
02: * Copyright (c) 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.editor.product;
11:
12: import org.eclipse.pde.internal.core.iproduct.IProduct;
13: import org.eclipse.pde.internal.core.iproduct.IProductFeature;
14: import org.eclipse.pde.internal.core.iproduct.IProductModel;
15: import org.eclipse.pde.internal.core.iproduct.IProductPlugin;
16: import org.eclipse.pde.internal.ui.editor.FormOutlinePage;
17: import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
18:
19: public class ProductOutlinePage extends FormOutlinePage {
20:
21: public ProductOutlinePage(PDEFormEditor editor) {
22: super (editor);
23: }
24:
25: public void sort(boolean sorting) {
26: }
27:
28: protected Object[] getChildren(Object parent) {
29: if (parent instanceof ConfigurationPage) {
30: ConfigurationPage page = (ConfigurationPage) parent;
31: IProduct product = ((IProductModel) page.getModel())
32: .getProduct();
33: if (product.useFeatures())
34: return product.getFeatures();
35: return product.getPlugins();
36: }
37: return new Object[0];
38: }
39:
40: protected String getParentPageId(Object item) {
41: if (item instanceof IProductPlugin)
42: return ConfigurationPage.PLUGIN_ID;
43: if (item instanceof IProductFeature)
44: return ConfigurationPage.FEATURE_ID;
45: return super.getParentPageId(item);
46: }
47:
48: }
|