Search in sources :

Example 11 with EJMessage

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

the class EJRWTTreeTableRecordBlockRenderer method askToDeleteRecord.

@Override
public void askToDeleteRecord(final EJDataRecord recordToDelete, String msg) {
    if (msg == null) {
        msg = "Are you sure you want to delete the current record?";
    }
    EJMessage message = new EJMessage(msg);
    EJQuestion question = new EJQuestion(new EJForm(_block.getForm()), "DELETE_RECORD", "Delete", message, "Yes", "No") {

        @Override
        public void setAnswer(EJQuestionButton answerButton) {
            super.setAnswer(answerButton);
            if (EJQuestionButton.ONE == answerButton) {
                _block.getBlock().deleteRecord(recordToDelete);
            }
            _block.setRendererFocus(true);
        }
    };
    _block.getForm().getMessenger().askQuestion(question);
}
Also used : EJQuestionButton(org.entirej.framework.core.enumerations.EJQuestionButton) EJQuestion(org.entirej.framework.core.data.controllers.EJQuestion) EJForm(org.entirej.framework.core.EJForm) EJMessage(org.entirej.framework.core.EJMessage)

Example 12 with EJMessage

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

the class EJRWTTreeTableRecordBlockRenderer method enterInsert.

@Override
public void enterInsert(EJDataRecord record) {
    if (_block.getInsertScreenRenderer() == null) {
        EJMessage message = new EJMessage("Please define an Insert Screen Renderer for this form before an insert operation can be performed.");
        _block.getForm().getMessenger().handleMessage(message);
    } else {
        EJDataRecord focusedRecord = getFocusedRecord();
        if (focusedRecord != null) {
            final String pid = _rendererProp.getStringProperty(EJRWTTreeTableBlockDefinitionProperties.PARENT_ITEM);
            final String rid = _rendererProp.getStringProperty(EJRWTTreeTableBlockDefinitionProperties.RELATION_ITEM);
            record.setValue(rid, focusedRecord.getValue(pid));
        }
        _block.getInsertScreenRenderer().open(record);
    }
}
Also used : EJDataRecord(org.entirej.framework.core.data.EJDataRecord) EJMessage(org.entirej.framework.core.EJMessage)

Example 13 with EJMessage

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

the class EJRWTTreeTableRecordBlockRenderer method enterUpdate.

@Override
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 14 with EJMessage

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

the class EJRWTTreeTableRecordBlockRenderer method enterQuery.

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

Example 15 with EJMessage

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

the class EJRWTTreeRecordBlockRenderer method enterInsert.

@Override
public void enterInsert(EJDataRecord record) {
    if (_block.getInsertScreenRenderer() == null) {
        EJMessage message = new EJMessage("Please define an Insert Screen Renderer for this form before an insert operation can be performed.");
        _block.getForm().getMessenger().handleMessage(message);
    } else {
        EJDataRecord focusedRecord = getFocusedRecord();
        if (focusedRecord != null) {
            final String pid = rendererProp.getStringProperty(EJRWTTreeBlockDefinitionProperties.PARENT_ITEM);
            final String rid = rendererProp.getStringProperty(EJRWTTreeBlockDefinitionProperties.RELATION_ITEM);
            record.setValue(rid, focusedRecord.getValue(pid));
        }
        _block.getInsertScreenRenderer().open(record);
    }
}
Also used : EJDataRecord(org.entirej.framework.core.data.EJDataRecord) 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