KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > product > ProductOutlinePage


1 /*******************************************************************************
2  * Copyright (c) 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.editor.product;
12
13 import org.eclipse.pde.internal.core.iproduct.IProduct;
14 import org.eclipse.pde.internal.core.iproduct.IProductFeature;
15 import org.eclipse.pde.internal.core.iproduct.IProductModel;
16 import org.eclipse.pde.internal.core.iproduct.IProductPlugin;
17 import org.eclipse.pde.internal.ui.editor.FormOutlinePage;
18 import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
19
20 public class ProductOutlinePage extends FormOutlinePage {
21
22     public ProductOutlinePage(PDEFormEditor editor) {
23         super(editor);
24     }
25     
26     public void sort(boolean sorting) {
27     }
28     
29     protected Object JavaDoc[] getChildren(Object JavaDoc parent) {
30         if (parent instanceof ConfigurationPage) {
31             ConfigurationPage page = (ConfigurationPage)parent;
32             IProduct product = ((IProductModel)page.getModel()).getProduct();
33             if (product.useFeatures())
34                 return product.getFeatures();
35             return product.getPlugins();
36         }
37         return new Object JavaDoc[0];
38     }
39     
40     protected String JavaDoc getParentPageId(Object JavaDoc 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 }
49
Popular Tags