Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master intellij code analyzer #11

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# gmd-core-demo 2.5.0
# gmd-core-demo 2.6.1
A modern demo for GMD widgets.

### Related Demo sites
- [2.2 Demo](https://gwtmaterialdesign.github.io/gwt-material-demo/#countUp)
- [2.2 Demo](https://gwtmaterialdesign.github.io/gwt-material-demo/#countUp)
- [Addins](https://gwtmaterialdesign.github.io/gmd-addins-demo/)
- [DataTable](https://gwtmaterialdesign.github.io/gmd-table-demo/)
- [AmCharts](https://gwtmaterialdesign.github.io/gmd-amcharts4-demo/)
Expand All @@ -13,3 +13,7 @@ Note: You must know Git and Maven before as prerequisites
2. Open the project on your desired IDE (Intellij IDE or Eclipse)
3. Install the project using `mvn clean install`
4. Then run the project using `mvn gwt:codeserver`

Note: If you are using java 17,21 and IntelliJ Ultimate
you need to add VM Options : --add-opens java.base/java.lang=ALL-UNNAMED
and Dev Mode Parameters : -port 8891 -codeServerPort 9879
4 changes: 2 additions & 2 deletions bin/sw-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var cacheName = '{{cacheName}}';
var filesToCache = [ {{#each filesToCache}}
'{{.}}'{{#unless @last}},{{/unless}}
{{/each}}
];
]


/**
Expand Down Expand Up @@ -59,4 +59,4 @@ event.respondWith(
return response || fetch(event.request);
})
);
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Service worker generator",
"main": "bin/sw-builder.js",
"dependencies": {
"handlebars": "^4.0.11"
"handlebars": "^4.7.8"
},
"devDependencies": {},
"scripts": {
Expand Down
44 changes: 26 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

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 CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -33,10 +33,10 @@
<app.id>gmd-core-demo</app.id>
<app.version>1</app.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gwt.version>2.9.0</gwt.version>
<gwt.version>2.11.0</gwt.version>
<gwtp.version>1.6</gwtp.version>
<gin.version>2.1.2</gin.version>
<gwt-material.version>2.7.0-SNAPSHOT</gwt-material.version>
<gwt-material.version>2.8.3</gwt-material.version>

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down Expand Up @@ -105,7 +105,9 @@

<!-- Copy webapp content to deploy folder -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-resources</id>
Expand All @@ -130,7 +132,7 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<version>1.15.0</version>
<executions>
<execution>
<id>install node and npm</id>
Expand Down Expand Up @@ -176,7 +178,7 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt</artifactId>
<version>${gwt.version}</version>
<type>pom</type>
Expand All @@ -188,22 +190,22 @@
<dependencies>
<!-- GWT -->
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
</dependency>

<!-- JDT -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.1.0-M1</version>
<scope>provided</scope>
</dependency>

<!-- GWTP -->
Expand Down Expand Up @@ -245,11 +247,17 @@
</dependency>

<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions src/main/java/gmd/core/demo/GmdCoreDemo.gwt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
"http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
"http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module rename-to='GmdCoreDemo'>
<inherits name='com.google.gwt.user.User'/>

Expand All @@ -45,6 +45,6 @@

<!-- Comment it if you want permutations per property.
It increases compilation time -->
<collapse-all-properties value="true" />
<collapse-all-properties value="true"/>

</module>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* 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 CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -95,6 +95,6 @@ protected void configure() {
install(new TextFieldModule());

bindPresenter(ApplicationPresenter.class, ApplicationPresenter.MyView.class, ApplicationView.class,
ApplicationPresenter.MyProxy.class);
ApplicationPresenter.MyProxy.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ interface MyView extends View, HasUiHandlers<MenuHandlers> {
void setupSearch();
}

private PlaceManager manager;
private final PlaceManager manager;

public static final NestedSlot SLOT_MAIN = new NestedSlot();

Expand Down
81 changes: 43 additions & 38 deletions src/main/java/gmd/core/demo/client/application/ApplicationView.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
import gwt.material.design.client.constants.Blur;
import gwt.material.design.client.constants.Color;
import gwt.material.design.client.constants.OverlayOption;
import gwt.material.design.client.ui.*;
import gwt.material.design.client.ui.MaterialFAB;
import gwt.material.design.client.ui.MaterialLabel;
import gwt.material.design.client.ui.MaterialLink;
import gwt.material.design.client.ui.MaterialPanel;
import gwt.material.design.client.ui.MaterialRow;
import gwt.material.design.client.ui.MaterialSideNavPush;
import gwt.material.design.client.ui.animate.MaterialAnimation;
import gwt.material.design.client.ui.animate.Transition;
import gwt.material.design.incubator.client.search.InlineSearch;
Expand All @@ -52,6 +57,42 @@

public class ApplicationView extends ViewWithUiHandlers<MenuHandlers> implements ApplicationPresenter.MyView {

private void onWindowScroll(Window.ScrollEvent event) {
boolean isInViewPort = new ScrollHelper().isInViewPort(title);
if (!isInViewPort) {
if (!scrolling) {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.FADEINUP);
animation.animate(navBrand);
navBrand.setText(title.getText());
scrolling = true;
}

} else {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.FADEINUP);
animation.animate(navBrand);
navBrand.setText("");
scrolling = false;
}

if (event.getScrollTop() > 320) {
if (fabUp.getOpacity() == 0) {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.ZOOMIN);
animation.animate(fabUp, () -> fabUp.setOpacity(1));
}
} else {
if (fabUp.getOpacity() == 1) {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.ZOOMOUT);
animation.animate(fabUp, () -> {
fabUp.setOpacity(0);
});
}
}
}

interface Binder extends UiBinder<Widget, ApplicationView> {
}

Expand Down Expand Up @@ -114,43 +155,7 @@ public void setupSideNav(List<Component> links) {

@Override
public void setupHeader() {
Window.addWindowScrollHandler(event -> {
boolean isInViewPort = new ScrollHelper().isInViewPort(title);
if (!isInViewPort) {
if (!scrolling) {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.FADEINUP);
animation.animate(navBrand);
navBrand.setText(title.getText());
scrolling = true;
}

} else {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.FADEINUP);
animation.animate(navBrand);
navBrand.setText("");
scrolling = false;
}

if (event.getScrollTop() > 320) {
if (fabUp.getOpacity() == 0) {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.ZOOMIN);
animation.animate(fabUp, () -> {
fabUp.setOpacity(1);
});
}
} else {
if (fabUp.getOpacity() == 1) {
MaterialAnimation animation = new MaterialAnimation();
animation.setTransition(Transition.ZOOMOUT);
animation.animate(fabUp, () -> {
fabUp.setOpacity(0);
});
}
}
});
Window.addWindowScrollHandler(this::onWindowScroll);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

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 CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -18,7 +18,6 @@
#L%
-->
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:m="urn:import:gwt.material.design.client.ui"
xmlns:ma="urn:import:gwt.material.design.addins.client"
xmlns:incubator="urn:import:gwt.material.design.incubator.client">
Expand All @@ -31,7 +30,8 @@
<m:MaterialNavBrand>
<m:MaterialLabel ui:field="navBrand" fontSize="0.8em"/>
</m:MaterialNavBrand>
<incubator:search.InlineSearch autocomplete="OFF" hideOn="HIDE_ON_MED_DOWN" ui:field="search" theme="LIGHT" width="50%" placeholder="Search" display="INLINE"/>
<incubator:search.InlineSearch autocomplete="OFF" hideOn="HIDE_ON_MED_DOWN" ui:field="search"
theme="LIGHT" width="50%" placeholder="Search" display="INLINE"/>
<m:MaterialNavSection hideOn="NONE" float="RIGHT" marginRight="40">
<m:MaterialDarkModeToggle/>
</m:MaterialNavSection>
Expand All @@ -40,7 +40,8 @@

<m:MaterialSideNavPush ui:field="sidenav" m:id="right-sidenav" width="300">
<m:MaterialSideNavContent ui:field="home" height="60px">
<ma:webp.MaterialWebpImage url="images/gmd-logo.webp" alt="logo" float="LEFT" width="32px" marginRight="20"/>
<ma:webp.MaterialWebpImage url="images/gmd-logo.webp" alt="logo" float="LEFT" width="32px"
marginRight="20"/>
<m:MaterialPanel>
<m:MaterialLabel ui:field="name" fontWeight="BOLD" lineHeight="24" marginTop="12"/>
<m:MaterialLabel ui:field="version" lineHeight="12" fontSize="0.8em"/>
Expand All @@ -53,13 +54,15 @@
<m:MaterialPanel addStyleNames="app-header" ui:field="header" padding="40" borderBottom="1px solid #e9e9e9">
<m:MaterialRow marginBottom="0">
<m:MaterialColumn grid="s12 m12 l9">
<m:MaterialLabel ui:field="title" fontSize="2.4em" />
<m:MaterialLabel ui:field="title" fontSize="2.4em"/>
<m:MaterialLabel secondary="true" ui:field="description" marginBottom="20"/>
</m:MaterialColumn>
</m:MaterialRow>
<m:MaterialRow marginBottom="0" paddingLeft="20">
<m:MaterialLink ui:field="javaSource" display="INLINE_BLOCK" marginRight="20" target="_blank" text="Java" paddingLeft="0" customIconType="fab fa-java"/>
<m:MaterialLink ui:field="xmlSource" display="INLINE_BLOCK" target="_blank" text="XML" iconType="CODE"/>
<m:MaterialLink ui:field="javaSource" display="INLINE_BLOCK" marginRight="20" target="_blank"
text="Java" paddingLeft="0" customIconType="fab fa-java"/>
<m:MaterialLink ui:field="xmlSource" display="INLINE_BLOCK" target="_blank" text="XML"
iconType="CODE"/>
</m:MaterialRow>
</m:MaterialPanel>

Expand All @@ -69,18 +72,21 @@
<m:MaterialRow marginBottom="0">
<m:MaterialColumn grid="s6 l4">
<m:MaterialLabel text="Copyright gwt-material - " float="LEFT" marginRight="12"/>
<m:MaterialLabel ui:field="year" float="LEFT" />
<m:MaterialLabel ui:field="year" float="LEFT"/>
</m:MaterialColumn>
<m:MaterialColumn grid="s6 l5" marginTop="-8" textAlign="RIGHT">
<m:MaterialLink ui:field="github" display="INLINE_BLOCK" text="Github" marginRight="32" customIconType="fab fa-github" target="_blank" shadow="0"/>
<m:MaterialLink ui:field="slack" display="INLINE_BLOCK" text="Slack" customIconType="fab fa-slack" target="_blank" shadow="0"/>
<m:MaterialLink ui:field="github" display="INLINE_BLOCK" text="Github" marginRight="32"
customIconType="fab fa-github" target="_blank" shadow="0"/>
<m:MaterialLink ui:field="slack" display="INLINE_BLOCK" text="Slack"
customIconType="fab fa-slack" target="_blank" shadow="0"/>
</m:MaterialColumn>
</m:MaterialRow>
</m:MaterialPanel>
</m:MaterialContainer>

<m:MaterialFAB ui:field="fabUp" opacity="0">
<m:MaterialButton iconType="KEYBOARD_ARROW_UP" type="FLOATING" size="LARGE" backgroundColor="WHITE" iconColor="INDIGO"/>
<m:MaterialButton iconType="KEYBOARD_ARROW_UP" type="FLOATING" size="LARGE" backgroundColor="WHITE"
iconColor="INDIGO"/>
</m:MaterialFAB>
</m:MaterialPanel>
</ui:UiBinder>
Loading