> {
20 | /**
21 | * asButton.
22 | *
23 | * @return a T object
24 | */
25 | T asButton();
26 | }
27 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/cards/HeaderPosition.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.cards;
17 |
18 | /** An enum representing the card header position */
19 | public enum HeaderPosition {
20 | /** Places the card header at the top above the body */
21 | TOP,
22 | /** Places the card header at the bottom below the body */
23 | BOTTOM;
24 | }
25 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/collapsible/CollapsibleHandlers.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.collapsible;
17 |
18 | /** CollapsibleHandlers interface. */
19 | public interface CollapsibleHandlers {
20 |
21 | /**
22 | * onBeforeExpand.
23 | *
24 | * @return a {@link java.lang.Runnable} object
25 | */
26 | Runnable onBeforeExpand();
27 |
28 | /**
29 | * onExpandCompleted.
30 | *
31 | * @return a {@link java.lang.Runnable} object
32 | */
33 | Runnable onExpandCompleted();
34 |
35 | /**
36 | * onBeforeCollapse.
37 | *
38 | * @return a {@link java.lang.Runnable} object
39 | */
40 | Runnable onBeforeCollapse();
41 |
42 | /**
43 | * onCollapseCompleted.
44 | *
45 | * @return a {@link java.lang.Runnable} object
46 | */
47 | Runnable onCollapseCompleted();
48 | }
49 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/AccordionConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | import java.util.function.Supplier;
19 | import org.dominokit.domino.ui.collapsible.CollapseStrategy;
20 | import org.dominokit.domino.ui.collapsible.HeightCollapseStrategy;
21 |
22 | /**
23 | * Implementations of this interface can be used to configure defaults for {@link
24 | * org.dominokit.domino.ui.collapsible.Accordion} component
25 | */
26 | public interface AccordionConfig extends ComponentConfig {
27 |
28 | /**
29 | * Use this method to define the default CollapseStrategy for accordions
30 | *
31 | * Defaults to : {@code HeightCollapseStrategy}
32 | *
33 | * @return a {@code Supplier}
34 | */
35 | default Supplier getDefaultAccordionCollapseStrategySupplier() {
36 | return HeightCollapseStrategy::new;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/CarouselConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | public interface CarouselConfig extends ComponentConfig {
19 | /** @return boolean, true to allow scrolling a carousel with mouse scroll wheel. */
20 | default boolean isScrollCarouselWithWheel() {
21 | return false;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/ComponentConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | /** ComponentConfig interface. */
19 | public interface ComponentConfig {}
20 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/DatatableConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | public interface DatatableConfig extends ComponentConfig {
19 | default boolean isRemoveSummaryRecordsForEmptyTable() {
20 | return false;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/DefaultUIConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | /** DefaultUIConfig class. */
19 | public class DefaultUIConfig implements UIConfig {}
20 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/HasComponentConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | import static java.util.Objects.nonNull;
19 |
20 | import org.dominokit.domino.ui.utils.DominoUIConfig;
21 |
22 | /** HasComponentConfig interface. */
23 | public interface HasComponentConfig {
24 | /**
25 | * getConfig.
26 | *
27 | * @return a T object
28 | */
29 | default T getConfig() {
30 | if (nonNull(getOwnConfig())) {
31 | return getOwnConfig();
32 | }
33 | return (T) DominoUIConfig.CONFIG.getUIConfig();
34 | }
35 |
36 | default T getOwnConfig() {
37 | return null;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/MenuConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | public interface MenuConfig extends ZIndexConfig {
19 | default String getNoResultMatchMessage(String token) {
20 | return "No results matched " + " " + token + "";
21 | }
22 |
23 | default String getMissingItemCreateLabel() {
24 | return "Create ";
25 | }
26 |
27 | default String getMissingItemCreateMessage(String token) {
28 | return getMissingItemCreateLabel() + " " + token + "";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/PopoverConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | import org.dominokit.domino.ui.menu.direction.DropDirection;
19 | import org.dominokit.domino.ui.utils.DominoUIConfig;
20 |
21 | public interface PopoverConfig extends ZIndexConfig {
22 |
23 | default DropDirection getDefaultPopoverDropDirection() {
24 | return DropDirection.BEST_MIDDLE_UP_DOWN;
25 | }
26 |
27 | default boolean closeOnBlur() {
28 | return DominoUIConfig.CONFIG.isClosePopupOnBlur();
29 | }
30 |
31 | default int openDelay() {
32 | return 0;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/RichTextConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | import java.util.Arrays;
19 | import java.util.Collection;
20 | import org.dominokit.domino.ui.richtext.RichTextActions;
21 |
22 | public interface RichTextConfig extends ComponentConfig {
23 |
24 | default Collection getDefaultRichTextActions() {
25 | return Arrays.asList(RichTextActions.values());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/StepperConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | import org.dominokit.domino.ui.stepper.StepState;
19 |
20 | /**
21 | * Implementations of this interface can be used to configure defaults for {@link
22 | * org.dominokit.domino.ui.stepper.Stepper} component
23 | */
24 | public interface StepperConfig extends ComponentConfig {
25 |
26 | /**
27 | * Use this method to define the default StepState for Stepper steps
28 | *
29 | * Defaults to : {@code StepState.INACTIVE}
30 | *
31 | * @return a {@link StepState}
32 | */
33 | default StepState getDefaultStepState() {
34 | return StepState.INACTIVE;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/TimePickerConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | import java.util.function.Supplier;
19 | import org.dominokit.domino.ui.icons.Icon;
20 | import org.dominokit.domino.ui.icons.lib.Icons;
21 |
22 | /**
23 | * Implementations of this interface can be used to configure defaults for {@link
24 | * org.dominokit.domino.ui.timepicker.TimePicker} component
25 | */
26 | public interface TimePickerConfig extends ComponentConfig {
27 | /**
28 | * Use this method to define the default icon for a timebox.
29 | *
30 | *
Defaults to : {@code clock_outline}
31 | *
32 | * @return a {@code Supplier>}
33 | */
34 | default Supplier> defaultTimeBoxIcon() {
35 | return Icons::clock_outline;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/config/UIConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.config;
17 |
18 | /** UIConfig interface. */
19 | public interface UIConfig
20 | extends FormsFieldsConfig,
21 | ZIndexConfig,
22 | AccordionConfig,
23 | CardConfig,
24 | ProgressBarConfig,
25 | SearchConfig,
26 | SpinConfig,
27 | TabsConfig,
28 | TreeConfig,
29 | UploadConfig,
30 | StepperConfig,
31 | CalendarConfig,
32 | TimePickerConfig,
33 | DelayedActionConfig,
34 | DatatableConfig,
35 | CarouselConfig,
36 | RichTextConfig,
37 | SlidersConfig,
38 | MenuConfig,
39 | PopoverConfig {}
40 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/CellValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable;
18 |
19 | import org.dominokit.domino.ui.forms.validations.ValidationResult;
20 |
21 | /**
22 | * A functional interface representing a validator for a data table cell. This interface defines the
23 | * validation behavior for individual cells in a data table. Implementing this interface allows for
24 | * custom validation logic to be applied to cell values.
25 | */
26 | @FunctionalInterface
27 | public interface CellValidator {
28 |
29 | /**
30 | * Executes the validation logic for a cell.
31 | *
32 | * @return a {@link ValidationResult} object indicating the result of the validation.
33 | */
34 | ValidationResult onValidate();
35 | }
36 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/ColumnShowHideListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable;
18 |
19 | /** An interface representing a listener for column show/hide events in a data table. */
20 | public interface ColumnShowHideListener {
21 |
22 | /**
23 | * Called when a column is shown or hidden in a data table.
24 | *
25 | * @param visible A boolean indicating whether the column is now visible (true) or hidden (false).
26 | */
27 | void onShowHide(boolean visible);
28 |
29 | /**
30 | * Checks if the column show/hide listener is permanent.
31 | *
32 | * @return {@code true} if the listener is permanent, {@code false} otherwise.
33 | */
34 | boolean isPermanent();
35 | }
36 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/DirtyRecordHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable;
18 |
19 | /**
20 | * A functional interface for handling updates to dirty records in a data table.
21 | *
22 | * @param The type of the dirty record.
23 | */
24 | @FunctionalInterface
25 | public interface DirtyRecordHandler {
26 |
27 | /**
28 | * Called when a dirty record is updated.
29 | *
30 | * @param dirty The updated dirty record.
31 | */
32 | void onUpdateDirtyRecord(T dirty);
33 | }
34 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/DirtyRecordProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable;
18 |
19 | /**
20 | * The {@code DirtyRecordProvider} functional interface defines a contract for creating a dirty
21 | * (modified) record based on the original record.
22 | *
23 | * @param The type of data representing the records in the data table.
24 | */
25 | @FunctionalInterface
26 | public interface DirtyRecordProvider {
27 |
28 | /**
29 | * Creates a dirty (modified) record based on the original record.
30 | *
31 | * @param original The original record that needs to be modified.
32 | * @return The modified (dirty) record.
33 | */
34 | T createDirtyRecord(T original);
35 | }
36 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/HeaderElementSupplier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable;
18 |
19 | import elemental2.dom.Node;
20 |
21 | /** A functional interface for supplying header elements in a data table. */
22 | @FunctionalInterface
23 | public interface HeaderElementSupplier {
24 |
25 | /**
26 | * Provides a header element based on the given column title.
27 | *
28 | * @param columnTitle The title of the column.
29 | * @return The header element.
30 | */
31 | Node asElement(String columnTitle);
32 | }
33 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/SaveDirtyRecordHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable;
18 |
19 | /**
20 | * The {@code SaveDirtyRecordHandler} functional interface defines a contract for handling the
21 | * saving of a dirty (modified) record compared to its original version in a data table.
22 | *
23 | * @param The type of data representing the record.
24 | */
25 | @FunctionalInterface
26 | public interface SaveDirtyRecordHandler {
27 |
28 | /**
29 | * Handles the saving of a dirty record compared to its original version.
30 | *
31 | * @param originalRecord The original, unmodified record.
32 | * @param dirtyRecord The modified (dirty) record to be saved.
33 | */
34 | void saveDirtyRecord(T originalRecord, T dirtyRecord);
35 | }
36 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/SelectionCondition.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable;
18 |
19 | /**
20 | * The {@code SelectionCondition} functional interface defines a contract for specifying the
21 | * conditions under which a row in a data table can be selected.
22 | *
23 | * @param The type of data representing the records in the data table.
24 | */
25 | public interface SelectionCondition {
26 |
27 | /**
28 | * Determines whether the selection of a specific row in a data table is allowed based on the
29 | * provided conditions.
30 | *
31 | * @param table The {@link DataTable} to which the row belongs.
32 | * @param tableRow The {@link TableRow} being considered for selection.
33 | * @return {@code true} if the row is allowed to be selected, {@code false} otherwise.
34 | */
35 | boolean isAllowSelection(DataTable table, TableRow tableRow);
36 | }
37 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/events/SearchClearedEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable.events;
18 |
19 | /**
20 | * The {@code SearchClearedEvent} class represents an event that is fired when a search is cleared
21 | * in a DataTable.
22 | *
23 | * @see org.dominokit.domino.ui.datatable.events.TableEvent
24 | */
25 | public class SearchClearedEvent implements TableEvent {
26 |
27 | /** The event type for the search-cleared event. */
28 | public static final String SEARCH_EVENT_CLEARED = "table-search-cleared";
29 |
30 | /**
31 | * Retrieves the type of this event.
32 | *
33 | * @return the event type
34 | */
35 | @Override
36 | public String getType() {
37 | return SEARCH_EVENT_CLEARED;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/events/TableEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable.events;
18 |
19 | /**
20 | * The {@code TableEvent} interface represents an event in a DataTable. Implementing classes should
21 | * provide a type for the event using the {@code getType} method.
22 | */
23 | public interface TableEvent {
24 |
25 | /**
26 | * Retrieves the type of this event.
27 | *
28 | * @return the event type
29 | */
30 | String getType();
31 | }
32 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/events/TableEventListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable.events;
18 |
19 | /**
20 | * The {@code TableEventListener} interface defines a contract for classes that can handle table
21 | * events. Implementing classes should provide an implementation for the {@code handleEvent} method.
22 | */
23 | public interface TableEventListener {
24 |
25 | /**
26 | * Handles a table event.
27 | *
28 | * @param event the table event to handle
29 | */
30 | void handleEvent(TableEvent event);
31 | }
32 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/PluginConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.datatable.plugins;
17 |
18 | /**
19 | * The {@code PluginConfig} interface serves as a marker interface for configuration objects used
20 | * with DataTable plugins. It does not define any methods or properties but is used to indicate that
21 | * a class is intended to be a configuration object for DataTable plugins.
22 | */
23 | public interface PluginConfig {}
24 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/PluginsConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.datatable.plugins;
17 |
18 | public final class PluginsConstants {
19 | public static final String DUI_DT_COL_RESIZING = "dui-dt-resizing";
20 | }
21 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/column/PinColumnFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.datatable.plugins.column;
17 |
18 | import org.dominokit.domino.ui.datatable.ColumnConfig;
19 |
20 | /** The functional interface for pinning columns in a DataTable. */
21 | interface PinColumnFunction {
22 |
23 | /**
24 | * Pins a column to a specified position in a DataTable.
25 | *
26 | * @param column The column to be pinned.
27 | * @param position The position to which the column should be pinned.
28 | * @return The new position of the column after pinning.
29 | */
30 | double pin(ColumnConfig> column, double position);
31 | }
32 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/tree/IsTreeNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable.plugins.tree;
18 |
19 | /** An interface to represent a tree node in a hierarchical structure. */
20 | public interface IsTreeNode {
21 |
22 | /**
23 | * Checks if this tree node has children nodes.
24 | *
25 | * @return {@code true} if this tree node has children nodes, {@code false} otherwise.
26 | */
27 | boolean hasChildren();
28 | }
29 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/tree/TreeNodeChildrenAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datatable.plugins.tree;
18 |
19 | /**
20 | * An interface to indicate whether a specific item in a tree structure has children.
21 | *
22 | * @param The type of items in the tree.
23 | */
24 | public interface TreeNodeChildrenAware {
25 |
26 | /**
27 | * Checks if the specified item has children.
28 | *
29 | * @param record The item to check for children.
30 | * @return {@code true} if the item has children, {@code false} otherwise.
31 | */
32 | boolean hasChildren(T record);
33 | }
34 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datatable/store/StoreDataChangeListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.datatable.store;
17 |
18 | /**
19 | * The {@code StoreDataChangeListener} functional interface defines a contract for handling data
20 | * change events in a data store used by a data table.
21 | *
22 | * @param The type of data representing the records in the data table.
23 | */
24 | @FunctionalInterface
25 | public interface StoreDataChangeListener {
26 |
27 | /**
28 | * Called when the data in the data store changes.
29 | *
30 | * @param dataChangedEvent The event containing information about the data change.
31 | */
32 | void onDataChanged(DataChangedEvent dataChangedEvent);
33 | }
34 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/CalendarPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datepicker;
18 |
19 | /**
20 | * A plugin interface for customizing the behavior and appearance of a calendar.
21 | *
22 | * Plugins can be added to a calendar to extend its functionality and respond to events.
23 | */
24 | public interface CalendarPlugin {
25 |
26 | /**
27 | * Invoked when a calendar day is added to the calendar view.
28 | *
29 | * @param calendarDay The calendar day that was added
30 | */
31 | default void onCalendarDayAdded(CalendarDay calendarDay) {}
32 |
33 | /**
34 | * Invoked when the calendar is initialized.
35 | *
36 | * @param calendar The calendar that is being initialized
37 | */
38 | default void onInit(Calendar calendar) {}
39 | }
40 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/datepicker/Pattern.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 org.dominokit.domino.ui.datepicker;
18 |
19 | /**
20 | * Enumerates the different date patterns used for formatting and parsing dates.
21 | *
22 | *
Usage Example:
23 | *
24 | *
25 | * Pattern pattern = Pattern.FULL;
26 | *
27 | */
28 | public enum Pattern {
29 |
30 | /** Represents a full pattern, usually the most verbose format. */
31 | FULL,
32 |
33 | /** Represents a long pattern, a detailed format excluding the most verbose elements. */
34 | LONG,
35 |
36 | /** Represents a medium pattern, less detailed than LONG but more than SHORT. */
37 | MEDIUM,
38 |
39 | /** Represents a short pattern, the least verbose format. */
40 | SHORT
41 | }
42 |
--------------------------------------------------------------------------------
/domino-ui/src/main/java/org/dominokit/domino/ui/dialogs/Dialog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Dominokit
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 | package org.dominokit.domino.ui.dialogs;
17 |
18 | /**
19 | * A concrete implementation of {@link AbstractDialog} to represent a generic dialog. This class
20 | * provides an easy way to create and manage a dialog window.
21 | *
22 | * Usage:
23 | *
24 | *
25 | * Dialog dialog = Dialog.create();
26 | * dialog.open();
27 | *
28 | *
29 | * @see AbstractDialog
30 | */
31 | public class Dialog extends AbstractDialog