private HTML notice;
// Not using Vaadin notifications (#14597)
- private void notice(String productName) {
+ private void notice(String productName) {
if (notice == null) {
notice = new HTML();
notice.addClickHandler(new ClickHandler() {
addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
- if(isEnabled()) {
+ if (isEnabled()) {
preparePopup(popup);
showPopup(popup);
center();
/**
* Sets whether this popup is enabled.
*
- * @param enabled <code>true</code> to enable the popup, <code>false</code>
- * to disable it
+ * @param enabled
+ * <code>true</code> to enable the popup, <code>false</code> to
+ * disable it
* @since 7.3.4
*/
@Override
/**
* The id of the tab at position scrollerIndex. This is used for keeping the
* scroll position unchanged when a tab is removed from the server side and
- * the removed tab lies to the left of the current scroll position. For other
- * cases scrollerIndex alone would be sufficient. Since the tab at the current
- * scroll position can be removed, scrollerIndex is required in addition to this variable.
+ * the removed tab lies to the left of the current scroll position. For
+ * other cases scrollerIndex alone would be sufficient. Since the tab at the
+ * current scroll position can be removed, scrollerIndex is required in
+ * addition to this variable.
*/
private String scrollerPositionTabId;
}
private boolean isScrollerPrevDisabled() {
- return scrollerPrev.getClassName().contains(PREV_SCROLLER_DISABLED_CLASSNAME);
+ return scrollerPrev.getClassName().contains(
+ PREV_SCROLLER_DISABLED_CLASSNAME);
}
private boolean isIndexSkippingHiddenTabs() {
// Should not set tabs visible if they are scrolled out of view
tab.setVisible(false);
} else {
- //reset the scroller index back to zero if tab is visible
- //again and tab is in view
- if(isIndexSkippingHiddenTabs() && tabState.visible) {
+ // reset the scroller index back to zero if tab is visible
+ // again and tab is in view
+ if (isIndexSkippingHiddenTabs() && tabState.visible) {
scrollerIndex = 0;
}
tab.setVisible(tabState.visible);
if (tb.getTabCount() > 0 && tb.isVisible() && (scrolled || clipped)) {
scroller.getStyle().clearDisplay();
DOM.setElementProperty(scrollerPrev, "className",
- SCROLLER_CLASSNAME + (scrolled ? "Prev" : PREV_SCROLLER_DISABLED_CLASSNAME));
+ SCROLLER_CLASSNAME
+ + (scrolled ? "Prev"
+ : PREV_SCROLLER_DISABLED_CLASSNAME));
DOM.setElementProperty(scrollerNext, "className",
SCROLLER_CLASSNAME + (clipped ? "Next" : "Next-disabled"));
}
if (scrollerIndex >= 0 && scrollerIndex < tb.getTabCount()) {
scrollerPositionTabId = tb.getTab(scrollerIndex).id;
- }
- else{
+ } else {
scrollerPositionTabId = null;
}
}
* @param removedPropertyIds
* the property ids that have been removed from the container
*/
- public void propertiesRemoved(@SuppressWarnings("unused")
- Collection<Object> removedPropertyIds) {
+ public void propertiesRemoved(
+ @SuppressWarnings("unused") Collection<Object> removedPropertyIds) {
/*
* no-op, for now.
*
BigDecimal bigDecimalValue = (BigDecimal) convertToNumber(value,
BigDecimal.class, locale);
- return (bigDecimalValue != null) ? bigDecimalValue.toBigInteger() : null;
+ return (bigDecimalValue != null) ? bigDecimalValue.toBigInteger()
+ : null;
}
@Override
count++;
}
if (versionColumn != null) {
- if(!item.getItemPropertyIds().contains(versionColumn)) {
+ if (!item.getItemPropertyIds().contains(versionColumn)) {
throw new IllegalArgumentException(String.format(
"Table '%s' does not contain version column '%s'.",
tableName, versionColumn));
if (type instanceof Class<?>) {
Class<?> clazz = (Class<?>) type;
if (JsonArray.class.isAssignableFrom(clazz)) {
- parameters[i] = JsonUtil.stringify((JsonArray) parameters[i]);
+ parameters[i] = JsonUtil
+ .stringify((JsonArray) parameters[i]);
}
}
}
Class<?> clazz = (Class<?>) type;
if (JsonArray.class.isAssignableFrom(clazz)) {
try {
- parameters[i] = JsonUtil.<JsonArray>parse((String) parameters[i]);
+ parameters[i] = JsonUtil
+ .<JsonArray> parse((String) parameters[i]);
} catch (JsonException e) {
throw new IOException(e);
}
+ name
+ " on the client because a callback with the same name is registered on the server.");
}
- JsonArray args = (JsonArray) JsonCodec.encode(arguments, null, Object[].class, null).getEncodedValue();
+ JsonArray args = (JsonArray) JsonCodec.encode(arguments, null,
+ Object[].class, null).getEncodedValue();
connector.addMethodInvocationToQueue(
JavaScriptCallbackRpc.class.getName(), CALL_METHOD,
new Object[] { name, args });
public class JsonCodec implements Serializable {
/* Immutable Encode Result representing null */
- private static final EncodeResult ENCODE_RESULT_NULL = new EncodeResult(Json.createNull());
+ private static final EncodeResult ENCODE_RESULT_NULL = new EncodeResult(
+ Json.createNull());
/* Immutable empty JSONArray */
- private static final JsonArray EMPTY_JSON_ARRAY = new JreJsonArray(Json.instance()) {
+ private static final JsonArray EMPTY_JSON_ARRAY = new JreJsonArray(
+ Json.instance()) {
@Override
public void set(int index, JsonValue value) {
throw new UnsupportedOperationException(
.getGenericComponentType();
return decodeArray(componentType, (JsonArray) value,
connectorTracker);
- } else if (JsonValue.class.isAssignableFrom(getClassForType(targetType))) {
+ } else if (JsonValue.class
+ .isAssignableFrom(getClassForType(targetType))) {
return value;
} else if (Enum.class.isAssignableFrom(getClassForType(targetType))) {
Class<?> classForType = getClassForType(targetType);
}
private static Map<Object, Object> decodeObjectMap(Type keyType,
- Type valueType, JsonArray jsonMap, ConnectorTracker connectorTracker)
- {
+ Type valueType, JsonArray jsonMap, ConnectorTracker connectorTracker) {
JsonArray keys = jsonMap.getArray(0);
JsonArray values = jsonMap.getArray(1);
* @param referenceValue
* @return
*/
- private static boolean jsonEquals(JsonValue fieldValue, JsonValue referenceValue) {
+ private static boolean jsonEquals(JsonValue fieldValue,
+ JsonValue referenceValue) {
if (fieldValue instanceof JsonNull) {
fieldValue = null;
}
Collection<?> collection, ConnectorTracker connectorTracker) {
JsonArray jsonArray = Json.createArray();
for (Object o : collection) {
- jsonArray.set(jsonArray.length(), encodeChild(targetType, 0, o, connectorTracker));
+ jsonArray.set(jsonArray.length(),
+ encodeChild(targetType, 0, o, connectorTracker));
}
return jsonArray;
}
- private static JsonValue encodeChild(Type targetType, int typeIndex, Object o,
- ConnectorTracker connectorTracker) {
+ private static JsonValue encodeChild(Type targetType, int typeIndex,
+ Object o, ConnectorTracker connectorTracker) {
if (targetType instanceof ParameterizedType) {
Type childType = ((ParameterizedType) targetType)
.getActualTypeArguments()[typeIndex];
* @deprecated As of 7.1. See #11411.
*/
@Deprecated
- public static JsonObject encodeState(ClientConnector connector, SharedState state) {
+ public static JsonObject encodeState(ClientConnector connector,
+ SharedState state) {
UI uI = connector.getUI();
ConnectorTracker connectorTracker = uI.getConnectorTracker();
Class<? extends SharedState> stateType = connector.getStateType();
// add invocation to rpcCalls
try {
JsonArray invocationJson = Json.createArray();
- invocationJson.set(0, invocation.getConnector().getConnectorId());
+ invocationJson.set(0, invocation.getConnector()
+ .getConnectorId());
invocationJson.set(1, invocation.getInterfaceName());
invocationJson.set(2, invocation.getMethodName());
JsonArray paramJson = Json.createArray();
* the connector tracker instance for the UI
* @return A deserialized object
*/
- T deserialize(Type type, JsonValue jsonValue, ConnectorTracker connectorTracker);
+ T deserialize(Type type, JsonValue jsonValue,
+ ConnectorTracker connectorTracker);
/**
* Serialize the given object into JSON. Must be compatible with
- * {@link #deserialize(Type, JsonValue, ConnectorTracker)} and the client side
- * com.vaadin.client.communication.JSONSerializer
+ * {@link #deserialize(Type, JsonValue, ConnectorTracker)} and the client
+ * side com.vaadin.client.communication.JSONSerializer
*
* @param value
* The object to serialize
if (request.getService().getDeploymentConfiguration()
.isSyncIdCheckEnabled()) {
- syncId = (int) json.getNumber(ApplicationConstants.SERVER_SYNC_ID);
+ syncId = (int) json
+ .getNumber(ApplicationConstants.SERVER_SYNC_ID);
} else {
syncId = -1;
}
String methodName = invocationJson.getString(2);
if (connectorTracker.getConnector(connectorId) == null
- && !connectorId.equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) {
+ && !connectorId
+ .equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) {
if (!connectorTracker.connectorWasPresentAsRequestWasSent(
connectorId, lastSyncIdSeenByClient)) {
String initialUIDL = getInitialUidl(request, uI);
params.put("uidl", initialUIDL);
- return commitJsonResponse(request, response, JsonUtil.stringify(params));
+ return commitJsonResponse(request, response,
+ JsonUtil.stringify(params));
} catch (JsonException e) {
throw new IOException("Error producing initial UIDL", e);
}
* The new theme name
*/
public void setTheme(String theme) {
- if(theme == null) {
+ if (theme == null) {
getState().theme = null;
} else {
getState().theme = VaadinServlet.stripSpecialChars(theme);
void cancel(int rowIndex);
/**
- * Confirms a pending {@link EditorServerRpc#bind(int) bind request}
- * sent by the client.
+ * Confirms a pending {@link EditorServerRpc#bind(int) bind request} sent by
+ * the client.
*/
void confirmBind();
/**
- * Confirms a pending {@link EditorServerRpc#save(int) save request}
- * sent by the client.
+ * Confirms a pending {@link EditorServerRpc#save(int) save request} sent by
+ * the client.
*/
void confirmSave();
}
/**
* Asks the server to open the editor and bind data to it. When a bind
* request is sent, it must be acknowledged with a
- * {@link EditorClientRpc#confirmBind() confirm call} before the client
- * can open the editor.
+ * {@link EditorClientRpc#confirmBind() confirm call} before the client can
+ * open the editor.
*
* @param rowIndex
* the index of the edited row