import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.tizen.ocf.core.OcfCorePlugin;
+import org.tizen.ocf.core.ui.wizard.OcfDeviceWizardPage;
+import org.tizen.ocf.core.ui.wizard.OcfEntryWizardPage;
import org.tizen.rt.ide.Messages;
import org.tizen.rt.ide.util.ZipUtil;
import org.tizen.rt.product.RtProjectNature;
private final Logger logger = LoggerFactory.getLogger(NewRtProjectWizard.class);
private NewRtProjectWizardPage page;
private NewRtProjectWizardPage2 boardPage;
+ private OcfEntryWizardPage ocfEntryPage;
+ private OcfDeviceWizardPage devicePage;
private ISelection selection;
private IProject _newProject;
boardPage = new NewRtProjectWizardPage2(selection);
addPage(boardPage);
+ // Add OCF pages for working with IoT cloud service
+ addOcfPages();
+
page.setWizard(this);
}
+ private void addOcfPages() {
+ if (OcfCorePlugin.isOcfExtensionExist()) {
+ ocfEntryPage = new OcfEntryWizardPage();
+ addPage(ocfEntryPage);
+ devicePage = new OcfDeviceWizardPage(selection);
+ addPage(devicePage);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#canFinish()
+ */
+ @Override
+ public boolean canFinish() {
+ if (OcfCorePlugin.isOcfExtensionExist()) {
+ return ocfEntryPage.isPageComplete() && devicePage.isPageComplete();
+ } else {
+ return super.canFinish();
+ }
+ }
+
/**
* This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
*/
_newProject.refreshLocal(IResource.DEPTH_INFINITE, monitor);
monitor.worked(1);
+
+ // post processing : perform OCF pages work
+ if (OcfCorePlugin.isOcfExtensionExist()) {
+ IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 10);
+ devicePage.performFinish(_newProject, subMonitor);
+ }
+ monitor.worked(1);
}
private IProject createNewProject(IProject newProjectHandle, URI location, IProgressMonitor monitor) {