Example usage for com.vaadin.server PaintTarget addAttribute

List of usage examples for com.vaadin.server PaintTarget addAttribute

Introduction

In this page you can find the example usage for com.vaadin.server PaintTarget addAttribute.

Prototype

public void addAttribute(String string, Object[] keys);

Source Link

Usage

From source file:com.haulmont.cuba.web.widgets.CubaTreeTable.java

License:Apache License

@Override
protected void paintAdditionalData(PaintTarget target) throws PaintException {
    if (reqFirstRowToPaint == -1 && items instanceof AggregationContainer && isAggregatable()
            && !((AggregationContainer) items).getAggregationPropertyIds().isEmpty() && isShowTotalAggregation()
            && AggregationStyle.TOP.equals(getAggregationStyle())) {
        paintAggregationRow(target, ((AggregationContainer) items).aggregate(new Context(items.getItemIds())));
    }//from www. j ava2  s .  c om

    // paint cuba-ids

    if (getCubaId() != null) {
        ArrayList<String> visibleColOrder = new ArrayList<>();
        for (Object columnId : _visibleColumns()) {
            if (!isColumnCollapsed(columnId)) {
                visibleColOrder.add(columnId.toString());
            }
        }
        target.addAttribute("colcubaids", visibleColOrder.toArray());
    }
}

From source file:com.ies.schoolos.ui.mobile.component.NumberField.java

License:Apache License

@Override
public void paintContent(PaintTarget target) throws PaintException {
    super.paintContent(target);

    // Paint any component specific content by setting attributes.
    // These attributes can be read in the widget's updateFromUIDL().
    // paintContent() is called when the contents of the component should be
    // painted in response to the component first being shown or having been
    // altered so that its visual representation is changed.
    target.addAttribute(Constants.ATTRIBUTE_ALLOW_DECIMALS, isDecimalAllowed());
    target.addAttribute(Constants.ATTRIBUTE_ALLOW_NEGATIVES, isNegativeAllowed());
    target.addAttribute(Constants.ATTRIBUTE_DECIMAL_PRECISION, getDecimalPrecision());
    target.addAttribute(Constants.ATTRIBUTE_DECIMAL_SEPARATOR, getDecimalSeparator());
    target.addAttribute(Constants.ATTRIBUTE_USE_GROUPING, isGroupingUsed());
    target.addAttribute(Constants.ATTRIBUTE_GROUPING_SEPARATOR, getGroupingSeparator());
    target.addAttribute(Constants.ATTRIBUTE_MIN_VALUE, getMinValue());
    target.addAttribute(Constants.ATTRIBUTE_MAX_VALUE, getMaxValue());

    // Use DecimalFormat to format the user-input and send the
    // formatted value back to client.
    target.addAttribute(Constants.ATTRIBUTE_SERVER_FORMATTED_VALUE, getValueAsFormattedDecimalNumber());
}

From source file:com.skysql.manager.ui.components.ChartsLayout.java

License:Open Source License

@Override
public void paintContent(PaintTarget target) throws PaintException {
    super.paintContent(target);

    // Override paintContent (vaadin serialization api) to set the
    // horizontal drop ratio to 50% so that we don't have a "CENTER"
    // position to drop things. See
    // VDDCssLayout#getHorizontalDropLocation() and
    // VDDCssLayout#handleCellDropRatioUpdate() for details
    target.addAttribute(Constants.ATTRIBUTE_HORIZONTAL_DROP_RATIO, 0.5f);
}

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.component.CustomUpload.java

License:Apache License

@Override
public void paintContent(PaintTarget target) throws PaintException {
    super.paintContent(target);
    target.addAttribute("maxFileSize", maxFileSize);
    target.addAttribute("sizeErrorMsg", sizeErrorMsg);
    target.addAttribute("acceptFilter", acceptFilter);
    if (acceptedMimeTypes != null) {
        target.addAttribute("acceptedMimeTypes",
                acceptedMimeTypes.toArray(new String[acceptedMimeTypes.size()]));
    } else {//w ww  .  j a v a 2  s.  co m
        target.addAttribute("acceptedMimeTypes", new String[] {});
    }
    target.addAttribute("mimeTypeErrorMsg", mimeTypeErrorMsg);
}

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.component.MultiUpload.java

License:Apache License

@Override
public void paintContent(PaintTarget target) throws PaintException {
    target.addVariable(this, "target", streamVariable);
    target.addAttribute("maxFileSize", maxFileSize);
    target.addAttribute("sizeErrorMsg", sizeErrorMsg);
    target.addAttribute("acceptFilter", acceptFilter);
    if (acceptedMimeTypes != null) {
        target.addAttribute("acceptedMimeTypes",
                acceptedMimeTypes.toArray(new String[acceptedMimeTypes.size()]));
    } else {/*w w  w .j a  v a 2  s . c  om*/
        target.addAttribute("acceptedMimeTypes", new String[] {});
    }

    target.addAttribute("mimeTypeErrorMsg", mimeTypeErrorMsg);
    target.addAttribute("enabled", enabled);
    if (ready) {
        target.addAttribute("ready", true);
        ready = false;
    }
    target.addAttribute("buttoncaption", getButtonCaption());
    if (!interruptedFileIds.isEmpty()) {
        target.addAttribute("interruptedFileIds",
                interruptedFileIds.toArray(new Long[interruptedFileIds.size()]));
        interruptedFileIds = new ArrayList<>();
    }
}

From source file:dk.apaq.vaadin.addon.printservice.PrintServiceApplet.java

License:Open Source License

@Override
public void paintContent(PaintTarget target) throws PaintException {
    super.paintContent(target);

    // Applet class
    if (getAppletClass() == null) {
        // Do not paint anything of class is missing
        return;//from ww w . java  2s .  c  om
    }

    LOG.debug("Painting PrintApplet.");
    target.addAttribute(VAppletIntegration.ATTR_APPLET_NAME, "Printer");
    target.addVariable(this, VAppletIntegration.ATTR_APPLET_ACTION, "dummy");
}

From source file:fi.jasoft.dragdroplayouts.DDHorizontalLayout.java

License:Apache License

/**
 * {@inheritDoc}/*  ww  w.  ja va2  s  .c  o m*/
 * 
 */
public void paintContent(PaintTarget target) throws PaintException {

    if (dropHandler != null && isEnabled()) {
        dropHandler.getAcceptCriterion().paint(target);
    }

    // Drop ratios
    target.addAttribute(Constants.ATTRIBUTE_HORIZONTAL_DROP_RATIO, getState().cellLeftRightDropRatio);

    // Drag mode
    if (isEnabled()) {
        target.addAttribute(Constants.DRAGMODE_ATTRIBUTE, getState().ddState.dragMode.ordinal());
    } else {
        target.addAttribute(Constants.DRAGMODE_ATTRIBUTE, LayoutDragMode.NONE.ordinal());
    }

    // Shims
    target.addAttribute(IframeCoverUtility.SHIM_ATTRIBUTE, getState().ddState.iframeShims);
}

From source file:info.magnolia.ui.vaadin.richtext.MagnoliaRichTextField.java

License:Open Source License

@Override
public void paintContent(PaintTarget target) throws PaintException {
    super.paintContent(target);

    if (serverPlugins != null) {
        target.addAttribute(VMagnoliaRichTextField.VAR_SERVERPLUGINS, serverPlugins);
    }//from w  w  w  .j a v  a  2 s .c  o  m

    // tell client that server is interested of these events
    if (customEvents != null) {
        target.addAttribute(VMagnoliaRichTextField.VAR_EVENTNAMES, customEvents);
    }

    // send event to plugin
    if (fireEvent != null && fireEventValue != null) {
        target.addAttribute(VMagnoliaRichTextField.VAR_FIRE_PLUGIN_EVENT, fireEvent);
        target.addAttribute(VMagnoliaRichTextField.VAR_FIRE_PLUGIN_EVENT_VALUE, fireEventValue);
        fireEvent = null;
        fireEventValue = null;
    }
}

From source file:it.zero11.vaadin.asyncfiltercombobox.AsyncFilterComboBox.java

License:Apache License

@Override
public void paintContent(PaintTarget target) throws PaintException {
    target.addAttribute(AsyncFilterComboBoxConstants.ATTR_FILTERCHANGE_EVENTMODE,
            getFilterChangeEventMode().toString());
    target.addAttribute(AsyncFilterComboBoxConstants.ATTR_FILTERCHANGE_TIMEOUT, getFilterChangeTimeout());

    super.paintContent(target);
}

From source file:me.uni.emuseo.view.categories.CategoryTable.java

License:Open Source License

@Override
protected void paintRowHeader(PaintTarget target, Object[][] cells, int indexInRowbuffer)
        throws PaintException {
    target.addAttribute("caption", Integer.toString(offset + indexInRowbuffer + 1));
}