List of usage examples for com.google.gwt.safehtml.shared SafeHtmlBuilder appendHtmlConstant
public SafeHtmlBuilder appendHtmlConstant(String html)
From source file:org.drools.guvnor.client.widgets.tables.LogPagedTable.java
License:Apache License
@Override protected void addAncillaryColumns(ColumnPicker<LogPageRow> columnPicker, SortableHeaderGroup<LogPageRow> sortableHeaderGroup) { // Things got messy with nested, nested anonymous classes AbstractCell<Long> severityCell = new AbstractCell<Long>() { @Override//w w w . j a va 2 s. c o m public void render(Context context, Long value, SafeHtmlBuilder sb) { if (value.intValue() == 0) { sb.appendHtmlConstant(HTML_ERROR_ICON); } else if (value.intValue() == 1) { sb.appendHtmlConstant(HTML_INFO_ICON); } } }; Column<LogPageRow, Long> severityColumn = new Column<LogPageRow, Long>(severityCell) { public Long getValue(LogPageRow row) { return Long.valueOf(row.getSeverity()); } }; columnPicker.addColumn(severityColumn, new SortableHeader<LogPageRow, Long>(sortableHeaderGroup, constants.Severity(), severityColumn), true); Column<LogPageRow, String> messageColumn = new Column<LogPageRow, String>(new TextCell()) { public String getValue(LogPageRow row) { return row.getMessage(); } }; columnPicker.addColumn(messageColumn, new SortableHeader<LogPageRow, String>(sortableHeaderGroup, constants.Message(), messageColumn), true); Column<LogPageRow, Date> timestampColumn = new Column<LogPageRow, Date>( new DateCell(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM))) { public Date getValue(LogPageRow row) { return row.getTimestamp(); } }; columnPicker.addColumn(timestampColumn, new SortableHeader<LogPageRow, Date>(sortableHeaderGroup, constants.Timestamp(), timestampColumn), true); }
From source file:org.drools.workbench.screens.enums.client.widget.DeleteButtonCellWidget.java
License:Apache License
@Override public void render(Context context, SafeHtml data, SafeHtmlBuilder sb) { final ImageResource imageResource = ItemImages.INSTANCE.deleteItemSmall(); sb.appendHtmlConstant("<input type=\"image\" src=\"" + imageResource.getURL() + "\" tabindex=\"-1\">"); sb.appendHtmlConstant("</input>"); }
From source file:org.drools.workbench.screens.guided.dtable.client.widget.analysis.reporting.NoteBuilder.java
License:Apache License
public NoteBuilder(final SafeHtmlBuilder htmlBuilder, final T parent) { this.htmlBuilder = htmlBuilder; this.parent = parent; htmlBuilder.appendHtmlConstant("<blockquote>"); }
From source file:org.drools.workbench.screens.guided.dtable.client.widget.analysis.reporting.TableBuilder.java
License:Apache License
public TableBuilder(final SafeHtmlBuilder htmlBuilder, final T parent) { this.htmlBuilder = htmlBuilder; this.parent = parent; htmlBuilder.appendHtmlConstant( "<table class='" + GuidedDecisionTableResources.INSTANCE.analysisCss().exampleTable() + "'>"); }
From source file:org.drools.workbench.screens.guided.dtable.client.widget.analysis.reporting.Util.java
License:Apache License
public static void addParagraph(final SafeHtmlBuilder htmlBuilder, final String text) { htmlBuilder.appendHtmlConstant("<p>"); htmlBuilder.appendEscaped(text);/*w ww . j a va 2s . com*/ htmlBuilder.appendHtmlConstant("</p>"); }
From source file:org.drools.workbench.screens.guided.scorecard.client.widget.DynamicSelectionCell.java
License:Apache License
@Override public void render(final Context context, final String value, final SafeHtmlBuilder sb) { // Get the view data. final Object key = context.getKey(); String viewData = getViewData(key); if (viewData != null && viewData.equals(value)) { clearViewData(key);// ww w.j av a2s . c o m viewData = null; } final int selectedIndex = getSelectedIndex(viewData == null ? value : viewData); sb.appendHtmlConstant("<select tabindex=\"-1\">"); int index = 0; for (String option : options) { if (index++ == selectedIndex) { sb.append(template.selected(option)); } else { sb.append(template.deselected(option)); } } sb.appendHtmlConstant("</select>"); }
From source file:org.drools.workbench.services.verifier.api.client.reporting.TableBuilder.java
License:Apache License
public TableBuilder(final SafeHtmlBuilder htmlBuilder, final T parent) { this.htmlBuilder = htmlBuilder; this.parent = parent; htmlBuilder.appendHtmlConstant( "<table class='" + AnalyzerResources.INSTANCE.analysisCss().exampleTable() + "'>"); }
From source file:org.ebayopensource.turmeric.policy.adminui.client.view.policy.CustomPermissionCheckboxCell.java
License:Open Source License
/** * Render.//from www . ja v a2 s .co m * * @param value * the value * @param key * the key * @param sb * the sb */ public void render(C value, Object key, SafeHtmlBuilder sb) { if (value == null) { return; } // if the user has permission for the action, then render according to // the boolean value else render as disabled List<UserAction> permitted = permittedActions.get(value); UserAction pending = pendingActions.get(value); if (permitted != null && permitted.contains(this.action)) { if (pending != null && pending.equals(this.action)) { sb.appendHtmlConstant("<input type='checkbox' checked></input>"); } else { sb.appendHtmlConstant("<input type='checkbox'></input>"); } } else { // render as disabled if (pending != null && pending.equals(this.action)) { sb.appendHtmlConstant("<input type='checkbox' disabled=disabled checked></input>"); } else { sb.appendHtmlConstant("<input type='checkbox' disabled=disabled></input>"); } } }
From source file:org.ebayopensource.turmeric.policy.adminui.client.view.policy.DescriptionCell.java
License:Open Source License
/** * Render.//from w ww.jav a 2 s .c o m * * @param sg * the sg * @param arg1 * the arg1 * @param safeHtml * the safe html * @see com.google.gwt.cell.client.AbstractCell#render(java.lang.Object, * java.lang.Object, com.google.gwt.safehtml.shared.SafeHtmlBuilder) */ public void render(final String sg, final Object arg1, final SafeHtmlBuilder safeHtml) { safeHtml.appendHtmlConstant("<div><p class=\"clickable\">"); if (sg != null) { int length = 10; if (sg.length() < length) { length = sg.length(); } safeHtml.appendEscaped(sg.substring(0, length).trim() + "..."); } safeHtml.appendHtmlConstant("</p></div>"); }
From source file:org.eclipse.che.ide.command.editor.page.text.MacroCompletionProposal.java
License:Open Source License
private void appendHighlighted(SafeHtmlBuilder builder, String text) { builder.appendHtmlConstant("<span class=\"" + resources.coreCss().codeassistantHighlight() + "\">"); builder.appendEscaped(text);//from www. j a v a 2s. c o m builder.appendHtmlConstant("</span>"); }