Package org.criticalfailure.torchlight.core.application.model

Examples of org.criticalfailure.torchlight.core.application.model.Alert


          logger.error("Unable to save campaign: " + c + ": " + e.getLocalizedMessage(), e);
         
          AlertService alertService = (AlertService)ServiceUtils.getService(bundleContext, AlertService.class.getName());
          logger.trace("alertService: " + alertService);
         
          alertService.addAlert(new Alert(Alert.Type.ERROR, "campaign.editor", Messages.getString("campaign.editor.save.error.message") + ": " + e.getLocalizedMessage()));
         
          // notify user
          MessageDialog.openError(getEditorSite().getShell(), Messages.getString("campaign.editor.save.error.title"), Messages.getString("campaign.editor.save.error.message") + ": " + e.getLocalizedMessage());
    }
View Full Code Here


            catch(DataAccessException e) {
                logger.error("Exception while getting versions: " + e.getLocalizedMessage(), e);

                // add error to Alerts
                AlertService alertService = (AlertService)ServiceUtils.getService(bundleContext, AlertService.class.getName());
                alertService.addAlert(new Alert(Alert.Type.ERROR, "campaign.editor", e.getLocalizedMessage()));
            }
            version.addSelectionListener(new SelectionListener() {
                public void widgetDefaultSelected(SelectionEvent e) {
                    widgetSelected(e);
                }

                public void widgetSelected(SelectionEvent e) {
                    logger.debug("setting campaign edition; index = " + version.getSelectionIndex());
                    Version v = (Version)version.getData("version" + version.getSelectionIndex());
                    logger.trace("v: " + v);
                   
                    if(v != null) {
                      campaign.setVersion(v);

                      logger.debug("setting editor as dirty");
                      dirty = true;
                    }
                }
            });

            // setting (line 2, half-width)
            logger.debug("creating setting chooser");
            label = new Label(generalGroup, SWT.RIGHT);
            label.setText(Messages.getString("campaign.editor.setting.label"));
            label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));

            setting = new Combo(generalGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
            setting.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
            SettingDao settingDao = (SettingDao)ServiceUtils.getService(bundleContext, SettingDao.class.getName());
            try {
              int i = 0;
             
                for(Setting s : settingDao.getSettings()) {
                    setting.add(s.getLabel());
                    setting.setData(s.getLabel(), s);
                    setting.setData("setting" + i, s);
                   
                    if(campaign.getSetting() == s) {
                      setting.select(i);
                    }
                   
                    i++;
                }
            }
            catch(DataAccessException e) {
                logger.error("Exception while getting settings: " + e.getLocalizedMessage(), e);

                // add error to Alerts
                AlertService alertService = (AlertService)ServiceUtils.getService(bundleContext, AlertService.class.getName());
                alertService.addAlert(new Alert(Alert.Type.ERROR, "campaign.editor", e.getLocalizedMessage()));
            }
            setting.addSelectionListener(new SelectionListener() {
                public void widgetDefaultSelected(SelectionEvent e) {
                    widgetSelected(e);
                }
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.application.model.Alert

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.