forked from Tools1000/drrename
-
-
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.
Refactorings to re-use RenamingPath in Kodi Tools
- Loading branch information
1 parent
599360f
commit 8af0768
Showing
20 changed files
with
322 additions
and
267 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Dr.Rename - A Minimalistic Batch Renamer | ||
* | ||
* Copyright (C) 2022 | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package drrename.kodi; | ||
|
||
import drrename.kodi.treeitem.content.KodiTreeItemContent; | ||
import drrename.kodi.treeitem.content.MovieTreeItemContent; | ||
import javafx.scene.control.TreeCell; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class KodiTreeCell extends TreeCell<KodiTreeItemContent> { | ||
|
||
@Override | ||
protected void updateItem(KodiTreeItemContent item, boolean empty) { | ||
|
||
super.updateItem(item, empty); | ||
if (item == null) { | ||
setText(null); | ||
setStyle(null); | ||
} else { | ||
setText(item.toString()); | ||
List<String> styles = new ArrayList<>(); | ||
if (item.hasWarning()) { | ||
if (item instanceof MovieTreeItemContent) { | ||
styles.add("-fx-font-size: 13;"); | ||
} | ||
styles.add("-fx-font-weight: bold;"); | ||
styles.add("-fx-background-color: wheat;"); | ||
var joinedStylesString = String.join(" ", styles); | ||
setStyle(joinedStylesString); | ||
} else { | ||
if (item instanceof MovieTreeItemContent) { | ||
styles.add("-fx-font-size: 14;"); | ||
} else | ||
setStyle(null); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.