当前位置: 首页>>代码示例>>Java>>正文


Java FacesMessage.SEVERITY_INFO属性代码示例

本文整理汇总了Java中javax.faces.application.FacesMessage.SEVERITY_INFO属性的典型用法代码示例。如果您正苦于以下问题:Java FacesMessage.SEVERITY_INFO属性的具体用法?Java FacesMessage.SEVERITY_INFO怎么用?Java FacesMessage.SEVERITY_INFO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.faces.application.FacesMessage的用法示例。


在下文中一共展示了FacesMessage.SEVERITY_INFO属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sGetMaxSeverity

public static FacesMessage.Severity sGetMaxSeverity(UIXRenderingContext context)
{
  // This doesn't seem to work if there is a global message
  // return context.getFacesContext().getMaximumSeverity();
  FacesMessage.Severity max = FacesMessage.SEVERITY_INFO;
  Iterator<MessageWrapper> itr = sGetIterator(context, true);
  while (itr.hasNext())
  {
    FacesMessage nxt = itr.next();
    FacesMessage.Severity sev = nxt.getSeverity();
    if (sev.compareTo(max) > 0)
    {
      max = sev;
      if (FacesMessage.SEVERITY_FATAL.compareTo(max) == 0)
        return FacesMessage.SEVERITY_FATAL;
    }
  }
  return max;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:19,代码来源:MessageBoxUtils.java

示例2: 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

示例3: addInfoMsg

public static void addInfoMsg(String mensagem)
{
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, mensagem, mensagem);
    FacesContext  context = FacesContext.getCurrentInstance();
    context.addMessage(null, fm);  
}
 
开发者ID:JIGAsoftSTP,项目名称:NICON,代码行数:7,代码来源:Mensagem.java

示例4: save

public String save() {
    LOG.log(Level.INFO, "saving [email protected]{0}", task);
    if (this.task.getId() == null) {
        this.task = taskService.save(task);
    } else {
        this.task = taskService.update(taskId, task);
    }
    FacesMessage info = new FacesMessage(FacesMessage.SEVERITY_INFO, "Task is saved successfully!", "Task is saved successfully!");
    FacesContext.getCurrentInstance().addMessage(null, info);

    return "/tasks.xhtml?faces-redirect=true";
}
 
开发者ID:hantsy,项目名称:javaee8-jsf-sample,代码行数:12,代码来源:EditTaskAction.java

示例5: determineSeverity

private FacesMessage.Severity determineSeverity(String key) {
    FacesMessage.Severity result = FacesMessage.SEVERITY_INFO;
    String[] parts = key.substring(1).split("\\.");
    result = checkSeverity(result, parts[0], "error", FacesMessage.SEVERITY_ERROR);
    result = checkSeverity(result, parts[0], "warn", FacesMessage.SEVERITY_WARN);
    result = checkSeverity(result, parts[0], "fatal", FacesMessage.SEVERITY_FATAL);
    return result;
}
 
开发者ID:atbashEE,项目名称:atbash-octopus,代码行数:8,代码来源:FacesMessages.java

示例6: 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

示例7: getMaximumSeverity

@Override
public FacesMessage.Severity getMaximumSeverity()
{
  FacesMessage.Severity max = FacesMessage.SEVERITY_INFO;

  Iterator<String> clients = getClientIdsWithMessages();
  while (clients.hasNext())
  {
    String messagesKey = clients.next();
    List<FacesMessage> messages = _messages.get(messagesKey);
    int len = _messages.size();
    for (int i = 0; i < len; i++)
    {
      FacesMessage fm = messages.get(i);
      FacesMessage.Severity nextSev = fm.getSeverity();

      if (max.compareTo(nextSev) < 0)
      {
        max = nextSev;
        if (max.compareTo(FacesMessage.SEVERITY_FATAL) >= 0)
        {
          return max;
        }
      }
    }
  }
  return max;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:28,代码来源:MFacesContext.java

示例8: addDetailMessage

public static void addDetailMessage(String message, FacesMessage.Severity severity) {

        FacesMessage facesMessage = new FacesMessage("", message);
        if (severity != null && severity != FacesMessage.SEVERITY_INFO) {
            facesMessage.setSeverity(severity);
        }

        FacesContext.getCurrentInstance().addMessage(null, facesMessage);
    }
 
开发者ID:adminfaces,项目名称:admin-persistence,代码行数:9,代码来源:Messages.java

示例9: addInfoMsg

public static void addInfoMsg(String mensagem,String idFormulario, String idComponente)
{
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, mensagem, mensagem);
    FacesContext  context = FacesContext.getCurrentInstance();
    context.addMessage(null, fm); 
     RequestContext.getCurrentInstance().update(idFormulario+":"+idComponente);
}
 
开发者ID:JIGAsoftSTP,项目名称:NICON,代码行数:8,代码来源:Message.java

示例10: onDragDrop

public void onDragDrop(TreeDragDropEvent event) {
/* 77 */     TreeNode dragNode = event.getDragNode();
/* 78 */     TreeNode dropNode = event.getDropNode();
/* 79 */     int dropIndex = event.getDropIndex();
/*    */ 
/* 81 */     FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Dragged " + dragNode.getData(), "Dropped on " + dropNode.getData() + " at " + dropIndex);
/* 82 */     FacesContext.getCurrentInstance().addMessage(null, message);
/*    */   }
 
开发者ID:marlonalexis,项目名称:Multicentro_Mascotas,代码行数:8,代码来源:DragDropView.java

示例11: setMessage

public static void setMessage(String id, String msg) {
	FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
	getCurrentInstance().addMessage(id, message);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:4,代码来源:JSFUtil.java

示例12: asInfo

public FacesMessages asInfo() {
    severity = FacesMessage.SEVERITY_INFO;
    return this;
}
 
开发者ID:atbashEE,项目名称:atbash-octopus,代码行数:4,代码来源:FacesMessages.java

示例13: 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

示例14: addSuccessMessage

public static void addSuccessMessage(String msg) {
    FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
    FacesContext.getCurrentInstance().addMessage("successInfo", facesMsg);
}
 
开发者ID:javaee-samples,项目名称:javaee8-applications,代码行数:4,代码来源:JsfUtil.java

示例15: addMessage

public void addMessage(String summary, String detail) {
    FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, summary, detail);
    FacesContext.getCurrentInstance().addMessage(null, message);
}
 
开发者ID:kashm1r,项目名称:photoiff,代码行数:4,代码来源:PessoaBean.java


注:本文中的javax.faces.application.FacesMessage.SEVERITY_INFO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。