-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New checkstyle to generate warnings using checkstyle.
CreateSearchList action is refactored version of SearchHandler and will be used both in showing the search result, and the friend list as toggleable objects in the list. Refactor of new formatting style. Removed ItemActions as they are no longer being used. New function in mainscreen makes it possible to remove item from main screen by referencing the Parent object. Extracted methods for the search function from main screen. New cross for closing the search in mainscreen without having to click away in non reachable places.
- Loading branch information
Showing
27 changed files
with
507 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
fagiClient/src/com/fagi/action/items/contentList/CreateSearchList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2016. Nicklas 'MiNiWolF' Pingel and Marcus 'Zargess' Haagh. | ||
*/ | ||
package com.fagi.action.items.contentList; | ||
|
||
import javafx.application.Platform; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.layout.HBox; | ||
import javafx.scene.layout.VBox; | ||
import com.fagi.action.Action; | ||
import com.fagi.controller.MainScreen; | ||
import com.fagi.controller.SearchContactController; | ||
import com.fagi.controller.contentList.ContentController; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by miniwolf on 14-12-2016. | ||
*/ | ||
public class CreateSearchList implements Action { | ||
private MainScreen mainScreen; | ||
private List<String> usernames; | ||
|
||
public CreateSearchList(MainScreen mainScreen, List<String> usernames) { | ||
this.mainScreen = mainScreen; | ||
this.usernames = usernames; | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
ContentController contentController = new ContentController(); | ||
FXMLLoader contentLoader = new FXMLLoader( | ||
mainScreen.getClass().getResource("/com/fagi/view/content/SearchContent.fxml")); | ||
contentLoader.setController(contentController); | ||
VBox searchContent; | ||
try { | ||
searchContent = contentLoader.load(); | ||
} catch (IOException ioe) { | ||
ioe.printStackTrace(); | ||
return; | ||
} | ||
|
||
for (String username : usernames) { | ||
SearchContactController controller = new SearchContactController(false, mainScreen); | ||
FXMLLoader loader = new FXMLLoader( | ||
mainScreen.getClass().getResource("/com/fagi/view/content/SearchContact.fxml")); | ||
loader.setController(controller); | ||
HBox searchContact; | ||
try { | ||
searchContact = loader.load(); | ||
controller.setUserName(username); | ||
contentController.addToContentList(searchContact); | ||
} catch (IOException ioe) { | ||
ioe.printStackTrace(); | ||
return; | ||
} | ||
} | ||
|
||
Platform.runLater(() -> mainScreen | ||
.setScrollPaneContent(mainScreen.getCurrentPaneContent(), searchContent)); | ||
} | ||
} |
Oops, something went wrong.