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

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


            enc.close();
        }
        catch(Exception e) {
            doSetStatus(CampaignStorageConstants.STORAGE_STATUS_ERROR, e.getLocalizedMessage());

            alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), Messages
                    .getString("campaign.storage.local.error.save.object_instance.text")
                    + ": " + e.getLocalizedMessage()));

            throw new CampaignStorageException("Unable to save object instance data: " + e.getLocalizedMessage(), e);
        }
View Full Code Here


            enc.close();
        }
        catch(Exception e) {
            doSetStatus(CampaignStorageConstants.STORAGE_STATUS_ERROR, e.getLocalizedMessage());

            alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), Messages
                    .getString("campaign.storage.local.error.save.object_property.text")
                    + ": " + e.getLocalizedMessage()));

            throw new CampaignStorageException("Unable to save object property data: " + e.getLocalizedMessage(), e);
        }
View Full Code Here

            enc.close();
        }
        catch(Exception e) {
            doSetStatus(CampaignStorageConstants.STORAGE_STATUS_ERROR, e.getLocalizedMessage());

            alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), Messages
                    .getString("campaign.storage.local.error.save.object_template.text")
                    + ": " + e.getLocalizedMessage()));

            throw new CampaignStorageException("Unable to save object template data: " + e.getLocalizedMessage(), e);
        }
View Full Code Here

            enc.close();
        }
        catch(Exception e) {
            doSetStatus(CampaignStorageConstants.STORAGE_STATUS_ERROR, e.getLocalizedMessage());

            alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), Messages
                    .getString("campaign.storage.local.error.save.participant.text")
                    + ": " + e.getLocalizedMessage()));

            throw new CampaignStorageException("Unable to save participant data: " + e.getLocalizedMessage(), e);
        }
View Full Code Here

            enc.close();
        }
        catch(Exception e) {
            doSetStatus(CampaignStorageConstants.STORAGE_STATUS_ERROR, e.getLocalizedMessage());

            alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), Messages
                    .getString("campaign.storage.local.error.save.resource.text")
                    + ": " + e.getLocalizedMessage()));

            throw new CampaignStorageException("Unable to save resource data: " + e.getLocalizedMessage(), e);
        }
View Full Code Here

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

                                alertService.addAlert(new Alert(Alert.Type.ERROR, Messages
                                        .getString("participant.editor.error.source.campaign_list.text"), e
                                        .getLocalizedMessage()));
                            }
                        }
                    }
                }
            });
            campaignListViewer.setInput(participant);
        }

        // owned objects
        Group ownedObjectsGroup = new Group(comp, SWT.BORDER);
        ownedObjectsGroup.setLayout(new FillLayout());
        ownedObjectsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
        ownedObjectsGroup.setText(Messages.getString("participant.editor.group.owned_objects_list.label"));
        {
            ownedObjectsTable = new Table(ownedObjectsGroup, SWT.FULL_SELECTION | SWT.SINGLE);
            // ownedObjectsTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
            ownedObjectsTable.setLinesVisible(false);
            ownedObjectsTable.setHeaderVisible(false);

            ownedObjectsViewer = new TableViewer(ownedObjectsTable);

            TableViewerColumn vCol;
            TableColumn col;

            vCol = new TableViewerColumn(ownedObjectsViewer, SWT.LEFT);
            col = vCol.getColumn();
            col.setText(Messages.getString("participant.editor.owned_objects_list.table.column.item.label"));
            col.setToolTipText(Messages.getString("participant.editor.owned_objects_list.table.column.item.tooltip"));
            col.setResizable(true);
            col.setMoveable(false);
            col.setWidth(1024);

            ownedObjectsViewer.setContentProvider(new ParticipantOwnedObjectsListContentProvider());
            ownedObjectsViewer.setLabelProvider(new ParticipantOwnedObjectsListLabelProvider());
            ownedObjectsViewer.setComparator(new ParticipantOwnedObjectsListComparator());
            ownedObjectsViewer.addSelectionChangedListener(this);
            ownedObjectsViewer.addDoubleClickListener(new IDoubleClickListener() {
                public void doubleClick(DoubleClickEvent event) {
                    logger.debug("double-click: " + event);

                    ISelection selection = event.getSelection();
                    logger.trace("selection: " + selection);

                    if(selection instanceof IStructuredSelection) {
                        Iterator iter = ((IStructuredSelection)selection).iterator();
                        while(iter.hasNext()) {
                            Object obj = iter.next();
                            logger.trace("obj: " + obj);

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

                                alertService.addAlert(new Alert(Alert.Type.ERROR, Messages
                                        .getString("participant.editor.error.source.owned_objects_list.text"), e
                                        .getLocalizedMessage()));
                            }
                        }
                    }
View Full Code Here

        }
        catch(Exception e) {
            logger.error("Exception while saving participant: " + e.getLocalizedMessage(), e);

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

        if(monitor != null) {
            monitor.done();
        }
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, Messages.getString("participant.editor.error.event"), 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()));
                }
            }
        }
        else if(rc == 2) {
            // open tracker
            for(BasicModelObject bmo : encounterCampaignChooserDialog.getSelectedObjects()) {
                try {
                    // EditorUtils.editObject(bmo);
                }
                catch(Exception e) {
                    logger.error("Exception caught while trying to open tracker for: " + bmo + ": "
                            + e.getLocalizedMessage(), e);

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

        public Image getColumnImage(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
                        // TODO
                        break;

                    case 1: // type
                        switch(alert.getType()) {
                            case DEBUG:
                                return alertTypeDebugImage;

                            case INFO:
                                return alertTypeInfoImage;
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.