private void paint(PaintTarget target) throws PaintException { // If full repaint repaint all injections if (target.isFullRepaint()) { injectedStyles.addAll(pendingInjections); pendingInjections = injectedStyles; injectedStyles = new LinkedHashSet<>(); } if (!pendingInjections.isEmpty()) { target.startTag("css-injections"); for (InjectedStyle pending : pendingInjections) { int id = injectedStyles.size(); pending.paint(id, target); injectedStyles.add(pending); } pendingInjections.clear(); target.endTag("css-injections"); } } }
@Override public void paint(int id, PaintTarget target) throws PaintException { target.startTag("css-string"); target.addAttribute("id", id); target.addText(css); target.endTag("css-string"); } }
@Override public void paint(int id, PaintTarget target) throws PaintException { target.startTag("css-resource"); target.addAttribute("id", id); target.addAttribute("url", resource); target.endTag("css-resource"); }
@Override public void paint(PaintTarget target) throws PaintException { target.startTag("-ac"); target.addAttribute("name", getIdentifier()); paintContent(target); target.endTag("-ac"); }
@Override public void paint(PaintTarget target) throws PaintException { target.startTag("-ac"); target.addAttribute("name", getIdentifier()); paintContent(target); target.endTag("-ac"); }
target.addAttribute("pid", pid); LegacyPaint.paint(c, target); target.endTag("change");
/** Paint (serialize) the component for the client. */ @Override public void paintContent(PaintTarget target) throws PaintException { target.addAttribute(MenuBarConstants.OPEN_ROOT_MENU_ON_HOWER, openRootOnHover); if (isHtmlContentAllowed()) { target.addAttribute(MenuBarConstants.HTML_CONTENT_ALLOWED, true); } target.startTag("options"); if (getWidth() > -1) { target.startTag("moreItem"); target.addAttribute("text", moreItem.getText()); if (moreItem.getIcon() != null) { target.addAttribute("icon", moreItem.getIcon()); } target.endTag("moreItem"); } target.endTag("options"); target.startTag("items"); // This generates the tree from the contents of the menu for (MenuItem item : menuItems) { paintItem(target, item); } target.endTag("items"); }
target.endTag("open");
protected void paintUpdatesForGroupRowWithAggregation(PaintTarget target, Object groupId) throws PaintException { target.startTag("updateAggregation"); List<String> values = getAggregatedValuesForGroup(groupId); for (String value : values) { target.addText(value); } target.endTag("updateAggregation"); cachedAggregatedValues.put(groupId, values); }
target.endTag("item");
protected void paintEditableAggregationColumns(PaintTarget target) throws PaintException { target.startTag("editableAggregationColumns"); for (final Object columnId : _visibleColumns()) { if (CollectionUtils.isNotEmpty(aggregationEditableColumns) && aggregationEditableColumns.contains(columnId)) { target.addText(_columnIdMap().key(columnId)); } } target.endTag("editableAggregationColumns"); }
@Override public void paintContent(PaintTarget target) throws PaintException { target.startTag("clear"); target.endTag("clear"); for(Line2D l : lines) { target.startTag("line"); target.addAttribute("from_x", l.getX1()); target.addAttribute("from_y", l.getY1()); target.addAttribute("to_x", l.getX2()); target.addAttribute("to_y", l.getY2()); target.endTag("line"); } }
private void paintActions(PaintTarget target, final Set<Action> actionSet) throws PaintException { if (!actionSet.isEmpty()) { target.addVariable(this, "action", ""); target.startTag("actions"); for (Action a : actionSet) { target.startTag("action"); if (a.getCaption() != null) { target.addAttribute("caption", a.getCaption()); } if (a.getIcon() != null) { target.addAttribute("icon", a.getIcon()); } target.addAttribute("key", actionMapper.key(a)); target.endTag("action"); } target.endTag("actions"); } }
@Override public void paintContent(PaintTarget target) throws PaintException { super.paintContent(target); /* Add filter components to UIDL */ target.startTag(FilterTableConnector.TAG_FILTERS); target.addAttribute(FilterTableConnector.ATTRIBUTE_FILTERS_VISIBLE, filtersVisible); target.addAttribute(FilterTableConnector.ATTRIBUTE_FORCE_RENDER, reRenderFilterFields); reRenderFilterFields = false; for (Object key : getColumnIdToFilterMap().keySet()) { /* Make sure parent is set properly */ if (columnIdToFilterMap.get(key) != null && columnIdToFilterMap.get(key).getParent() == null) { continue; } /* Paint the filter field */ target.startTag(FilterTableConnector.TAG_FILTER_COMPONENT + _columnIdMap.key(key)); target.addAttribute(FilterTableConnector.ATTRIBUTE_COLUMN_ID, _columnIdMap.key(key)); Component c = getColumnIdToFilterMap().get(key); LegacyPaint.paint(c, target); target.endTag(FilterTableConnector.TAG_FILTER_COMPONENT + _columnIdMap.key(key)); } Map<String, String> headerStylenames = getColumnHeaderStylenamesForPaint(); if (headerStylenames != null) { target.addAttribute(FilterTableConnector.ATTRIBUTE_COLUMN_HEADER_STYLE_NAMES, headerStylenames); } target.endTag(FilterTableConnector.TAG_FILTERS); }
@Override public void paintContent(PaintTarget target) throws PaintException { super.paintContent(target); /* Add filter components to UIDL */ target.startTag(FilterTableConnector.TAG_FILTERS); target.addAttribute(FilterTableConnector.ATTRIBUTE_FILTERS_VISIBLE, filtersVisible); target.addAttribute(FilterTableConnector.ATTRIBUTE_FORCE_RENDER, reRenderFilterFields); reRenderFilterFields = false; for (Object key : getColumnIdToFilterMap().keySet()) { /* Make sure parent is set properly */ if (columnIdToFilterMap.get(key) != null && columnIdToFilterMap.get(key).getParent() == null) { continue; } /* Paint the filter field */ target.startTag(FilterTableConnector.TAG_FILTER_COMPONENT + _columnIdMap.key(key)); target.addAttribute(FilterTableConnector.ATTRIBUTE_COLUMN_ID, _columnIdMap.key(key)); Component c = getColumnIdToFilterMap().get(key); LegacyPaint.paint(c, target); target.endTag(FilterTableConnector.TAG_FILTER_COMPONENT + _columnIdMap.key(key)); } target.endTag(FilterTableConnector.TAG_FILTERS); String[] headerStylenames = getColumnHeaderStylenamesForPaint(); if (headerStylenames != null) { target.addAttribute(FilterTableConnector.ATTRIBUTE_COLUMN_HEADER_STYLE_NAMES, headerStylenames); } }
protected void paintAggregationRow(PaintTarget target, Map<Object, Object> aggregations) throws PaintException { target.startTag("arow"); for (final Object columnId : _visibleColumns()) { if (columnId == null || isColumnCollapsed(columnId)) { continue; } if (getCellStyleGenerator() != null) { String cellStyle = getCellStyleGenerator().getStyle(this, null, columnId); if (cellStyle != null && !cellStyle.equals("")) { target.addAttribute("style-" + _columnIdMap().key(columnId), cellStyle + "-ag"); } } String value = (String) aggregations.get(columnId); target.addText(value); } if (focusTotalAggregationInputColumnKey != null) { target.addAttribute("focusInput", focusTotalAggregationInputColumnKey); focusTotalAggregationInputColumnKey = null; } target.startTag("editableAggregationColumns"); for (final Object columnId : _visibleColumns()) { if (CollectionUtils.isNotEmpty(aggregationEditableColumns) && aggregationEditableColumns.contains(columnId)) { target.addText(_columnIdMap().key(columnId)); } } target.endTag("editableAggregationColumns"); target.endTag("arow"); }
protected void paintAggregationRow(PaintTarget target, Map<Object, Object> aggregations) throws PaintException { target.startTag("arow"); for (final Object columnId : _visibleColumns()) { if (columnId == null || isColumnCollapsed(columnId)) { continue; } if (getCellStyleGenerator() != null) { String cellStyle = getCellStyleGenerator().getStyle(this, null, columnId); if (cellStyle != null && !cellStyle.equals("")) { target.addAttribute("style-" + _columnIdMap().key(columnId), cellStyle + "-ag"); } } String value = (String) aggregations.get(columnId); target.addText(value); } paintEditableAggregationColumns(target); if (focusTotalAggregationInputColumnKey != null) { target.addAttribute("focusInput", focusTotalAggregationInputColumnKey); focusTotalAggregationInputColumnKey = null; } target.endTag("arow"); }
private void paintPartialRowUpdates(PaintTarget target, Set<Action> actionSet) throws PaintException { final boolean[] iscomponent = findCellsWithComponents(); int firstIx = getFirstUpdatedItemIndex(); int count = getUpdatedRowCount(); target.startTag("urows"); target.addAttribute("firsturowix", firstIx); target.addAttribute("numurows", count); // Partial row updates bypass the normal caching mechanism. Object[][] cells = getVisibleCellsUpdateCacheRows(firstIx, count); for (int indexInRowbuffer = 0; indexInRowbuffer < count; indexInRowbuffer++) { final Object itemId = cells[CELL_ITEMID][indexInRowbuffer]; if (shouldHideNullSelectionItem()) { // Remove null selection item if null selection is not allowed continue; } paintRow(target, cells, isEditable(), actionSet, iscomponent, indexInRowbuffer, itemId); } target.endTag("urows"); maybeThrowCacheUpdateExceptions(); }