File tree Expand file tree Collapse file tree 6 files changed +81
-24
lines changed
patternfx-core/src/main/java/com/techsenger/patternfx/core
patternfx-demo/src/main/java/com/techsenger/patternfx/demo Expand file tree Collapse file tree 6 files changed +81
-24
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2024-2025 Pavel Castornii.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .techsenger .patternfx .core ;
18+
19+ /**
20+ *
21+ * @author Pavel Castornii
22+ */
23+ public abstract class AbstractName implements Name {
24+
25+ private final String text ;
26+
27+ public AbstractName (String text ) {
28+ this .text = text ;
29+ }
30+
31+ /**
32+ * Returns the human-readable name.
33+ *
34+ * @return the component name text
35+ */
36+ public String getText () {
37+ return text ;
38+ }
39+
40+ @ Override
41+ public String toString () {
42+ return this .text ;
43+ }
44+ }
Original file line number Diff line number Diff line change 2020 *
2121 * @author Pavel Castornii
2222 */
23- public class ComponentGroupName extends ComponentName {
23+ public class ComponentGroupName extends AbstractName {
2424
2525 public ComponentGroupName (String text ) {
2626 super (text );
Original file line number Diff line number Diff line change 2828 *
2929 * @author Pavel Castornii
3030 */
31- public class ComponentName extends Name {
31+ public interface ComponentName extends Name {
3232
33- public ComponentName (String text ) {
34- super (text );
35- }
3633}
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2024-2025 Pavel Castornii.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .techsenger .patternfx .core ;
18+
19+ /**
20+ *
21+ * @author Pavel Castornii
22+ */
23+ public class DefaultComponentName extends AbstractName implements ComponentName {
24+
25+ public DefaultComponentName (String text ) {
26+ super (text );
27+ }
28+ }
Original file line number Diff line number Diff line change 2020 *
2121 * @author Pavel Castornii
2222 */
23- public class Name {
23+ public interface Name {
2424
25- private final String text ;
26-
27- public Name (String text ) {
28- this .text = text ;
29- }
30-
31- /**
25+ /**
3226 * Returns the human-readable name.
3327 *
3428 * @return the component name text
3529 */
36- public String getText () {
37- return text ;
38- }
39-
40- @ Override
41- public String toString () {
42- return this .text ;
43- }
30+ String getText ();
4431}
Original file line number Diff line number Diff line change 1717package com .techsenger .patternfx .demo ;
1818
1919import com .techsenger .patternfx .core .ComponentName ;
20+ import com .techsenger .patternfx .core .DefaultComponentName ;
2021
2122/**
2223 *
2324 * @author Pavel Castornii
2425 */
2526public final class DemoNames {
2627
27- public static final ComponentName PERSON_REGISTRY = new ComponentName ("PersonRegistry" );
28+ public static final ComponentName PERSON_REGISTRY = new DefaultComponentName ("PersonRegistry" );
2829
29- public static final ComponentName PERSON_DIALOG = new ComponentName ("PersonDialog" );
30+ public static final ComponentName PERSON_DIALOG = new DefaultComponentName ("PersonDialog" );
3031
31- public static final ComponentName PERSON_REPORT = new ComponentName ("PersonReport" );
32+ public static final ComponentName PERSON_REPORT = new DefaultComponentName ("PersonReport" );
3233
3334 private DemoNames () {
3435 //empty
You can’t perform that action at this time.
0 commit comments