cbridgha | 012e1be | 2005-10-03 18:11:38 +0000 | [diff] [blame] | 1 | /*************************************************************************************************** |
| 2 | * Copyright (c) 2003, 2005 IBM Corporation and others. All rights reserved. This program and the |
| 3 | * accompanying materials are made available under the terms of the Eclipse Public License v1.0 |
| 4 | * which accompanies this distribution, and is available at |
| 5 | * http://www.eclipse.org/legal/epl-v10.html |
| 6 | * |
| 7 | * Contributors: IBM Corporation - initial API and implementation |
| 8 | **************************************************************************************************/ |
| 9 | package org.eclipse.wst.common.frameworks.internal.datamodel.ui; |
| 10 | |
| 11 | import java.util.Vector; |
| 12 | import org.eclipse.wst.common.frameworks.datamodel.IDataModel; |
| 13 | |
| 14 | public class SimplePageGroup implements AddablePageGroup { |
| 15 | private String groupID; |
| 16 | private String wizardID; |
| 17 | private boolean allowExtendedPages; |
| 18 | private String requiredDataOperation; |
| 19 | private String dataModelID; |
| 20 | |
cbridgha | aa96c3b | 2005-10-11 17:02:35 +0000 | [diff] [blame^] | 21 | private IDMPageHandler pageHandler; |
| 22 | private IDMPageGroupHandler pageGroupHandler; |
cbridgha | 012e1be | 2005-10-03 18:11:38 +0000 | [diff] [blame] | 23 | private Vector pages; |
| 24 | |
| 25 | public SimplePageGroup(String groupID, String wizardID, boolean allowExtendedPages, String requireDataOperation) { |
| 26 | this.groupID = groupID; |
| 27 | this.wizardID = wizardID; |
| 28 | this.allowExtendedPages = allowExtendedPages; |
| 29 | this.requiredDataOperation = requireDataOperation; |
| 30 | pages = new Vector(); |
| 31 | } |
| 32 | |
| 33 | public SimplePageGroup(String groupID, String wizardID) { |
| 34 | this(groupID, wizardID, true, null); |
| 35 | } |
| 36 | |
| 37 | public void addPage(DataModelWizardPage page) { |
| 38 | pages.add(page); |
| 39 | } |
| 40 | |
| 41 | public void addPages(DataModelWizardPage[] newPages) { |
| 42 | for (int index = 0; index < newPages.length; index++) { |
| 43 | pages.add(newPages[index]); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | public boolean getAllowsExtendedPages() { |
| 48 | return allowExtendedPages; |
| 49 | } |
| 50 | |
cbridgha | aa96c3b | 2005-10-11 17:02:35 +0000 | [diff] [blame^] | 51 | public void setPageGroupHandler(IDMPageGroupHandler handler) { |
cbridgha | 012e1be | 2005-10-03 18:11:38 +0000 | [diff] [blame] | 52 | pageGroupHandler = handler; |
| 53 | } |
| 54 | |
cbridgha | aa96c3b | 2005-10-11 17:02:35 +0000 | [diff] [blame^] | 55 | public IDMPageGroupHandler getPageGroupHandler(IDataModel dataModel) { |
cbridgha | 012e1be | 2005-10-03 18:11:38 +0000 | [diff] [blame] | 56 | return pageGroupHandler; |
| 57 | } |
| 58 | |
cbridgha | aa96c3b | 2005-10-11 17:02:35 +0000 | [diff] [blame^] | 59 | public void setPageHandler(IDMPageHandler handler) { |
cbridgha | 012e1be | 2005-10-03 18:11:38 +0000 | [diff] [blame] | 60 | pageHandler = handler; |
| 61 | } |
| 62 | |
cbridgha | aa96c3b | 2005-10-11 17:02:35 +0000 | [diff] [blame^] | 63 | public IDMPageHandler getPageHandler(IDataModel dataModel) { |
cbridgha | 012e1be | 2005-10-03 18:11:38 +0000 | [diff] [blame] | 64 | return pageHandler; |
| 65 | } |
| 66 | |
| 67 | public DataModelWizardPage[] getExtendedPages(IDataModel dataModel) { |
| 68 | return (DataModelWizardPage[]) pages.toArray(new DataModelWizardPage[0]); |
| 69 | } |
| 70 | |
| 71 | public String getPageGroupID() { |
| 72 | return groupID; |
| 73 | } |
| 74 | |
| 75 | public String getPageGroupInsertionID() { |
| 76 | return null; |
| 77 | } |
| 78 | |
| 79 | public String getRequiredDataOperationToRun() { |
| 80 | return requiredDataOperation; |
| 81 | } |
| 82 | |
| 83 | public String getWizardID() { |
| 84 | return wizardID; |
| 85 | } |
| 86 | |
| 87 | public String getDataModelID() { |
| 88 | return dataModelID; |
| 89 | } |
| 90 | |
| 91 | public void setDataModelID(String dataModelID) { |
| 92 | this.dataModelID = dataModelID; |
| 93 | } |
| 94 | } |