01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 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.build;
11:
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:
27: protected Object[] getChildren(Object parent) {
28: if (parent instanceof PDEFormPage) {
29: PDEFormPage page = (PDEFormPage) parent;
30: IBuildModel model = (IBuildModel) page.getModel();
31: if (model.isValid()) {
32: IBuild build = model.getBuild();
33: if (page.getId().equals(BuildPage.PAGE_ID))
34: return build.getBuildEntries();
35: }
36: }
37: return new Object[0];
38: }
39:
40: protected String getParentPageId(Object item) {
41: String pageId = null;
42: if (item instanceof IBuildEntry)
43: pageId = BuildPage.PAGE_ID;
44: if (pageId != null)
45: return pageId;
46: return super.getParentPageId(item);
47: }
48: }
|