CRecordWebAddStyleSheet
The message
The message is part of the
The API is located in the plugin NY_
{ "id": "ae327d0d-989e-4431-a8ea-285d437c254f", "name": "WEB_ADD_STYLE_SHEET ", "description": "Add a stylesheet.", "slots": [ { "key": "1", "name": "ID ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The style sheet ID." }, { "key": "2", "name": "CONTENT ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The content of the style sheet." } ] }
Arguments
-
ID :The ID of the stylesheet. It is required to remove the stylesheet again later. -
CONTENT :The content of the stylesheet (the rules).
Usage with the helper class CWebApi
The easiest way is to call the corresponding method in the CWebApi class. The use of the class is described there.
// Example: Load style sheet from JAR resources final String css = CUtilJson.loadJson(getClass(), "/html/my_stylesheet.css"); mWebApi.addCss("id_of_my_stylesheet" ,css );
Usage as message
The
public void addCss(@NotNull final CTargetAddressa , @NotNull final StringRemote Skin AddressaStyleSheetId , @NotNull final StringaCss ) throws CException {// Envelope final CEnvelope env = CEnvelope.forSingleTarget(m );Remote Skin Address// Record final CRecord record =CRecordWebAddStyleSheet .create();CRecordWebAddStyleSheet .setId(record,aStyleSheetId );CRecordWebAddStyleSheet .setContent(record,aCss );// send message sendNotification(env, record); }