@Deprecated
private Set<String> changedPropertiesSet;
- private boolean isNewConnector = false;
+ private boolean initialStateChange = false;
private JSONObject stateJson;
* the event whose state has changed
* @param stateJson
* the JSON representation of the state change
- * @param isNewConnector
+ * @param initialStateChange
* <code>true</code> if the state change is for a new connector,
* otherwise <code>false</code>
*/
public StateChangeEvent(ServerConnector connector, JSONObject stateJson,
- boolean isNewConnector) {
+ boolean initialStateChange) {
setConnector(connector);
this.stateJson = stateJson;
- this.isNewConnector = isNewConnector;
+ this.initialStateChange = initialStateChange;
}
@Override
changedProperties = FastStringSet.create();
addJsonFields(stateJson, changedProperties, "");
- if (isNewConnector) {
+ if (isInitialStateChange()) {
addAllStateFields(
AbstractConnector.getStateType(getConnector()),
changedProperties, "");
* <code>false></code>
*/
public boolean hasPropertyChanged(String property) {
- if (isNewConnector) {
+ if (isInitialStateChange()) {
// Everything has changed for a new connector
return true;
} else if (stateJson != null) {
}
}
}
+
+ /**
+ * Checks if the state change event is the first one for the given
+ * connector.
+ *
+ * @since 7.1
+ * @return true if this is the first state change event for the connector,
+ * false otherwise
+ */
+ public boolean isInitialStateChange() {
+ return initialStateChange;
+ }
+
}
private String lastKnownWidth = "";
private String lastKnownHeight = "";
- private boolean initialStateEvent = true;
-
private boolean tooltipListenersAttached = false;
/**
if (stateChangeEvent.hasPropertyChanged("id")) {
if (getState().id != null) {
getWidget().getElement().setId(getState().id);
- } else if (!initialStateEvent) {
+ } else if (!stateChangeEvent.isInitialStateChange()) {
getWidget().getElement().removeAttribute("id");
}
}
}
Profiler.leave("AbstractComponentContainer.onStateChanged check tooltip");
- initialStateEvent = false;
-
Profiler.leave("AbstractComponentConnector.onStateChanged");
}