blob: 0e936efeff021d52c6d709e7381640ce60289929 [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
cbridgha6f0ccc92005-11-17 22:01:07 +000011import java.util.List;
cbridghacea49182005-10-13 16:30:32 +000012import java.util.Set;
cbridgha012e1be2005-10-03 18:11:38 +000013import java.util.Vector;
cbridghac6f9eaa2005-12-06 16:35:55 +000014
15import org.eclipse.jface.wizard.IWizardPage;
cbridgha012e1be2005-10-03 18:11:38 +000016import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
17
18public class SimplePageGroup implements AddablePageGroup {
19 private String groupID;
20 private String wizardID;
21 private boolean allowExtendedPages;
22 private String requiredDataOperation;
cbridghacea49182005-10-13 16:30:32 +000023 private Set dataModelIDs;
cbridgha012e1be2005-10-03 18:11:38 +000024
cbridghaaa96c3b2005-10-11 17:02:35 +000025 private IDMPageHandler pageHandler;
26 private IDMPageGroupHandler pageGroupHandler;
cbridgha012e1be2005-10-03 18:11:38 +000027 private Vector pages;
28
29 public SimplePageGroup(String groupID, String wizardID, boolean allowExtendedPages, String requireDataOperation) {
30 this.groupID = groupID;
31 this.wizardID = wizardID;
32 this.allowExtendedPages = allowExtendedPages;
33 this.requiredDataOperation = requireDataOperation;
34 pages = new Vector();
35 }
36
37 public SimplePageGroup(String groupID, String wizardID) {
38 this(groupID, wizardID, true, null);
39 }
40
cbridghac6f9eaa2005-12-06 16:35:55 +000041 public void addPage(IWizardPage page) {
cbridgha012e1be2005-10-03 18:11:38 +000042 pages.add(page);
43 }
44
cbridghac6f9eaa2005-12-06 16:35:55 +000045 public void addPages(IWizardPage[] newPages) {
cbridgha012e1be2005-10-03 18:11:38 +000046 for (int index = 0; index < newPages.length; index++) {
47 pages.add(newPages[index]);
48 }
49 }
50
51 public boolean getAllowsExtendedPages() {
52 return allowExtendedPages;
53 }
54
cbridghaaa96c3b2005-10-11 17:02:35 +000055 public void setPageGroupHandler(IDMPageGroupHandler handler) {
cbridgha012e1be2005-10-03 18:11:38 +000056 pageGroupHandler = handler;
57 }
58
cbridghaaa96c3b2005-10-11 17:02:35 +000059 public IDMPageGroupHandler getPageGroupHandler(IDataModel dataModel) {
cbridgha012e1be2005-10-03 18:11:38 +000060 return pageGroupHandler;
61 }
62
cbridghaaa96c3b2005-10-11 17:02:35 +000063 public void setPageHandler(IDMPageHandler handler) {
cbridgha012e1be2005-10-03 18:11:38 +000064 pageHandler = handler;
65 }
66
cbridghaaa96c3b2005-10-11 17:02:35 +000067 public IDMPageHandler getPageHandler(IDataModel dataModel) {
cbridgha012e1be2005-10-03 18:11:38 +000068 return pageHandler;
69 }
70
cbridgha6f0ccc92005-11-17 22:01:07 +000071 public List getPages(IDataModel dataModel) {
72 return pages;
73 }
74
cbridghac6f9eaa2005-12-06 16:35:55 +000075 public IWizardPage[] getExtendedPages(IDataModel dataModel) {
76 return (IWizardPage[]) pages.toArray(new IWizardPage[0]);
cbridgha012e1be2005-10-03 18:11:38 +000077 }
78
79 public String getPageGroupID() {
80 return groupID;
81 }
82
83 public String getPageGroupInsertionID() {
84 return null;
85 }
86
87 public String getRequiredDataOperationToRun() {
88 return requiredDataOperation;
89 }
90
91 public String getWizardID() {
92 return wizardID;
93 }
94
cbridghacea49182005-10-13 16:30:32 +000095 public Set getDataModelIDs() {
96 return dataModelIDs;
cbridgha012e1be2005-10-03 18:11:38 +000097 }
98
cbridghacea49182005-10-13 16:30:32 +000099 public void setDataModelIDs(Set dataModelIDs) {
100 this.dataModelIDs = dataModelIDs;
cbridgha012e1be2005-10-03 18:11:38 +0000101 }
102}