Package org.criticalfailure.torchlight.core.model.helper

Examples of org.criticalfailure.torchlight.core.model.helper.ISettingHelper


                        setting = ui.run();
                    }
                    else {
                        logger.debug("running helper to create setting");

                        ISettingHelper helper = (ISettingHelper)ServiceUtils.getService(bundleContext, ISettingHelper.class.getName());
                        logger.debug("helper: " + helper);

                        setting = helper.createSetting();
                    }
                    logger.debug("setting: " + setting);

                    // save setting
                    if(setting != null) {
                        SettingDao settingDao = (SettingDao)ServiceUtils.getService(bundleContext, SettingDao.class.getName());
                        logger.trace("settingDao: " + settingDao);

                        settingDao.saveSetting(setting);
                    }
                }
                catch(Exception e) {
                    MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("campaign.error.create_setting.title"), Messages.getString("campaign.error.create_setting.message") + "\n\n" + e.getLocalizedMessage());
                }
                break;
               
            case ACTION_TYPE_VERSION:
                try {
                    Version version;

                    // find a version creation helper
                    if(runWizard) {
                        logger.debug("running wizard to create version");

                        IVersionUI ui = (IVersionUI)ServiceUtils.getService(bundleContext, IVersionUI.class.getName());
                        logger.debug("ui: " + ui);

                        logger.debug("setting up");
                        ui.setup(PlatformUI.getWorkbench().getActiveWorkbenchWindow());

                        logger.debug("running UI helper");
                        version = ui.run();
                    }
                    else {
                        logger.debug("running helper to create version");

                        IVersionHelper helper = (IVersionHelper)ServiceUtils.getService(bundleContext, IVersionHelper.class.getName());
                        logger.debug("helper: " + helper);

                        version = helper.createVersion();
                    }
                    logger.debug("version: " + version);

                    // save version
                    if(version != null) {
                        VersionDao versionDao = (VersionDao)ServiceUtils.getService(bundleContext, VersionDao.class.getName());
                        logger.trace("versionDao: " + versionDao);

                        versionDao.saveVersion(version);
                    }
                }
                catch(Exception e) {
                    MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("campaign.error.create_version.title"), Messages.getString("campaign.error.create_version.message") + "\n\n" + e.getLocalizedMessage());
                }
                break;
               
            case ACTION_TYPE_LIBRARY:
                try {
                    Library library;

                    // find a library creation helper
                    if(runWizard) {
                        logger.debug("running wizard to create library");

                        ILibraryUI ui = (ILibraryUI)ServiceUtils.getService(bundleContext, ILibraryUI.class.getName());
                        logger.debug("ui: " + ui);

                        logger.debug("setting up");
                        ui.setup(PlatformUI.getWorkbench().getActiveWorkbenchWindow());

                        logger.debug("running UI helper");
                        library = ui.run();
                    }
                    else {
                        logger.debug("running helper to create library");

                        ILibraryHelper helper = (ILibraryHelper)ServiceUtils.getService(bundleContext, ILibraryHelper.class.getName());
                        logger.debug("helper: " + helper);

                        library = helper.createLibrary();
                    }
                    logger.debug("library: " + library);

                    // save library
                    if(library != null) {
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.model.helper.ISettingHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.