List of usage examples for com.google.gwt.safehtml.shared SafeHtmlBuilder append
public SafeHtmlBuilder append(SafeHtml html)
From source file:org.cee.webreader.client.content.EntityContentCell.java
License:Apache License
@Override public void render(Cell.Context context, EntityContent<K> value, SafeHtmlBuilder sb) { if (value != null) { sb.append(SafeHtmlUtil.sanitize(value.getContent())); }/*from www. jav a 2 s.co m*/ }
From source file:org.cloudcoder.app.client.view.BestScoreBarCell.java
License:Open Source License
@Override public void render(com.google.gwt.cell.client.Cell.Context context, E value, SafeHtmlBuilder sb) { if (value == null) { // Data not available, or student did not attempt this problem appendNoInfoBar(sb);//from w ww .j a v a 2s. com return; } // If we don't know the total number of test cases, don't display anything SubmissionReceipt receipt = value.getReceipt(); if (receipt == null || receipt.getNumTestsAttempted() == 0) { appendNoInfoBar(sb); return; } int numTests = receipt.getNumTestsAttempted(); int numPassed = receipt.getNumTestsPassed(); StringBuilder buf = new StringBuilder(); buf.append("<div class=\"cc-barOuter\"><div class=\"cc-barInner\" style=\"width: "); int pct = (numPassed * 10000) / (numTests * 100); buf.append(pct); buf.append("%\"></div></div>"); String s = buf.toString(); sb.append(SafeHtmlUtils.fromSafeConstant(s)); }
From source file:org.cloudcoder.app.client.view.BestScoreBarCell.java
License:Open Source License
private void appendNoInfoBar(SafeHtmlBuilder sb) { sb.append(SafeHtmlUtils.fromSafeConstant("<div class=\"cc-barNoInfo\"></div>")); }
From source file:org.codesearch.indexer.client.ui.dashboard.ProgressBarCell.java
License:Open Source License
@Override public void render(Context context, Number value, SafeHtmlBuilder sb) { SafeHtml message = SafeHtmlUtils.fromString(String.valueOf((int) (value.floatValue() * 100) + "%")); ProgressBarWidthSafeStyle barWidth = new ProgressBarWidthSafeStyle(progressbarWidth); ProgressBarWidthSafeStyle valueWidth = new ProgressBarWidthSafeStyle( (int) (value.floatValue() * progressbarWidth)); SafeHtml safeHtml = TEMPLATES.progressBarWithValue(message, barWidth, valueWidth); sb.append(safeHtml); GWT.log(safeHtml.asString());//from w ww .j av a2 s .c o m }
From source file:org.drools.guvnor.client.decisiontable.cells.AnalysisCell.java
License:Apache License
@Override public void render(Context context, Analysis analysis, SafeHtmlBuilder sb) { sb.append(SafeHtmlUtils.fromTrustedString(analysis.toHtmlString())); }
From source file:org.drools.guvnor.client.decisiontable.cells.PopupBoundPatternDropDownEditCell.java
License:Apache License
@Override public void render(Context context, String value, SafeHtmlBuilder sb) { if (value != null) { sb.append(renderer.render(value)); }// w w w . j a v a 2s.c o m }
From source file:org.drools.guvnor.client.decisiontable.cells.PopupDateEditCell.java
License:Apache License
@Override public void render(Context context, Date value, SafeHtmlBuilder sb) { if (value != null) { sb.append(renderer.render(format.format(value))); }//w w w. ja v a 2 s .c o m }
From source file:org.drools.guvnor.client.decisiontable.cells.PopupDropDownEditCell.java
License:Apache License
@Override public void render(Context context, String value, SafeHtmlBuilder sb) { //We need to get the list of potential values to lookup the "Display" value from the "Stored" value. //Since the content of the list may be different for each cell (dependent enumerations) the list //has to be populated "on demand". DropDownData dd = sce.getEnums(this.factType, this.factField, this.dropDownManager.getCurrentValueMap(context)); if (dd == null) { return;/*from w w w . jav a2 s . co m*/ } setItems(dd.fixedList); //Render value if (value != null) { String label = getLabel(value); sb.append(renderer.render(label)); } }
From source file:org.drools.guvnor.client.decisiontable.cells.PopupNumericBigDecimalEditCell.java
License:Apache License
@Override public void render(Context context, BigDecimal value, SafeHtmlBuilder sb) { if (value != null) { sb.append(renderer.render(value.toPlainString())); }//from w ww . j av a 2s .c o m }
From source file:org.drools.guvnor.client.decisiontable.cells.PopupNumericBigIntegerEditCell.java
License:Apache License
@Override public void render(Context context, BigInteger value, SafeHtmlBuilder sb) { if (value != null) { sb.append(renderer.render(value.toString())); }/*ww w. j ava 2s .co m*/ }