Skip to content

Commit 9c25d70

Browse files
mlopezFCpaodb
authored andcommitted
style: apply code formatter
1 parent edc0cdf commit 9c25d70

17 files changed

+115
-104
lines changed

src/main/java/com/flowingcode/vaadin/addons/extendedlogin/ExtendedLoginOverlay.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,10 +22,10 @@
2222
import com.vaadin.flow.component.login.LoginOverlay;
2323

2424
/**
25-
* Special LoginOverlay that provides additional methods for replacing specific parts of the contents
26-
*
27-
* @author mlopez
25+
* Special LoginOverlay that provides additional methods for replacing specific parts of the
26+
* contents
2827
*
28+
* @author mlopez
2929
*/
3030
@SuppressWarnings("serial")
3131
public class ExtendedLoginOverlay extends LoginOverlay implements ReplaceableLoginOverlay {}

src/main/java/com/flowingcode/vaadin/addons/extendedlogin/LoginLayout.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,37 +26,40 @@
2626
import com.vaadin.flow.router.RouterLayout;
2727

2828
/**
29-
* LoginOverlay based Layout that can be used to display views with a similar layout as the LoginOverlay
30-
* It also provides methods for replacing part of the contents of the overlay
31-
*
32-
* @author mlopez
29+
* LoginOverlay based Layout that can be used to display views with a similar layout as the
30+
* LoginOverlay It also provides methods for replacing part of the contents of the overlay
3331
*
32+
* @author mlopez
3433
*/
3534
@SuppressWarnings("serial")
3635
public class LoginLayout extends LoginOverlay implements RouterLayout, ReplaceableLoginOverlay {
37-
36+
3837
private HasElement content;
39-
38+
4039
@Override
4140
public void showRouterLayoutContent(HasElement content) {
4241
RouterLayout.super.showRouterLayoutContent(content);
4342
this.content = content;
4443
}
45-
44+
4645
@Override
4746
public void removeRouterLayoutContent(HasElement oldContent) {
4847
RouterLayout.super.removeRouterLayoutContent(oldContent);
4948
content = null;
5049
}
51-
50+
5251
@Override
5352
protected void onAttach(AttachEvent attachEvent) {
5453
super.onAttach(attachEvent);
5554
setOpened(true);
56-
this.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].replaceChildren())");
55+
this.getElement()
56+
.executeJs(
57+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].replaceChildren())");
5758
this.getElement().appendChild(content.getElement());
5859
content.getElement().setAttribute("slot", "form");
59-
this.content.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].appendChild(this))");
60+
this.content
61+
.getElement()
62+
.executeJs(
63+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].appendChild(this))");
6064
}
61-
6265
}

src/main/java/com/flowingcode/vaadin/addons/extendedlogin/ReplaceableLoginOverlay.java

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,31 +23,44 @@
2323

2424
/**
2525
* Mixin interface providing methods for replacing contents of the LoginOverlay
26-
*
27-
* @author mlopez
2826
*
27+
* @author mlopez
2928
*/
3029
public interface ReplaceableLoginOverlay extends HasElement {
31-
30+
3231
default void replaceFormComponents(HasElement... withElement) {
33-
this.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].getElementsByTagName('form')[0].replaceChildren())");
32+
this.getElement()
33+
.executeJs(
34+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].getElementsByTagName('form')[0].replaceChildren())");
3435
for (HasElement we : withElement) {
3536
getElement().appendChild(we.getElement());
36-
this.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].getElementsByTagName('form')[0].appendChild($0))", we.getElement());
37+
this.getElement()
38+
.executeJs(
39+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].getElementsByTagName('form')[0].appendChild($0))",
40+
we.getElement());
3741
}
3842
}
3943

4044
default void replaceHeaderComponent(HasElement withElement) {
4145
getElement().appendChild(withElement.getElement());
42-
this.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').shadowRoot.querySelector('[part=\"brand\"]').replaceChildren())");
43-
this.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').shadowRoot.querySelector('[part=\"brand\"]').appendChild($0))", withElement);
46+
this.getElement()
47+
.executeJs(
48+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').shadowRoot.querySelector('[part=\"brand\"]').replaceChildren())");
49+
this.getElement()
50+
.executeJs(
51+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').shadowRoot.querySelector('[part=\"brand\"]').appendChild($0))",
52+
withElement);
4453
}
4554

4655
default void replaceForgotPassword(HasElement withElement) {
4756
withElement.getElement().setAttribute("slot", "forgot-password");
4857
getElement().appendChild(withElement.getElement());
49-
this.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].querySelector('[slot=\\\"forgot-password\\\"]').remove())");
50-
this.getElement().executeJs("setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].appendChild($0))", withElement);
58+
this.getElement()
59+
.executeJs(
60+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].querySelector('[slot=\\\"forgot-password\\\"]').remove())");
61+
this.getElement()
62+
.executeJs(
63+
"setTimeout(()=>document.getElementById('vaadinLoginOverlayWrapper').getElementsByTagName('vaadin-login-form-wrapper')[0].appendChild($0))",
64+
withElement);
5165
}
52-
5366
}

src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/DemoView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/ExtendedLoginDemoView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ public class ExtendedLoginDemoView extends TabbedDemo {
3636
public ExtendedLoginDemoView() {
3737
addDemo(LoginLayoutDemo.class);
3838
addDemo(ExtendedLoginOverlayDemo.class);
39-
39+
4040
setSizeFull();
4141
}
4242
}

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/ExtendedLoginOverlayDemo.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,18 +25,18 @@
2525
import com.vaadin.flow.router.PageTitle;
2626
import com.vaadin.flow.router.Route;
2727

28-
@DemoSource("/src/test/java/com/flowingcode/vaadin/addons/extendedlogin/TestExtendedLoginOverlayView.java")
28+
@DemoSource(
29+
"/src/test/java/com/flowingcode/vaadin/addons/extendedlogin/TestExtendedLoginOverlayView.java")
2930
@PageTitle("Extended Login Add-on Demo")
3031
@SuppressWarnings("serial")
3132
@Route(value = "overlay-demo", layout = ExtendedLoginDemoView.class)
3233
public class ExtendedLoginOverlayDemo extends Div {
3334

3435
public ExtendedLoginOverlayDemo() {
35-
36+
3637
IFrame iframe = new IFrame("/login-overlay");
3738
iframe.setSizeFull();
3839
iframe.getElement().setAttribute("frameBorder", "0");
3940
add(iframe);
4041
}
41-
4242
}

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/LoginLayoutDemo.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,5 +37,4 @@ public LoginLayoutDemo() {
3737
iframe.getElement().setAttribute("frameBorder", "0");
3838
add(iframe);
3939
}
40-
4140
}

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/TestExtendedLoginOverlayView.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,7 +19,6 @@
1919
*/
2020
package com.flowingcode.vaadin.addons.extendedlogin;
2121

22-
import java.util.Arrays;
2322
import com.vaadin.flow.component.button.Button;
2423
import com.vaadin.flow.component.combobox.ComboBox;
2524
import com.vaadin.flow.component.html.Anchor;
@@ -29,20 +28,21 @@
2928
import com.vaadin.flow.component.textfield.PasswordField;
3029
import com.vaadin.flow.component.textfield.TextField;
3130
import com.vaadin.flow.router.Route;
31+
import java.util.Arrays;
3232

3333
/**
3434
* View that provides a demo of using an ExtendedLoginOverlay
35-
*
36-
* @author mlopez
3735
*
36+
* @author mlopez
3837
*/
3938
@SuppressWarnings("serial")
4039
@Route(value = "login-overlay")
4140
public class TestExtendedLoginOverlayView extends Div {
4241

4342
public TestExtendedLoginOverlayView() {
4443
ExtendedLoginOverlay elo = new ExtendedLoginOverlay();
45-
elo.replaceFormComponents(new TextField("Email", "[email protected]"),
44+
elo.replaceFormComponents(
45+
new TextField("Email", "[email protected]"),
4646
new ComboBox<String>("Branch", Arrays.asList("Santa Fe", "Rosario")),
4747
new PasswordField("Password"),
4848
new Button("Sign In", ev -> Notification.show("Login successfull")));

src/test/java/com/flowingcode/vaadin/addons/extendedlogin/TestLoginLayout.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,19 +19,17 @@
1919
*/
2020
package com.flowingcode.vaadin.addons.extendedlogin;
2121

22-
import com.flowingcode.vaadin.addons.extendedlogin.LoginLayout;
2322
import com.vaadin.flow.component.html.Image;
2423
import com.vaadin.flow.component.login.LoginI18n;
2524
import com.vaadin.flow.component.login.LoginI18n.Header;
2625

2726
/**
2827
* Test Login Layout that customizes titles, descriptions and additional information
29-
*
30-
* @author mlopez
3128
*
29+
* @author mlopez
3230
*/
3331
public class TestLoginLayout extends LoginLayout {
34-
32+
3533
private static final long serialVersionUID = 1L;
3634

3735
public TestLoginLayout() {

0 commit comments

Comments
 (0)