KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > build > BuildOutlinePage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.build;
12 import org.eclipse.pde.core.build.IBuild;
13 import org.eclipse.pde.core.build.IBuildEntry;
14 import org.eclipse.pde.core.build.IBuildModel;
15 import org.eclipse.pde.internal.ui.editor.FormOutlinePage;
16 import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
17 import org.eclipse.pde.internal.ui.editor.PDEFormPage;
18
19 public class BuildOutlinePage extends FormOutlinePage {
20     /**
21      * @param editor
22      */

23     public BuildOutlinePage(PDEFormEditor editor) {
24         super(editor);
25     }
26     protected Object JavaDoc[] getChildren(Object JavaDoc parent) {
27         if (parent instanceof PDEFormPage) {
28             PDEFormPage page = (PDEFormPage) parent;
29             IBuildModel model = (IBuildModel) page.getModel();
30             if (model.isValid()) {
31                 IBuild build = model.getBuild();
32                 if (page.getId().equals(BuildPage.PAGE_ID))
33                     return build.getBuildEntries();
34             }
35         }
36         return new Object JavaDoc[0];
37     }
38     protected String JavaDoc getParentPageId(Object JavaDoc item) {
39         String JavaDoc pageId = null;
40         if (item instanceof IBuildEntry)
41             pageId = BuildPage.PAGE_ID;
42         if (pageId != null)
43             return pageId;
44         return super.getParentPageId(item);
45     }
46 }
47
Popular Tags