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

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


        public String getColumnText(Object element, int columnIndex) {
            logger.debug("get column image: " + element + "; column: " + columnIndex);

            if(element instanceof Alert) {
                Alert alert = (Alert)element;
                logger.trace("alert: " + alert);

                switch(columnIndex) {
                    case 0: // date
                        return new SimpleDateFormat().format(alert.getDate());

                    case 1: // type
                        return alert.getType().toString();

                    case 2: // source
                        return alert.getSource();

                    case 3: // message
                        return alert.getMessage();
                }
            }

            return null;
        }
View Full Code Here


                }
                catch(Exception e) {
                    logger.error("Exception caught while trying to open editor for: " + bmo + ": "
                            + e.getLocalizedMessage(), e);

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

            objectInstanceBuilder.setObjectInstanceBuilderDialog(dialog);

            if(!objectInstanceBuilder.buildObjectInstance(oi)) {
                logger.warn("Object instance build was incomplete; see previous log entries for details.");

                alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
                        .getString("campaign.manager.actions.object_instance.create.error.build_incomplete.text")));

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

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

            return;
        }

        campaign.addObjectInstance(oi);

        // save the object instance and the campaign
        try {
            oi.save();
            campaign.save();
        }
        catch(Exception e) {
            logger.error("Exception while trying to save object instance: " + e.getLocalizedMessage(), e);

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

        // open editor
        try {
            logger.info("Attempting to open editor for instance: " + oi);
            EditorUtils.editObject(oi);
        }
        catch(Exception e) {
            logger.error("Exception while trying to open object instance editor: " + e.getLocalizedMessage(), e);

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

        logger.info("Done executing 'create object instance' action.");
    }
View Full Code Here

            objectTemplateBuilder.setDialog(dialog);

            if(!objectTemplateBuilder.buildObjectTemplate(ot)) {
                logger.info("Object template build was incomplete; see previous log entries for details.");

                alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
                        .getString("campaign.manager.actions.object_template.create.error.build_incomplete.text")));

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

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

            return;
        }

        campaign.addObject(ot);

        // save the object template and the campaign
        try {
            ot.save();
            campaign.save();
        }
        catch(Exception e) {
            logger.error("Exception while trying to save object template: " + e.getLocalizedMessage(), e);

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

        // open editor
        try {
            logger.info("Attempting to open editor for template: " + ot);
            EditorUtils.editObject(ot);
        }
        catch(Exception e) {
            logger.error("Exception while trying to open object template editor: " + e.getLocalizedMessage(), e);

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

        logger.info("Done executing 'create object template' action.");
    }
View Full Code Here

                }
                catch(Exception e) {
                    logger.error("Exception caught while trying to open editor for: " + bmo + ": "
                            + e.getLocalizedMessage(), e);

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

                campaignManager.deleteCampaign(campaign);
            }
            catch(Exception e) {
                logger.error("Exception caught while trying to delete campaign: " + e.getLocalizedMessage(), e);

                alertService.addAlert(new Alert(Alert.Type.ERROR, DeleteCampaignAction.class.getSimpleName(), Messages
                        .getString("campaign.manager.ui.action.campaign.delete.error.text")
                        + ": " + e.getLocalizedMessage()));
            }
        }
View Full Code Here

            participantBuilder.setDialog(dialog);

            if(!participantBuilder.buildParticipant(p)) {
                logger.info("Participant build was incomplete; see previous log entries for details.");

                alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
                        .getString("campaign.manager.actions.participant.create.error.build_incomplete.text")));

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

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

            return;
        }

        if(campaign != null) {
            campaign.addParticipant(p);
        }

        // save the participant and the campaign
        try {
            participantManager.registerParticipant(p);
            if(campaign != null) {
                campaign.save();
            }
        }
        catch(Exception e) {
            logger.error("Exception while trying to save participant: " + e.getLocalizedMessage(), e);

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

        // open editor
        try {
            logger.info("Attempting to open editor for participant: " + p);
            EditorUtils.editObject(p);
        }
        catch(Exception e) {
            logger.error("Exception while trying to open participant editor: " + e.getLocalizedMessage(), e);

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

        logger.info("Done executing 'create participant' action.");
    }
View Full Code Here

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

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

        logger.info("Done executing 'select participant' action.");
    }
View Full Code Here

        }
        catch(Exception e) {
            logger.error("Exception caught while handling OSGi event: " + e.getLocalizedMessage(), e);

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

                }
                catch(Exception e) {
                    logger.error("Exception caught while trying to open editor for: " + bmo + ": "
                            + e.getLocalizedMessage(), e);

                    alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e
                            .getLocalizedMessage()));
                }
            }
        }
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.