Skip to content

Package: MutableDisplayable

MutableDisplayable

nameinstructionbranchcomplexitylinemethod
of(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
of(String, String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * *************************************************************************************************************************************************************
3: *
4: * SteelBlue: DCI User Interfaces
5: * http://tidalwave.it/projects/steelblue
6: *
7: * Copyright (C) 2015 - 2025 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *************************************************************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
12: * You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
17: * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
18: *
19: * *************************************************************************************************************************************************************
20: *
21: * git clone https://bitbucket.org/tidalwave/steelblue-src
22: * git clone https://github.com/tidalwave-it/steelblue-src
23: *
24: * *************************************************************************************************************************************************************
25: */
26: package it.tidalwave.ui.core.role;
27:
28: import jakarta.annotation.Nonnull;
29: import java.util.Locale;
30: import java.util.Map;
31: import it.tidalwave.ui.core.Mutable;
32: import it.tidalwave.ui.core.role.impl.DefaultMutableDisplayable;
33:
34: /***************************************************************************************************************************************************************
35: *
36: * A specialized {@link it.tidalwave.ui.core.role.Displayable} which is mutable (that is, its display name can be changed)
37: * and fires {@code PropertyChangeEvent}s.
38: *
39: * @stereotype Role
40: *
41: * @since 2.0-ALPHA-1
42: * @author Fabrizio Giudici
43: * @it.tidalwave.javadoc.stable
44: *
45: **************************************************************************************************************************************************************/
46: public interface MutableDisplayable extends Displayable, Mutable
47: {
48: public static final Class<MutableDisplayable> _MutableDisplayable_ = MutableDisplayable.class;
49:
50: /** The property name for displayName */
51: public static final String PROP_DISPLAY_NAME = "displayName";
52:
53: /** The property name for displayNames */
54: public static final String PROP_DISPLAY_NAMES = "displayNames";
55:
56: /***********************************************************************************************************************************************************
57: * Sets the display name in {@code Locale.ENGLISH}.
58: *
59: * @param displayName the display name
60: **********************************************************************************************************************************************************/
61: public void setDisplayName (@Nonnull String displayName);
62:
63: /***********************************************************************************************************************************************************
64: * Sets the display name in the given {@code Locale}.
65: *
66: * @param displayName the display name
67: * @param locale the locale
68: **********************************************************************************************************************************************************/
69: public void setDisplayName (@Nonnull String displayName, @Nonnull Locale locale);
70:
71: /***********************************************************************************************************************************************************
72: * Sets a bag of display names for a number of {@code Locale}s.
73: *
74: * @param displayNames the display names
75: **********************************************************************************************************************************************************/
76: public void setDisplayNames (@Nonnull Map<Locale, String> displayNames);
77:
78: /***********************************************************************************************************************************************************
79: * Creates an instance with an initial given display name in {@code Locale.ENGLISH}.
80: *
81: * @param displayName the display name
82: * @return the new instance
83: * @since 3.2-ALPHA-1
84: **********************************************************************************************************************************************************/
85: @Nonnull
86: public static MutableDisplayable of (@Nonnull final String displayName)
87: {
88: return of(displayName, "???");
89: }
90:
91: /***********************************************************************************************************************************************************
92: * Creates an instance with an initial given display name in {@code Locale.ENGLISH} and an explicit identifier for
93: * {@code toString()}.
94: *
95: * @param displayName the display name
96: * @param toStringName the name to be rendered when {@code toString()} is called
97: * @return the new instance
98: * @since 3.2-ALPHA-1
99: **********************************************************************************************************************************************************/
100: @Nonnull
101: public static MutableDisplayable of (@Nonnull final String displayName, @Nonnull final String toStringName)
102: {
103: return new DefaultMutableDisplayable(displayName, toStringName);
104: }
105: }