當前位置: 首頁>>代碼示例>>Java>>正文


Java FacesMessage.SEVERITY_WARN屬性代碼示例

本文整理匯總了Java中javax.faces.application.FacesMessage.SEVERITY_WARN屬性的典型用法代碼示例。如果您正苦於以下問題:Java FacesMessage.SEVERITY_WARN屬性的具體用法?Java FacesMessage.SEVERITY_WARN怎麽用?Java FacesMessage.SEVERITY_WARN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.faces.application.FacesMessage的用法示例。


在下文中一共展示了FacesMessage.SEVERITY_WARN屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: MessageTest

public MessageTest(String severity, String summary, String detail,
                   String clientId)
{
  FacesMessage.Severity sev = FacesMessage.SEVERITY_INFO;

  if (severity != null)
  {
    if ("ERROR".equals(severity))
      sev = FacesMessage.SEVERITY_ERROR;
    else if ("WARN".equals(severity) || "WARNING".equals(severity))
      sev = FacesMessage.SEVERITY_WARN;
    else if ("FATAL".equals(severity))
      sev = FacesMessage.SEVERITY_FATAL;
  }
  
  _messages.put(clientId, new FacesMessage(sev, summary, detail));
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:17,代碼來源:TestScript.java

示例2: hasWarnings

public static boolean hasWarnings(FacesContext fc) {
    for (Iterator<FacesMessage> i = fc.getMessages(); i.hasNext();) {
        FacesMessage m = i.next();
        if (FacesMessage.SEVERITY_WARN == m.getSeverity()) {
            return true;
        }
    }
    return false;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:9,代碼來源:JSFUtils.java

示例3: givenJSFUtilsMessage

/**
 * @param contextStub
 */
@SuppressWarnings("unused")
private void givenJSFUtilsMessage(FacesContextStub contextStub, String key,
        String value, Object[] params) {
    setResourceBundle(contextStub, key, value);

    FacesMessage firstFM = new FacesMessage(FacesMessage.SEVERITY_WARN,
            value, null);
    firstFM.setDetail(value);
    firstFM.setSummary(value);
    contextStub.addMessage(null, firstFM);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:14,代碼來源:ManageLanguageCtrlTest.java

示例4: getMessageTypeFromSeverity

/**
 * Returns a string constant message type for the severity
 * of a message.
 */
public static String getMessageTypeFromSeverity(
 FacesMessage.Severity severity)
{
  if (severity == FacesMessage.SEVERITY_INFO)
    return CoreMessage.MESSAGE_TYPE_INFO;
  else if (severity == FacesMessage.SEVERITY_WARN)
    return CoreMessage.MESSAGE_TYPE_WARNING;
  else
    return CoreMessage.MESSAGE_TYPE_ERROR;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:14,代碼來源:MessageUtils.java

示例5: addWarningMsg

public static void addWarningMsg(String mensagem,String idFormulario, String idComponente)
{
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_WARN, mensagem, mensagem);
    FacesContext  context = FacesContext.getCurrentInstance();
    context.addMessage(null, fm);  
    RequestContext.getCurrentInstance().update(idFormulario+":"+idComponente);
}
 
開發者ID:JIGAsoftSTP,項目名稱:NICON,代碼行數:8,代碼來源:Message.java

示例6: addWarningMsg

public static void addWarningMsg(String mensagem)
{
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_WARN, mensagem, mensagem);
    FacesContext  context = FacesContext.getCurrentInstance();
    context.addMessage(null, fm);  
}
 
開發者ID:JIGAsoftSTP,項目名稱:NICON,代碼行數:7,代碼來源:Mensagem.java

示例7: asWarn

public FacesMessages asWarn() {
    severity = FacesMessage.SEVERITY_WARN;
    return this;
}
 
開發者ID:atbashEE,項目名稱:atbash-octopus,代碼行數:4,代碼來源:FacesMessages.java

示例8: mapToFaces

static FacesMessage.Severity mapToFaces(ReturnType type) {
    if (type == ReturnType.WARNING) {
        return FacesMessage.SEVERITY_WARN;
    }
    return FacesMessage.SEVERITY_INFO;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:6,代碼來源:ResponseHandler.java

示例9: deleteTask

public void deleteTask(Long id) {

        log.log(Level.INFO, "delete task of [email protected]{0}", id);

        Task task = taskService.findById(id);
        taskService.deleteById(id);

        // retrieve all tasks
        retrieveAllTasks();

        FacesMessage deleteInfo = new FacesMessage(FacesMessage.SEVERITY_WARN, "Task is deleted!", "Task is deleted!");
        FacesContext.getCurrentInstance().addMessage(null, deleteInfo);
    }
 
開發者ID:hantsy,項目名稱:javaee8-jsf-sample,代碼行數:13,代碼來源:TaskHome.java


注:本文中的javax.faces.application.FacesMessage.SEVERITY_WARN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。