/** * Copyright 2010 The University of North Carolina at Chapel Hill * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package unc.lib.cdr.workbench.capture; import java.net.URI; import java.util.List; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; import org.eclipse.ui.IImportWizard; import org.eclipse.ui.IWorkbench; import unc.lib.cdr.workbench.rcp.Activator; /** * @author Gregory Jansen * */ public class LinkOriginalsWizard extends Wizard implements IImportWizard { IWorkbench workbench; IStructuredSelection selection; PickOriginalLocationsPage _pageOne; // String media; public LinkOriginalsWizard() { this.setWindowTitle("Import"); IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings(); IDialogSettings section = workbenchSettings .getSection("LinkOriginalsImportWizard");//$NON-NLS-1$ if (section == null) { section = workbenchSettings.addNewSection("LinkOriginalsImportWizard");//$NON-NLS-1$ } setDialogSettings(section); } /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; } /* * (non-Javadoc) * * @see org.eclipse.jface.wizard.IWizard#addPages() */ @Override public void addPages() { super.addPages(); // first page: pick original file location _pageOne = new PickOriginalLocationsPage("Link to Original File Locations", selection); addPage(_pageOne); } /* * (non-Javadoc) * * @see org.eclipse.jface.wizard.IWizard#canFinish() */ @Override public boolean canFinish() { return _pageOne.isPageComplete(); } /* * (non-Javadoc) * * @see org.eclipse.jface.wizard.IWizard#performCancel() */ @Override public boolean performCancel() { return true; } /* * (non-Javadoc) * * @see org.eclipse.jface.wizard.IWizard#performFinish() */ @Override public boolean performFinish() { return this._pageOne.finish(); } public List<URI> getSelectedLocations() { return null; } }