Package: JavaFXSiteOpenerPresentationDelegate
JavaFXSiteOpenerPresentationDelegate
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
JavaFXSiteOpenerPresentationDelegate(JavaFXBinder) |
|
|
|
|
|
||||||||||||||||||||
bind(SiteOpenerPresentation.Bindings) |
|
|
|
|
|
||||||||||||||||||||
notifyInvitationToSelectAFolder(UserNotificationWithFeedback) |
|
|
|
|
|
Coverage
1: /*
2: * #%L
3: * *********************************************************************************************************************
4: *
5: * NorthernWind - lightweight CMS
6: * http://northernwind.tidalwave.it - git clone git@bitbucket.org:tidalwave/northernwind-rca-src.git
7: * %%
8: * Copyright (C) 2013 - 2021 Tidalwave s.a.s. (http://tidalwave.it)
9: * %%
10: * *********************************************************************************************************************
11: *
12: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
13: * the License. You may obtain a copy of the License at
14: *
15: * http://www.apache.org/licenses/LICENSE-2.0
16: *
17: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
18: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
19: * specific language governing permissions and limitations under the License.
20: *
21: * *********************************************************************************************************************
22: *
23: *
24: * *********************************************************************************************************************
25: * #L%
26: */
27: package it.tidalwave.northernwind.rca.ui.impl.javafx.siteopener;
28:
29: import javax.annotation.Nonnull;
30: import javafx.scene.control.Button;
31: import javafx.scene.control.MenuItem;
32: import javafx.fxml.FXML;
33: import it.tidalwave.util.ui.UserNotificationWithFeedback;
34: import it.tidalwave.role.ui.javafx.JavaFXBinder;
35: import it.tidalwave.northernwind.rca.ui.siteopener.SiteOpenerPresentation;
36: import lombok.RequiredArgsConstructor;
37:
38: /***********************************************************************************************************************
39: *
40: * The JavaFX delegate for the function of opening a new site. It manages the related global menu and toolbar button.
41: * Note that this delegate is not associated with a specific FXML resource, but it is injected with @FXML resources
42: * copied from the application JavaFX delegate.
43: *
44: * @stereotype Presentation
45: *
46: * @author Fabrizio Giudici
47: *
48: **********************************************************************************************************************/
49:•@RequiredArgsConstructor
50: public class JavaFXSiteOpenerPresentationDelegate implements SiteOpenerPresentation
51: {
52: @Nonnull
53: private final JavaFXBinder binder;
54:
55: @FXML
56: private Button btOpen;
57:
58: @FXML
59: private MenuItem openSiteMenu;
60:
61: private Bindings bindings;
62:
63: @Override
64: public void bind (@Nonnull final Bindings bindings)
65: {
66: this.bindings = bindings;
67: binder.bind(btOpen, bindings.openSiteAction);
68: binder.bind(openSiteMenu, bindings.openSiteAction);
69: }
70:
71: @Override
72: public void notifyInvitationToSelectAFolder (@Nonnull final UserNotificationWithFeedback notification)
73: {
74: binder.openDirectoryChooserFor(notification, bindings.folderToOpen);
75: }
76: }