2 * Copyright 2015 Samsung Electronics All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package oic.simulator.serviceprovider.view.dialogs;
19 import org.eclipse.jface.wizard.IWizard;
20 import org.eclipse.jface.wizard.IWizardPage;
21 import org.eclipse.jface.wizard.WizardDialog;
22 import org.eclipse.swt.widgets.Shell;
25 * Dialog for handling wizards.
27 public class ResourceWizardDialog extends WizardDialog {
29 private IWizard wizard;
31 public ResourceWizardDialog(Shell parentShell, IWizard newWizard) {
32 super(parentShell, newWizard);
37 public boolean isHelpAvailable() {
42 public void finishPressed() {
43 super.finishPressed();
47 protected void backPressed() {
48 if (wizard.getClass() == CreateResourceWizard.class) {
49 CreateResourceWizard createWizard = (CreateResourceWizard) wizard;
51 MainPage mainPage = createWizard.getMainPage();
52 SimpleResourceBasicDetailsPage simpleResourceBasicDetailsPage = createWizard
53 .getSimpleResourceBasicDetailsPage();
54 SimpleResourceOtherDetailsPage simpleResourceOtherDetailsPage = createWizard
55 .getSimpleResourceOtherDetailsPage();
56 SimpleResourceAddAttributePage simpleResourceAddAttributesPage = createWizard
57 .getSimpleResourceAddAttributePage();
58 LoadRamlPage loadRamlPage = createWizard.getLoadRamlPage();
59 UpdatePropertiesPage updatePropPage = createWizard
62 IWizardPage curPage = wizard.getContainer().getCurrentPage();
63 IWizardPage prevPage = null;
65 if (curPage == loadRamlPage
66 || curPage == simpleResourceBasicDetailsPage) {
68 } else if (curPage == updatePropPage) {
69 loadRamlPage.setResource(null);
70 prevPage = loadRamlPage;
71 } else if (curPage == simpleResourceAddAttributesPage) {
72 prevPage = simpleResourceBasicDetailsPage;
73 } else if (curPage == simpleResourceOtherDetailsPage) {
74 prevPage = simpleResourceAddAttributesPage;