1 package oic.simulator.serviceprovider.view.dialogs;
3 import oic.simulator.serviceprovider.Activator;
4 import oic.simulator.serviceprovider.utils.Convertion;
6 import org.eclipse.jface.dialogs.MessageDialog;
7 import org.eclipse.jface.wizard.Wizard;
8 import org.eclipse.swt.widgets.Shell;
9 import org.eclipse.ui.PlatformUI;
11 public class DeleteResourceWizard extends Wizard {
13 private DeleteResourcePage page;
15 public DeleteResourceWizard() {
16 setWindowTitle("Delete resources");
20 public void addPages() {
21 page = new DeleteResourcePage();
26 public boolean performFinish() {
27 // Check the existence of the resource if the user has entered the uri
28 if (page.getDeleteCategory() == DeleteCategory.BY_URI) {
29 // Check whether the uri is in full form or short form
30 // If it is in short form, expand it to its full form.
31 String uri = page.getDeleteCandidate();
32 boolean uriComplete = Convertion.isUriComplete(uri);
34 uri = Convertion.displayNameToUri(uri);
36 boolean exist = Activator.getManager().isResourceExist(uri);
38 Shell activeShell = PlatformUI.getWorkbench().getDisplay()
40 MessageDialog dialog = new MessageDialog(activeShell,
41 "Resource Not Found", null,
42 "No resource exist with the given URI.",
43 MessageDialog.INFORMATION, new String[] { "OK" }, 0);
45 page.setFocusToTextBox();
52 public DeleteCategory getDeleteCategory() {
53 return page.getDeleteCategory();
56 public String getDeleteCandidate() {
57 return page.getDeleteCandidate();