Package org.criticalfailure.torchlight.core.application.entity

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


                campaignManager.loadCampaignData(campaign);
            }
            catch(Exception e) {
                logger.error("Unable to load campaign: " + e.getLocalizedMessage(), e);

                alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e
                        .getLocalizedMessage()));
            }
        }

        // create a new workspace campaign if the list is empty
View Full Code Here


        }
        catch(Exception e) {
            logger.error("Exception while trying to save object data: " + e.getLocalizedMessage(), e);

            alertService
                    .addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
        }

        logger.info("Done executing 'populate object data from properties' action.");
    }
View Full Code Here

            value = Integer.parseInt(datumValue);
        }
        catch(Exception e) {
            logger.warn("Cannot format ability modifier value; not a number: " + e.getLocalizedMessage());

            alertService.addAlert(new Alert(Alert.Type.WARN, getName() + ": " + od.getName(),
                    "Cannot format number value; not a number: " + od.getStringValue()));
        }

        String formattedString = String.format("%,d", value);
        logger.trace("formattedString: " + formattedString);
View Full Code Here

            }
        }
        catch(Exception e) {
            logger.warn("Cannot format ability modifier value; not an integer: " + e.getLocalizedMessage());

            alertService.addAlert(new Alert(Alert.Type.WARN, getName() + ": " + od.getName(),
                    "Cannot format ability modifier value; not an integer: " + od.getStringValue()));
        }

        String formattedString = String.format("%+d", value);
        logger.trace("formattedString: " + formattedString);
View Full Code Here

            logger.trace("campaign: " + campaign);
        }
        catch(ObjectCreationException e) {
            logger.error("Unable to create campaign: " + e.getLocalizedMessage(), e);

            alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
                    .getString("campaign.srd4.ui.action.campaign.create.error.factory.text")));

            return;
        }

        try {
            // create a dialog to get information from the user
            ICampaignBuilderDialog dialog = (ICampaignBuilderDialog)appContext.getBean("srd4CampaignBuilderDialog",
                    new Object[] { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() });

            campaignBuilder.setDialog(dialog);

            if(!campaignBuilder.buildCampaign(campaign)) {
                logger.info("Campaign build was incomplete; see previous log entries for details.");

                alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
                        .getString("campaign.srd4.ui.action.campaign.create.error.build_incomplete.text")));

                return;
            }
        }
        catch(ObjectBuilderException e) {
            logger.error("Exception while trying to build campaign: " + e.getLocalizedMessage(), e);

            alertService
                    .addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));

            return;
        }

        try {
            campaignManager.registerCampaign(campaign);
            campaign.save();
        }
        catch(Exception e) {
            logger.error("Exception while trying to register/save campaign: " + e.getLocalizedMessage(), e);

            alertService
                    .addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
        }
    }
View Full Code Here

        if(id == null) {
            throw new IllegalArgumentException("Alert ID must be provided!");
        }

        Alert alert = alertCache.remove(id);

        Dictionary<String, Object> eventProps = new Hashtable<String, Object>();
        eventProps.put(ApplicationConstants.ALERT_EVENT_ALERT_ID_PROPERTY, alert.getId());
        eventProps.put(ApplicationConstants.ALERT_EVENT_ALERT_PROPERTY, alert);

        logger.info("Sending event for alert addition: " + alert);
        eventAdmin.sendEvent(new Event(ApplicationConstants.ALERT_REMOVED_EVENT, eventProps));
    }
View Full Code Here

                    return formatterHelper.format(op, datum);
                }
                catch(ObjectPropertyFormatterException e) {
                    logger.error("Exception caught while executing formatter: " + e.getLocalizedMessage(), e);

                    alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e
                            .getLocalizedMessage()));
                }
            }

            return datum.getStringValue();
        }
        catch(Exception e) {
            logger.error("Exception caught while trying to get object data value for character sheet editor: "
                    + e.getLocalizedMessage(), e);

            alertService.addAlert(new Alert(Alert.Type.ERROR, getTitle(), Messages
                    .getString("object.instance.charsheet.editor.error.object_data.text")
                    + ": " + e.getLocalizedMessage()));
        }

        return "";
View Full Code Here

                }
                catch(Exception e) {
                    logger.error("Exception caught while setting object template properties: "
                            + e.getLocalizedMessage(), e);

                    alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e
                            .getLocalizedMessage()));

                    return false;
                }
            }
View Full Code Here

        }
        catch(Exception e) {
            logger.error("Exception caught while trying to load template list: " + e.getLocalizedMessage(), e);

            alertService
                    .addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
        }

        logger.info("Template list loaded: " + templates.size() + " template(s).");
    }
View Full Code Here

        }
        catch(Exception e) {
            logger.error("Exception caught while trying to load object template: " + e.getLocalizedMessage(), e);

            alertService
                    .addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));

            throw new ObjectCreationException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.application.entity.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.