kchong | 199f5d7 | 2007-03-14 02:45:59 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2007 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.wst.xsd.ui.internal.adt.design.editparts; |
| 12 | |
| 13 | import java.util.ArrayList; |
| 14 | import java.util.List; |
| 15 | |
| 16 | import org.eclipse.draw2d.IFigure; |
| 17 | import org.eclipse.draw2d.Panel; |
| 18 | import org.eclipse.draw2d.ToolbarLayout; |
| 19 | import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn; |
| 20 | import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.ReferencedTypeColumn; |
| 21 | import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.RootHolder; |
| 22 | import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject; |
| 23 | |
| 24 | public class RootHolderEditPart extends BaseEditPart implements IHolderEditPart |
| 25 | { |
| 26 | protected Panel panel; |
| 27 | |
| 28 | public RootHolderEditPart() |
| 29 | { |
| 30 | } |
| 31 | |
| 32 | protected IFigure createFigure() |
| 33 | { |
| 34 | panel = new Panel(); |
| 35 | ToolbarLayout layout = new ToolbarLayout(true); |
| 36 | layout.setStretchMinorAxis(false); |
| 37 | layout.setSpacing(100); |
| 38 | panel.setLayoutManager(layout); |
| 39 | |
| 40 | return panel; |
| 41 | } |
| 42 | |
| 43 | protected List getModelChildren() |
| 44 | { |
| 45 | List collections = new ArrayList(); |
| 46 | RootHolder holder = (RootHolder)getModel(); |
| 47 | IADTObject focusObject = holder.getModel(); |
| 48 | collections.add(new FocusTypeColumn(focusObject)); |
| 49 | collections.add(new ReferencedTypeColumn(focusObject)); |
| 50 | return collections; |
| 51 | } |
| 52 | |
| 53 | protected void createEditPolicies() |
| 54 | { |
| 55 | super.createEditPolicies(); |
| 56 | } |
| 57 | |
kchong | a3cda4a | 2007-10-31 22:04:22 +0000 | [diff] [blame] | 58 | public boolean isSelectable() |
| 59 | { |
| 60 | return false; |
| 61 | } |
kchong | 199f5d7 | 2007-03-14 02:45:59 +0000 | [diff] [blame] | 62 | } |