protected void updateEnablement() { if (getProjectType() != ProjectType.PROJECT) { packagingGroup.setEnabled(false); for (Control c : packagingGroup.getChildren()) { c.setEnabled(false); } } else { IRooInstall install = null; if (useDefaultRooInstall()) { install = RooCoreActivator.getDefault().getInstallManager().getDefaultRooInstall(); } else { String installName = getRooInstallName(); if (installName != null) { install = RooCoreActivator.getDefault().getInstallManager().getRooInstall(installName); } } boolean enableFlag = RooUiUtil.isRoo120OrGreater(install); packagingGroup.setEnabled(enableFlag); for (Control c : packagingGroup.getChildren()) { c.setEnabled(enableFlag); } } // Checks if Spring Roo 2.0+ version is selected String version = null; if (useDefaultRooInstall()) { version = RooCoreActivator.getDefault().getInstallManager().getDefaultRooInstall().getVersion(); } else { String installName = getRooInstallName(); if (installName != null) { version = RooCoreActivator.getDefault() .getInstallManager() .getRooInstall(installName) .getVersion(); } } // Roo Addon Suite generation only is available on Spring Roo 2.0+ version if (!version.startsWith("2") && getProjectType().equals(ProjectType.ADDON_SUITE)) { MessageDialog.openInformation( getShell(), "Spring Roo Alert", "You are trying to use a functionality that is only available on Spring Roo 2.0+ versions." + " Please, install an Spring Roo 2.0+ distribution to continue."); fNameGroup.fTemplateField.selectItem(0); } }
public NewRooProjectWizard() { super(); // Check if exists some Spring Roo installation before continue while (RooCoreActivator.getDefault().getInstallManager().getDefaultRooInstall() == null) { MessageDialog.openInformation( getShell(), "Spring Roo Alert", "You are trying to generate an Spring Roo project, but you don't have any Spring Roo distribution installed." + "Include some Spring Roo distribution before continue."); RooUiUtil.openPreferences(getShell()); } setWindowTitle("New Roo Project"); setDefaultPageImageDescriptor( RooUiActivator.getImageDescriptor("icons/full/wizban/roo_wizban.png")); setNeedsProgressMonitor(true); }