check if a chip has max 32 chars
* finished ImportView
This commit is contained in:
		@ -22,11 +22,17 @@ class RootController : Controller() {
 | 
			
		||||
        /*var data = Texture()
 | 
			
		||||
        var img = con.getTexturePreview(data.textureHash)
 | 
			
		||||
        var test = GUIModel(data, img)
 | 
			
		||||
        test.exportItem.setOnAction {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        mvc.addElement(test)
 | 
			
		||||
 | 
			
		||||
        data = Texture()
 | 
			
		||||
        img = con.getTexturePreview(data.textureHash)
 | 
			
		||||
        test = GUIModel(data, img)
 | 
			
		||||
        test.exportItem.setOnAction {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        mvc.addElement(test)*/
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@ class GUIModel constructor(data: Texture, img: Image) : VBox(){
 | 
			
		||||
    private var image = ImageView()
 | 
			
		||||
    private var label = Label()
 | 
			
		||||
    private var contextMenu = ContextMenu()
 | 
			
		||||
    private var exportItem = MenuItem("exportiern")
 | 
			
		||||
    var exportItem = MenuItem("exportiern")
 | 
			
		||||
 | 
			
		||||
    init {
 | 
			
		||||
        super.getChildren().addAll(image, label)
 | 
			
		||||
@ -36,18 +36,6 @@ class GUIModel constructor(data: Texture, img: Image) : VBox(){
 | 
			
		||||
        image.image = img
 | 
			
		||||
 | 
			
		||||
        contextMenu.items.add(exportItem)
 | 
			
		||||
        exportItem.setOnAction {
 | 
			
		||||
            println("I bims 1 export: ${label.text}")
 | 
			
		||||
            println(data.name)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun setText(text: String) {
 | 
			
		||||
        label.text = text
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun setImage(img: Image) {
 | 
			
		||||
        image.image = img
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -84,7 +84,7 @@ class ImportView : View() {
 | 
			
		||||
            tfName.promptText = "Name eingeben"
 | 
			
		||||
 | 
			
		||||
            cvTags.style = "-fx-background-color: #3c3f41; -fx-text-inner-color: #b15b2e;"
 | 
			
		||||
            //TODO change color of Chip´s
 | 
			
		||||
            //TODO change color of Chip´s see: https://github.com/jfoenixadmin/JFoenix/blob/master/jfoenix/src/main/resources/com/jfoenix/assets/css/controls/jfx-chip-view.css#L52
 | 
			
		||||
 | 
			
		||||
            btnImport.style = "-fx-button-type: RAISED; -fx-background-color: #3c3f41; -fx-text-fill: #2b7bbb;"
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -29,6 +29,6 @@ class ImportViewController : Controller() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun validateImport() {
 | 
			
		||||
        iv.btnImport.isVisible = iv.tfFilePath.text.isNotEmpty() && iv.tfName.text.isNotEmpty() && iv.cvTags.chips.isNotEmpty()
 | 
			
		||||
        iv.btnImport.isVisible = iv.tfFilePath.text.isNotEmpty() && iv.tfName.text.isNotEmpty() && iv.cvTags.chips.isNotEmpty() && iv.cvTags.chips.stream().allMatch { x -> x.length < 32 }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user