Search in sources :

Example 6 with EJMessage

use of org.entirej.framework.core.EJMessage in project rap by entirej.

the class EJRWTListRecordBlockRenderer method enterUpdate.

public void enterUpdate(EJDataRecord recordToUpdate) {
    if (_block.getUpdateScreenRenderer() == null) {
        EJMessage message = new EJMessage("Please define an Update Screen Renderer for this form before an update operation can be performed.");
        _block.getForm().getMessenger().handleMessage(message);
    } else {
        _block.getUpdateScreenRenderer().open(recordToUpdate);
    }
}
Also used : EJMessage(org.entirej.framework.core.EJMessage)

Example 7 with EJMessage

use of org.entirej.framework.core.EJMessage in project rap by entirej.

the class EJRWTMessenger method handleException.

@Override
public void handleException(final Exception exception, boolean showUserMessage) {
    if (exception instanceof EJApplicationException && showUserMessage) {
        EJApplicationException ejApplicationException = (EJApplicationException) exception;
        if (ejApplicationException.stopProcessing() && ejApplicationException.getFrameworkMessage() == null) {
            return;
        }
        // If the EJApplicationException is created with no parameters, the
        // user is using it to halt application processing, therefore there
        // is not need to handler the exception
        logger.error(exception.getMessage(), exception);
        final EJMessage frameworkMessage = ejApplicationException.getFrameworkMessage();
        Display current = Display.getCurrent();
        if (current != null) {
            current.asyncExec(new Runnable() {

                @Override
                public void run() {
                    if (frameworkMessage != null && frameworkMessage.getMessage() != null) {
                        handleMessage(frameworkMessage);
                    } else {
                        handleMessage(new EJMessage(exception.getMessage()));
                    }
                }
            });
        }
    } else if (showUserMessage) {
        logger.error(exception.getMessage(), exception);
        Display current = Display.getCurrent();
        if (current != null) {
            current.asyncExec(new Runnable() {

                @Override
                public void run() {
                    Status status = new Status(IStatus.ERROR, "rwt.ej", exception.getMessage());
                    ErrorDialog dialog = new ErrorDialog(manager.getShell(), "Error", "Internal Error", status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
                    dialog.setBlockOnOpen(false);
                    dialog.open();
                }
            });
        }
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) ErrorDialog(org.eclipse.jface.dialogs.ErrorDialog) EJApplicationException(org.entirej.framework.core.EJApplicationException) EJMessage(org.entirej.framework.core.EJMessage) Display(org.eclipse.swt.widgets.Display)

Example 8 with EJMessage

use of org.entirej.framework.core.EJMessage in project rap by entirej.

the class EJRWTSingleRecordBlockRenderer method enterUpdate.

@Override
public void enterUpdate(EJDataRecord recordToUpdate) {
    if (getBlock().getUpdateScreenRenderer() == null) {
        EJMessage message = new EJMessage("Please define an Update Screen Renderer for this form before an update operation can be performed.");
        getBlock().getForm().getMessenger().handleMessage(message);
    } else {
        getBlock().getUpdateScreenRenderer().open(recordToUpdate);
    }
}
Also used : EJMessage(org.entirej.framework.core.EJMessage)

Example 9 with EJMessage

use of org.entirej.framework.core.EJMessage in project rap by entirej.

the class EJRWTSingleRecordBlockRenderer method enterQuery.

@Override
public void enterQuery(EJDataRecord record) {
    if (getBlock().getQueryScreenRenderer() == null) {
        EJMessage message = new EJMessage("Please define a Query Screen Renderer for this form before a query operation can be performed.");
        getBlock().getForm().getMessenger().handleMessage(message);
    } else {
        getBlock().getQueryScreenRenderer().open(record);
    }
}
Also used : EJMessage(org.entirej.framework.core.EJMessage)

Example 10 with EJMessage

use of org.entirej.framework.core.EJMessage in project rap by entirej.

the class EJRWTSingleRecordBlockRenderer method enterInsert.

@Override
public void enterInsert(EJDataRecord record) {
    if (getBlock().getInsertScreenRenderer() == null) {
        EJMessage message = new EJMessage("Please define an Insert Screen Renderer for this form before an insert operation can be performed.");
        getBlock().getForm().getMessenger().handleMessage(message);
    } else {
        getBlock().getInsertScreenRenderer().open(record);
    }
}
Also used : EJMessage(org.entirej.framework.core.EJMessage)

Aggregations

EJMessage (org.entirej.framework.core.EJMessage)44 EJForm (org.entirej.framework.core.EJForm)9 EJDataRecord (org.entirej.framework.core.data.EJDataRecord)9 EJQuestion (org.entirej.framework.core.data.controllers.EJQuestion)9 EJQuestionButton (org.entirej.framework.core.enumerations.EJQuestionButton)9 EJApplicationException (org.entirej.framework.core.EJApplicationException)5 EJLovController (org.entirej.framework.core.data.controllers.EJLovController)4 EJLovDefinitionProperties (org.entirej.framework.core.properties.interfaces.EJLovDefinitionProperties)4 Date (java.util.Date)3 EJItemLovController (org.entirej.framework.core.data.controllers.EJItemLovController)3 MalformedURLException (java.net.MalformedURLException)2 ArrayList (java.util.ArrayList)2 EJCoreItemProperties (org.entirej.framework.core.properties.EJCoreItemProperties)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 URL (java.net.URL)1 ParseException (java.text.ParseException)1 Collection (java.util.Collection)1 List (java.util.List)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1