hudson.Util.wrapToErrorSpan()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(201)

本文整理了Java中hudson.Util.wrapToErrorSpan()方法的一些代码示例,展示了Util.wrapToErrorSpan()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.wrapToErrorSpan()方法的具体详情如下:
包路径:hudson.Util
类名称:Util
方法名:wrapToErrorSpan

Util.wrapToErrorSpan介绍

[英]Wraps with the error icon and the CSS class to render error message.
[中]使用错误图标和CSS类包装以呈现错误消息。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml() {
  5. String humanReadableSpace = Functions.humanReadableByteSize(size);
  6. if(triggered) {
  7. return Util.wrapToErrorSpan(humanReadableSpace);
  8. }
  9. return humanReadableSpace;
  10. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml(MemoryUsage usage) {
  5. if(usage.availableSwapSpace==-1)
  6. return "N/A";
  7. String humanReadableSpace = Functions.humanReadableByteSize(usage.availableSwapSpace);
  8. long free = usage.availableSwapSpace;
  9. free/=1024L; // convert to KB
  10. free/=1024L; // convert to MB
  11. if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
  12. return humanReadableSpace; // if we have more than 256MB free or less than 80% filled up, it's OK
  13. // Otherwise considered dangerously low.
  14. return Util.wrapToErrorSpan(humanReadableSpace);
  15. }

代码示例来源:origin: jenkinsci/jenkins

  1. public String toHtml() {
  2. String s = toString();
  3. if(isDangerous())
  4. s = Util.wrapToErrorSpan(s);
  5. return s;
  6. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml(MemoryUsage usage) {
  5. if(usage.availableSwapSpace==-1)
  6. return "N/A";
  7. long free = usage.availableSwapSpace;
  8. free/=1024L; // convert to KB
  9. free/=1024L; // convert to MB
  10. if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
  11. return free+"MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  12. // Otherwise considered dangerously low.
  13. return Util.wrapToErrorSpan(free+"MB");
  14. }

代码示例来源:origin: hudson/hudson-2.x

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml(MemoryUsage usage) {
  5. if(usage.availableSwapSpace==-1)
  6. return "N/A";
  7. long free = usage.availableSwapSpace;
  8. free/=1024L; // convert to KB
  9. free/=1024L; // convert to MB
  10. if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
  11. return free+"MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  12. // Otherwise considered dangerously low.
  13. return Util.wrapToErrorSpan(free+"MB");
  14. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml() {
  5. String humanReadableSpace = Functions.humanReadableByteSize(size);
  6. if(triggered) {
  7. return Util.wrapToErrorSpan(humanReadableSpace);
  8. }
  9. return humanReadableSpace;
  10. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml() {
  5. long space = size;
  6. space/=1024L; // convert to KB
  7. space/=1024L; // convert to MB
  8. if(triggered) {
  9. // less than a GB
  10. return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString()+"GB");
  11. }
  12. return space/1024+"GB";
  13. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml() {
  5. long space = size;
  6. space /= 1024L; // convert to KB
  7. space /= 1024L; // convert to MB
  8. if (triggered) {
  9. // less than a GB
  10. return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString() + "GB");
  11. }
  12. return space / 1024 + "GB";
  13. }

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml() {
  5. long space = size;
  6. space/=1024L; // convert to KB
  7. space/=1024L; // convert to MB
  8. if(triggered) {
  9. // less than a GB
  10. return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString()+"GB");
  11. }
  12. return space/1024+"GB";
  13. }

代码示例来源:origin: hudson/hudson-2.x

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml() {
  5. long space = size;
  6. space/=1024L; // convert to KB
  7. space/=1024L; // convert to MB
  8. if(triggered) {
  9. // less than a GB
  10. return Util.wrapToErrorSpan(new BigDecimal(space).scaleByPowerOfTen(-3).toPlainString()+"GB");
  11. }
  12. return space/1024+"GB";
  13. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml(MemoryUsage usage) {
  5. if(usage.availableSwapSpace==-1)
  6. return "N/A";
  7. String humanReadableSpace = Functions.humanReadableByteSize(usage.availableSwapSpace);
  8. long free = usage.availableSwapSpace;
  9. free/=1024L; // convert to KB
  10. free/=1024L; // convert to MB
  11. if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
  12. return humanReadableSpace; // if we have more than 256MB free or less than 80% filled up, it's OK
  13. // Otherwise considered dangerously low.
  14. return Util.wrapToErrorSpan(humanReadableSpace);
  15. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. public String toHtml() {
  2. String s = toString();
  3. if(isDangerous())
  4. s = Util.wrapToErrorSpan(s);
  5. return s;
  6. }

代码示例来源:origin: hudson/hudson-2.x

  1. public String toHtml() {
  2. String s = toString();
  3. if(isDangerous())
  4. s = Util.wrapToErrorSpan(s);
  5. return s;
  6. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. public String toHtml() {
  2. String s = toString();
  3. if(isDangerous())
  4. s = Util.wrapToErrorSpan(s);
  5. return s;
  6. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. public String toHtml() {
  2. String s = toString();
  3. if (isDangerous()) {
  4. s = Util.wrapToErrorSpan(s);
  5. }
  6. return s;
  7. }

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. public String toHtml() {
  2. String s = toString();
  3. if(isDangerous())
  4. s = Util.wrapToErrorSpan(s);
  5. return s;
  6. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. /**
  2. * HTML rendering of the data
  3. */
  4. @Override
  5. public String toString() {
  6. // StringBuilder buf = new StringBuilder();
  7. // for (long l : past5) {
  8. // if(buf.length()>0) buf.append(',');
  9. // buf.append(l);
  10. // }
  11. // return buf.toString();
  12. int fc = failureCount();
  13. if (fc > 0) {
  14. return Util.wrapToErrorSpan(Messages.ResponseTimeMonitor_TimeOut(fc));
  15. }
  16. return getAverage() + "ms";
  17. }
  18. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. /**
  2. * HTML rendering of the data
  3. */
  4. @Override
  5. public String toString() {
  6. // StringBuilder buf = new StringBuilder();
  7. // for (long l : past5) {
  8. // if(buf.length()>0) buf.append(',');
  9. // buf.append(l);
  10. // }
  11. // return buf.toString();
  12. int fc = failureCount();
  13. if(fc>0)
  14. return Util.wrapToErrorSpan(Messages.ResponseTimeMonitor_TimeOut(fc));
  15. return getAverage()+"ms";
  16. }
  17. }

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml(NativeSystemMemory usage) {
  5. if(usage.getAvailableSwapSpace() == -1)
  6. return "N/A";
  7. long free = usage.getAvailableSwapSpace();
  8. free/=1024L; // convert to KB
  9. free/=1024L; // convert to MB
  10. if(free>256 || usage.getTotalSwapSpace() < usage.getAvailableSwapSpace() * 5)
  11. return free+"MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  12. // Otherwise considered dangerously low.
  13. return Util.wrapToErrorSpan(free+"MB");
  14. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. /**
  2. * Returns the HTML representation of the space.
  3. */
  4. public String toHtml(NativeSystemMemory usage) {
  5. if (usage.getAvailableSwapSpace() == -1) {
  6. return "N/A";
  7. }
  8. long free = usage.getAvailableSwapSpace();
  9. free /= 1024L; // convert to KB
  10. free /= 1024L; // convert to MB
  11. if (free > 256 || usage.getTotalSwapSpace() < usage.getAvailableSwapSpace() * 5) {
  12. return free + "MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
  13. }
  14. // Otherwise considered dangerously low.
  15. return Util.wrapToErrorSpan(free + "MB");
  16. }

相关文章