Search in sources :

Example 1 with EJQuestionButton

use of org.entirej.framework.core.enumerations.EJQuestionButton in project rap by entirej.

the class EJRWTPieChartRecordBlockRenderer 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 2 with EJQuestionButton

use of org.entirej.framework.core.enumerations.EJQuestionButton 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 3 with EJQuestionButton

use of org.entirej.framework.core.enumerations.EJQuestionButton in project rap by entirej.

the class EJRWTMultiRecordBlockRenderer 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 4 with EJQuestionButton

use of org.entirej.framework.core.enumerations.EJQuestionButton in project rap by entirej.

the class EJRWTBarChartRecordBlockRenderer 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 5 with EJQuestionButton

use of org.entirej.framework.core.enumerations.EJQuestionButton in project rap by entirej.

the class EJRWTHtmlTableBlockRenderer method askToDeleteRecord.

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)

Aggregations

EJQuestionButton (org.entirej.framework.core.enumerations.EJQuestionButton)11 EJForm (org.entirej.framework.core.EJForm)9 EJMessage (org.entirej.framework.core.EJMessage)9 EJQuestion (org.entirej.framework.core.data.controllers.EJQuestion)9 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)2 EJApplicationException (org.entirej.framework.core.EJApplicationException)2