@@ -61,15 +61,16 @@ public class ValueContext implements Serializable { | |||
* Constructor for {@code ValueContext}. | |||
* | |||
* @param component | |||
* The component related to current value. Can be null. | |||
* If the component implements {@link HasValue}, it will be returned by {@link #getHasValue()} as well. | |||
* The component related to current value. Can be null. If the | |||
* component implements {@link HasValue}, it will be returned by | |||
* {@link #getHasValue()} as well. | |||
*/ | |||
@SuppressWarnings("unchecked") | |||
public ValueContext(Component component) { | |||
Objects.requireNonNull(component, | |||
"Component can't be null in ValueContext construction"); | |||
this.component = component; | |||
if(component instanceof HasValue) { | |||
if (component instanceof HasValue) { | |||
hasValue = (HasValue<?>) component; | |||
} else { | |||
hasValue = null; | |||
@@ -84,6 +85,7 @@ public class ValueContext implements Serializable { | |||
* The component related to current value. Can be null. | |||
* @param hasValue | |||
* The value source related to current value. Can be null. | |||
* @since 8.1 | |||
*/ | |||
public ValueContext(Component component, HasValue<?> hasValue) { | |||
Objects.requireNonNull(component, | |||
@@ -96,15 +98,17 @@ public class ValueContext implements Serializable { | |||
/** | |||
* Constructor for {@code ValueContext}. | |||
* | |||
* @param | |||
* component | |||
* @param component | |||
* The component can be {@code null}. | |||
* @param locale | |||
* The locale used with conversion. Can be {@code null}. | |||
* @param hasValue | |||
* The value source related to current value. Can be {@code null}. | |||
* The value source related to current value. Can be | |||
* {@code null}. | |||
* @since 8.1 | |||
*/ | |||
public ValueContext(Component component, HasValue<?> hasValue, Locale locale) { | |||
public ValueContext(Component component, HasValue<?> hasValue, | |||
Locale locale) { | |||
this.component = component; | |||
this.hasValue = hasValue; | |||
this.locale = locale; | |||
@@ -146,9 +150,11 @@ public class ValueContext implements Serializable { | |||
/** | |||
* Returns an {@code Optional} for the {@code HasValue} used in the value | |||
* conversion. In certain complicated cases, ex. cross-field validation, HasValue might be not available. | |||
* conversion. In certain complicated cases, ex. cross-field validation, | |||
* HasValue might be not available. | |||
* | |||
* @return the optional of {@code HasValue} | |||
* @since 8.1 | |||
*/ | |||
@SuppressWarnings("unused") | |||
public Optional<HasValue<?>> getHasValue() { |
@@ -576,6 +576,23 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
private final boolean userOriginated; | |||
/** | |||
* Creates a split position change event. | |||
* | |||
* @param source | |||
* split panel from which the event originates | |||
* @param userOriginated | |||
* true if the event is directly based on user actions | |||
* @param oldPosition | |||
* old split position | |||
* @param oldUnit | |||
* old unit of split position | |||
* @param position | |||
* new split position | |||
* @param unit | |||
* new split position unit | |||
* @since 8.1 | |||
*/ | |||
public SplitPositionChangeEvent(final Component source, | |||
final boolean userOriginated, final float oldPosition, | |||
final Unit oldUnit, final float position, final Unit unit) { | |||
@@ -629,6 +646,11 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
return oldUnit; | |||
} | |||
/** | |||
* {@inheritDoc} | |||
* | |||
* @since 8.1 | |||
*/ | |||
@Override | |||
public boolean isUserOriginated() { | |||
return userOriginated; |
@@ -172,16 +172,18 @@ public interface Component extends ClientConnector, Sizeable, Serializable { | |||
*/ | |||
public void addStyleName(String style); | |||
/** | |||
* Adds one or more style names to this component by using one or multiple parameters. | |||
* Adds one or more style names to this component by using one or multiple | |||
* parameters. | |||
* | |||
* @param styles | |||
* the style name or style names to be added to the component | |||
* @see #addStyleName(String) | |||
* @see #setStyleName(String) | |||
* @see #removeStyleName(String) | |||
* @since 8.1 | |||
*/ | |||
public default void addStyleNames(String ... styles) { | |||
public default void addStyleNames(String... styles) { | |||
for (String style : styles) { | |||
addStyleName(style); | |||
} | |||
@@ -209,13 +211,15 @@ public interface Component extends ClientConnector, Sizeable, Serializable { | |||
/** | |||
* Removes one or more style names from component. Multiple styles can be | |||
* specified by using multiple parameters. | |||
* | |||
* @param styles | |||
* the style name or style names to be removed | |||
* @see #removeStyleName(String) | |||
* @see #setStyleName(String) | |||
* @see #addStyleName(String) | |||
* @since 8.1 | |||
*/ | |||
public default void removeStyleNames(String ... styles) { | |||
public default void removeStyleNames(String... styles) { | |||
for (String style : styles) { | |||
removeStyleName(style); | |||
} |
@@ -562,6 +562,7 @@ public class TabSheet extends AbstractComponentContainer | |||
* @param userOriginated | |||
* <code>true</code> if the event originates from the client | |||
* side, <code>false</code> otherwise | |||
* @since 8.1 | |||
*/ | |||
public void setSelectedTab(Component component, boolean userOriginated) { | |||
if (component != null && components.contains(component) | |||
@@ -811,6 +812,7 @@ public class TabSheet extends AbstractComponentContainer | |||
* @param userOriginated | |||
* <code>true</code> if the event originates from the client | |||
* side, <code>false</code> otherwise | |||
* @since 8.1 | |||
*/ | |||
public SelectedTabChangeEvent(Component source, | |||
boolean userOriginated) { | |||
@@ -827,6 +829,11 @@ public class TabSheet extends AbstractComponentContainer | |||
return (TabSheet) getSource(); | |||
} | |||
/** | |||
* {@inheritDoc} | |||
* | |||
* @since 8.1 | |||
*/ | |||
@Override | |||
public boolean isUserOriginated() { | |||
return userOriginated; | |||
@@ -906,7 +913,7 @@ public class TabSheet extends AbstractComponentContainer | |||
* @param userOriginated | |||
* <code>true</code> if the event originates from the client | |||
* side, <code>false</code> otherwise | |||
* @since | |||
* @since 8.1 | |||
*/ | |||
protected void fireSelectedTabChange(boolean userOriginated) { | |||
fireEvent(new SelectedTabChangeEvent(this, userOriginated)); |