forked from devonfw/cobigen
-
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.
devonfw#1454 Changes to project structure and home page
- Loading branch information
Showing
14 changed files
with
334 additions
and
252 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
21 changes: 0 additions & 21 deletions
21
cobigen/gui/src/main/java/com/devonfw/cobigen/gui/HomeController.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...evonfw/cobigen/gui/DetailsController.java → ...en/gui/controllers/DetailsController.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.devonfw.cobigen.gui; | ||
package com.devonfw.cobigen.gui.controllers; | ||
|
||
/** | ||
* TODO nneuhaus This type ... | ||
|
51 changes: 51 additions & 0 deletions
51
cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/HomeController.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,51 @@ | ||
package com.devonfw.cobigen.gui.controllers; | ||
|
||
import java.awt.Desktop; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
|
||
import com.devonfw.cobigen.gui.services.TreeViewBuilder; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.control.TreeView; | ||
import javafx.scene.layout.AnchorPane; | ||
|
||
/** | ||
* TODO nneuhaus This type ... | ||
* | ||
*/ | ||
public class HomeController implements Initializable { | ||
|
||
@FXML | ||
AnchorPane treeViewPane; | ||
|
||
private String[] EXAMPLE_LIST = { "Title of Increment 1", "Description of Increment 1", "Title of Increment 2", | ||
"Description of Increment 2", "Title of Increment 3", "Description of Increment 3" }; | ||
|
||
@Override | ||
public void initialize(URL location, ResourceBundle resources) { | ||
|
||
TreeView<String> treeView = TreeViewBuilder.buildTreeView(this.EXAMPLE_LIST); | ||
treeView.setId("treeView"); | ||
AnchorPane.setTopAnchor(treeView, 0.0); | ||
AnchorPane.setRightAnchor(treeView, 0.0); | ||
AnchorPane.setBottomAnchor(treeView, 0.0); | ||
AnchorPane.setLeftAnchor(treeView, 0.0); | ||
this.treeViewPane.getChildren().add(treeView); | ||
} | ||
|
||
/** | ||
* @param actionEvent | ||
* @throws IOException | ||
* @throws URISyntaxException | ||
*/ | ||
@FXML | ||
public void openWiki(javafx.event.ActionEvent actionEvent) throws IOException, URISyntaxException { | ||
|
||
Desktop.getDesktop().browse(new URI("https://github.com/devonfw/cobigen/wiki")); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../com/devonfw/cobigen/gui/CellFactory.java → ...nfw/cobigen/gui/services/CellFactory.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
55 changes: 55 additions & 0 deletions
55
cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TreeViewBuilder.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,55 @@ | ||
package com.devonfw.cobigen.gui.services; | ||
|
||
import java.util.List; | ||
|
||
import javafx.scene.control.TreeItem; | ||
import javafx.scene.control.TreeView; | ||
|
||
/** | ||
* Service class to build Tree Views | ||
* | ||
*/ | ||
public class TreeViewBuilder { | ||
|
||
/** | ||
* @param templateSetIncrements | ||
* @return | ||
*/ | ||
// TODO: Change type of parameter templateSetIncrements to List<TemplateSetIncrement> | ||
// Add Description and Explanation? | ||
public static String[] transformIncrementsToArray(List<String> templateSetIncrements) { | ||
|
||
String[] incrementsWithDescriptions = new String[templateSetIncrements.size() * 2]; | ||
|
||
for (int i = 0; i < incrementsWithDescriptions.length; i++) { | ||
if (i % 2 == 0) { | ||
// incrementsWithDescriptions[i] = templateSetIncrements.get(i).getName(); | ||
} else { | ||
// incrementsWithDescriptions[i] = templateSetIncrements.get(i).getDescription(); | ||
} | ||
} | ||
return incrementsWithDescriptions; | ||
} | ||
|
||
/** | ||
* @param listOfItems list to | ||
* @return | ||
*/ | ||
public static TreeView<String> buildTreeView(String[] listOfItems) { | ||
|
||
TreeItem<String> rootItem = new TreeItem<>("Increments"); | ||
rootItem.setExpanded(true); | ||
|
||
for (int i = 0; i < listOfItems.length; i++) { | ||
TreeItem<String> increment = new TreeItem<>(listOfItems[i]); | ||
i++; | ||
TreeItem<String> incrementDescription = new TreeItem<>(listOfItems[i]); | ||
increment.getChildren().add(incrementDescription); | ||
rootItem.getChildren().add(increment); | ||
} | ||
|
||
TreeView<String> tree = new TreeView<>(rootItem); | ||
return tree; | ||
} | ||
|
||
} |
25 changes: 0 additions & 25 deletions
25
cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/Home.fxml
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/HomeScreen.fxml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.