Search in sources :

Example 1 with MdwMessageDialog

use of com.centurylink.mdw.plugin.designer.dialogs.MdwMessageDialog in project mdw-designer by CenturyLinkCloud.

the class PluginMessages method uiMessage.

public static void uiMessage(Shell shell, String message, String title, WorkflowProject project, int level) {
    log(message);
    boolean sendMessage = level >= getReportingLevel();
    if (shell != null) {
        MdwMessageDialog messageDialog = new MdwMessageDialog(shell, title, message, level);
        messageDialog.open();
        sendMessage = messageDialog.isReportMessage();
    }
    if (sendMessage)
        PluginUtil.sendError(null, title, message, project, level);
}
Also used : MdwMessageDialog(com.centurylink.mdw.plugin.designer.dialogs.MdwMessageDialog)

Example 2 with MdwMessageDialog

use of com.centurylink.mdw.plugin.designer.dialogs.MdwMessageDialog in project mdw-designer by CenturyLinkCloud.

the class PluginMessages method uiMessage.

public static void uiMessage(Shell shell, Throwable t, String message, String title, WorkflowProject project, int level) {
    log(t);
    if (t instanceof ValidationException || t.getCause() instanceof ValidationException) {
        ValidationException valEx = t instanceof ValidationException ? (ValidationException) t : (ValidationException) t.getCause();
        StringBuilder messageBuf = new StringBuilder();
        valEx.fillInErrors(messageBuf, 3);
        message = messageBuf.toString();
        title = "Validation Error: " + title;
        level = VALIDATION_MESSAGE;
    }
    if (message == null)
        message = PluginMessages.getUserMessage(t);
    boolean sendMessage = level >= getReportingLevel();
    if (shell != null) {
        MdwMessageDialog messageDialog = new MdwMessageDialog(shell, title, message, level);
        messageDialog.open();
        sendMessage = messageDialog.isReportMessage();
    }
    if (sendMessage)
        PluginUtil.sendError(t, title, message, project, level);
}
Also used : ValidationException(com.centurylink.mdw.designer.utils.ValidationException) MdwMessageDialog(com.centurylink.mdw.plugin.designer.dialogs.MdwMessageDialog)

Aggregations

MdwMessageDialog (com.centurylink.mdw.plugin.designer.dialogs.MdwMessageDialog)2 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)1