blob: b643014fd2324304bc1ea4dc967c789c75b7d3be [file] [log] [blame]
cbridgha012e1be2005-10-03 18:11:38 +00001/***************************************************************************************************
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 **************************************************************************************************/
9package org.eclipse.wst.common.frameworks.internal.datamodel.ui;
10
11import java.util.Vector;
12import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
13
14public 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
cbridghaaa96c3b2005-10-11 17:02:35 +000021 private IDMPageHandler pageHandler;
22 private IDMPageGroupHandler pageGroupHandler;
cbridgha012e1be2005-10-03 18:11:38 +000023 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
cbridghaaa96c3b2005-10-11 17:02:35 +000051 public void setPageGroupHandler(IDMPageGroupHandler handler) {
cbridgha012e1be2005-10-03 18:11:38 +000052 pageGroupHandler = handler;
53 }
54
cbridghaaa96c3b2005-10-11 17:02:35 +000055 public IDMPageGroupHandler getPageGroupHandler(IDataModel dataModel) {
cbridgha012e1be2005-10-03 18:11:38 +000056 return pageGroupHandler;
57 }
58
cbridghaaa96c3b2005-10-11 17:02:35 +000059 public void setPageHandler(IDMPageHandler handler) {
cbridgha012e1be2005-10-03 18:11:38 +000060 pageHandler = handler;
61 }
62
cbridghaaa96c3b2005-10-11 17:02:35 +000063 public IDMPageHandler getPageHandler(IDataModel dataModel) {
cbridgha012e1be2005-10-03 18:11:38 +000064 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}