diff --git a/.gitignore b/.gitignore index fbb4c0b..bdcaaf2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,11 @@ .idea/dictionaries .idea/vcs.xml .idea/jsLibraryMappings.xml +.idea/compiler.xml +.idea/misc.xml +.idea/modules.xml +.idea/spring-mvc-async-progress.iml +.idea/encodings.xml # Sensitive or high-churn files: .idea/dataSources.ids diff --git a/src/main/java/de/codepotion/examples/asyncExample/AsyncExampleApplication.java b/src/main/java/de/codepotion/examples/async/AsyncExampleApplication.java similarity index 94% rename from src/main/java/de/codepotion/examples/asyncExample/AsyncExampleApplication.java rename to src/main/java/de/codepotion/examples/async/AsyncExampleApplication.java index bd8e693..0f28882 100644 --- a/src/main/java/de/codepotion/examples/asyncExample/AsyncExampleApplication.java +++ b/src/main/java/de/codepotion/examples/async/AsyncExampleApplication.java @@ -1,4 +1,4 @@ -package de.codepotion.examples.asyncExample; +package de.codepotion.examples.async; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/de/codepotion/examples/asyncExample/asyncService.java b/src/main/java/de/codepotion/examples/async/AsyncService.java similarity index 80% rename from src/main/java/de/codepotion/examples/asyncExample/asyncService.java rename to src/main/java/de/codepotion/examples/async/AsyncService.java index 880bb62..fbcb02c 100644 --- a/src/main/java/de/codepotion/examples/asyncExample/asyncService.java +++ b/src/main/java/de/codepotion/examples/async/AsyncService.java @@ -1,4 +1,4 @@ -package de.codepotion.examples.asyncExample; +package de.codepotion.examples.async; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -7,7 +7,7 @@ * Created by Frenos on 18.08.2016. */ @Service -public class asyncService { +public class AsyncService { @Async public void doWork(Runnable runnable) { System.out.println("Got runnable " + runnable); diff --git a/src/main/java/de/codepotion/examples/asyncExample/WebController.java b/src/main/java/de/codepotion/examples/async/WebController.java similarity index 84% rename from src/main/java/de/codepotion/examples/asyncExample/WebController.java rename to src/main/java/de/codepotion/examples/async/WebController.java index 0d7b069..fe4932a 100644 --- a/src/main/java/de/codepotion/examples/asyncExample/WebController.java +++ b/src/main/java/de/codepotion/examples/async/WebController.java @@ -1,6 +1,6 @@ -package de.codepotion.examples.asyncExample; +package de.codepotion.examples.async; -import de.codepotion.examples.asyncExample.jobs.ExampleJob; +import de.codepotion.examples.async.jobs.ExampleJob; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.messaging.simp.SimpMessagingTemplate; @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.util.List; import java.util.ArrayList; /** @@ -20,7 +21,7 @@ public class WebController { private static int jobNumber; - private final asyncService myService; + private final AsyncService myService; @Qualifier("taskExecutor") @Autowired private ThreadPoolTaskExecutor myExecutor; @@ -28,10 +29,10 @@ public class WebController { @Autowired private SimpMessagingTemplate template; - private ArrayList myJobList = new ArrayList<>(5); + private List myJobList = new ArrayList<>(5); @Autowired - WebController(asyncService myService) { + WebController(AsyncService myService) { this.myService = myService; } @@ -52,7 +53,7 @@ public void startWork() { @RequestMapping(value = "/status") @ResponseBody @SubscribeMapping("initial") - ArrayList fetchStatus() { + List fetchStatus() { return this.myJobList; } diff --git a/src/main/java/de/codepotion/examples/asyncExample/Configuration/WebSocketConfig.java b/src/main/java/de/codepotion/examples/async/configuration/WebSocketConfig.java similarity index 94% rename from src/main/java/de/codepotion/examples/asyncExample/Configuration/WebSocketConfig.java rename to src/main/java/de/codepotion/examples/async/configuration/WebSocketConfig.java index d39555f..8a79de9 100644 --- a/src/main/java/de/codepotion/examples/asyncExample/Configuration/WebSocketConfig.java +++ b/src/main/java/de/codepotion/examples/async/configuration/WebSocketConfig.java @@ -1,4 +1,4 @@ -package de.codepotion.examples.asyncExample.Configuration; +package de.codepotion.examples.async.configuration; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; diff --git a/src/main/java/de/codepotion/examples/asyncExample/jobs/DetailedJob.java b/src/main/java/de/codepotion/examples/async/jobs/DetailedJob.java similarity index 76% rename from src/main/java/de/codepotion/examples/asyncExample/jobs/DetailedJob.java rename to src/main/java/de/codepotion/examples/async/jobs/DetailedJob.java index e108adc..7ef179e 100644 --- a/src/main/java/de/codepotion/examples/asyncExample/jobs/DetailedJob.java +++ b/src/main/java/de/codepotion/examples/async/jobs/DetailedJob.java @@ -1,4 +1,4 @@ -package de.codepotion.examples.asyncExample.jobs; +package de.codepotion.examples.async.jobs; /** * Created by Frenos on 18.08.2016. diff --git a/src/main/java/de/codepotion/examples/asyncExample/jobs/ExampleJob.java b/src/main/java/de/codepotion/examples/async/jobs/ExampleJob.java similarity index 87% rename from src/main/java/de/codepotion/examples/asyncExample/jobs/ExampleJob.java rename to src/main/java/de/codepotion/examples/async/jobs/ExampleJob.java index 24aef7f..209a22c 100644 --- a/src/main/java/de/codepotion/examples/asyncExample/jobs/ExampleJob.java +++ b/src/main/java/de/codepotion/examples/async/jobs/ExampleJob.java @@ -1,6 +1,6 @@ -package de.codepotion.examples.asyncExample.jobs; +package de.codepotion.examples.async.jobs; -import de.codepotion.examples.asyncExample.Messages.JobprogressMessage; +import de.codepotion.examples.async.messages.JobProgressMessage; import org.springframework.messaging.simp.SimpMessagingTemplate; import java.util.Random; @@ -51,8 +51,8 @@ public void run() { sendProgress(); } - public void sendProgress() { - JobprogressMessage temp = new JobprogressMessage(jobName); + private void sendProgress() { + JobProgressMessage temp = new JobProgressMessage(jobName); temp.setProgress(progress.get()); temp.setState(state); diff --git a/src/main/java/de/codepotion/examples/asyncExample/Messages/JobprogressMessage.java b/src/main/java/de/codepotion/examples/async/messages/JobProgressMessage.java similarity index 79% rename from src/main/java/de/codepotion/examples/asyncExample/Messages/JobprogressMessage.java rename to src/main/java/de/codepotion/examples/async/messages/JobProgressMessage.java index 4742e2a..9e6824c 100644 --- a/src/main/java/de/codepotion/examples/asyncExample/Messages/JobprogressMessage.java +++ b/src/main/java/de/codepotion/examples/async/messages/JobProgressMessage.java @@ -1,14 +1,14 @@ -package de.codepotion.examples.asyncExample.Messages; +package de.codepotion.examples.async.messages; /** * Created by Frenos on 23.08.2016. */ -public class JobprogressMessage { +public class JobProgressMessage { private String jobName; private String state; private int progress; - public JobprogressMessage(String jobName) + public JobProgressMessage(String jobName) { this.jobName = jobName; } diff --git a/src/main/resources/static/css/bootstrap.css b/src/main/resources/static/css/bootstrap.css index 6167622..810398c 100644 --- a/src/main/resources/static/css/bootstrap.css +++ b/src/main/resources/static/css/bootstrap.css @@ -3764,16 +3764,10 @@ tbody.collapse.in { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; + border-radius: 4px 4px 0 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; + border-radius: 0 0 4px 4px; } .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; @@ -4366,10 +4360,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } .navbar-form { padding: 10px 15px; - margin-top: 8px; - margin-right: -15px; - margin-bottom: 8px; - margin-left: -15px; + margin: 8px -15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); @@ -4452,10 +4443,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { margin-bottom: 0; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; + border-radius: 4px 4px 0 0; } .navbar-btn { margin-top: 8px;