当前位置: 首页>>代码示例>>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;未经允许,请勿转载。