mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 08:58:26 +00:00
* #2449 bump maven-checkstyle-plugin from 3.1.0 to 3.2.0 + resolve checkstyle issues * remove FileSelectorJFrame.java to resolve checkstyle issue * remove FileSelectorJFrame.java to resolve checkstyle issue * remove FileSelectorJFrame.java to resolve checkstyle issue * add refactored file with correct filename to resolve checkstyle issue * add the test data * change filenames from JFrame to Jframe for checkstyle * fix code smell from sonar report * add new testcases to improve the test coverage * remove code smell
This commit is contained in:
@@ -27,6 +27,9 @@ package com.iluwatar.model.view.viewmodel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Book class.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
public class Book {
|
||||
|
||||
@@ -27,6 +27,9 @@ package com.iluwatar.model.view.viewmodel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Class representing a service to load books.
|
||||
*/
|
||||
public interface BookService {
|
||||
/* List all books
|
||||
* @return all books
|
||||
|
||||
+3
@@ -27,6 +27,9 @@ package com.iluwatar.model.view.viewmodel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Class that actually implement the books to load.
|
||||
*/
|
||||
public class BookServiceImpl implements BookService {
|
||||
private List<Book> designPatternBooks = new ArrayList<>();
|
||||
|
||||
|
||||
+4
-2
@@ -25,11 +25,13 @@
|
||||
package com.iluwatar.model.view.viewmodel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.NotifyChange;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
|
||||
/**
|
||||
* BookViewModel class.
|
||||
*/
|
||||
public class BookViewModel {
|
||||
|
||||
@WireVariable
|
||||
@@ -56,7 +58,7 @@ public class BookViewModel {
|
||||
* and used to delete the selected book from the list of books.
|
||||
*/
|
||||
@Command
|
||||
@NotifyChange({"selectedBook","bookList"})
|
||||
@NotifyChange({"selectedBook", "bookList"})
|
||||
public void deleteBook() {
|
||||
if (selectedBook != null) {
|
||||
getBookList().remove(selectedBook);
|
||||
|
||||
Reference in New Issue
Block a user