diff --git a/serverpackcreator-api/src/main/kotlin/de/griefed/serverpackcreator/api/serverpack/ServerPackHandler.kt b/serverpackcreator-api/src/main/kotlin/de/griefed/serverpackcreator/api/serverpack/ServerPackHandler.kt index c232c1824..9c33480cc 100644 --- a/serverpackcreator-api/src/main/kotlin/de/griefed/serverpackcreator/api/serverpack/ServerPackHandler.kt +++ b/serverpackcreator-api/src/main/kotlin/de/griefed/serverpackcreator/api/serverpack/ServerPackHandler.kt @@ -112,7 +112,7 @@ class ServerPackHandler( # installation of a compatible Java version, should JAVA be set to 'java'. # JDK_VENDOR is for the automatic installation of a JDK compatible with the Minecraft # version of your server pack. For an extensive list of available vendors, check out - # https://github.com/Jabba-Team/jabba/blob/c19c6ce2ae9645c39bbdca07b6c4e2ea39155f73/index.json + # https://github.com/Jabba-Team/index/blob/main/index.json # Note - For the installation to take place: # - SKIP_JAVA_CHECK must be set to 'false' # - JAVA be set to 'java' diff --git a/serverpackcreator-api/src/main/resources/serverpackcreator.properties b/serverpackcreator-api/src/main/resources/serverpackcreator.properties index 131674326..3e37d6170 100644 --- a/serverpackcreator-api/src/main/resources/serverpackcreator.properties +++ b/serverpackcreator-api/src/main/resources/serverpackcreator.properties @@ -14,7 +14,7 @@ de.griefed.serverpackcreator.configuration.directories.shouldexclude=animation,a de.griefed.serverpackcreator.spring.schedules.database.cleanup=0 0 0 * * * de.griefed.serverpackcreator.spring.schedules.files.cleanup=0 30 0 * * * de.griefed.serverpackcreator.spring.schedules.versions.refresh=0 0 0 * * * -de.griefed.serverpackcreator.configuration.directories.mustinclude=addonpacks,blueprints,config,configs,customnpcs,defaultconfigs,global_data_packs,global_packs,kubejs,maps,mods,openloader,scripts,shrines-saves,structures,structurize,worldshape,Zoestria +de.griefed.serverpackcreator.configuration.directories.mustinclude=addonpacks,blueprints,config,configs,customnpcs,defaultconfigs,global_data_packs,global_packs,kubejs,maps,mods,openloader,scripts,shrines-saves,structures,structurize,worldshape,Zoestria,modernfix de.griefed.serverpackcreator.serverpack.zip.exclude=minecraft_server.MINECRAFT_VERSION.jar,server.jar,libraries/net/minecraft/server/MINECRAFT_VERSION/server-MINECRAFT_VERSION.jar de.griefed.serverpackcreator.serverpack.zip.exclude.enabled=true de.griefed.serverpackcreator.minecraft.snapshots=false diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/FileFIeldDropType.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/FileFIeldDropType.kt new file mode 100644 index 000000000..98da3ca9a --- /dev/null +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/FileFIeldDropType.kt @@ -0,0 +1,33 @@ +/* Copyright (C) 2024 Griefed + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * The full license can be found at https:github.com/Griefed/ServerPackCreator/blob/main/LICENSE + */ +package de.griefed.serverpackcreator.app.gui.components + +/** + * Drop type to determine whether filters should only include certain types of files or folders. + * + * @author Griefed + */ +enum class FileFieldDropType { + FILE, + FOLDER, + FOLDER_OR_ZIP, + IMAGE, + PROPERTIES +} \ No newline at end of file diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextField.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextField.kt index 354d46862..0879aab6e 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextField.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextField.kt @@ -22,9 +22,11 @@ package de.griefed.serverpackcreator.app.gui.components import de.griefed.serverpackcreator.app.gui.GuiProps import de.griefed.serverpackcreator.app.gui.window.configs.components.SuggestionProvider import java.awt.Toolkit +import java.awt.dnd.DropTarget import java.awt.event.KeyEvent import java.awt.event.KeyListener import javax.swing.BorderFactory +import javax.swing.DropMode import javax.swing.JScrollPane import javax.swing.JTextField import javax.swing.event.DocumentListener @@ -92,6 +94,22 @@ open class ScrollTextField( } } + override fun getDropTarget(): DropTarget { + return textField.dropTarget + } + + override fun setDropTarget(dropTarget: DropTarget) { + textField.dropTarget = dropTarget + } + + fun setDropMode(mode: DropMode) { + textField.dropMode = mode + } + + fun getDropMode(): DropMode { + return textField.dropMode + } + /** * @author Griefed */ diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextFileField.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextFileField.kt index 1e55c0db4..6852de84f 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextFileField.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/components/ScrollTextFileField.kt @@ -20,7 +20,12 @@ package de.griefed.serverpackcreator.app.gui.components import de.griefed.serverpackcreator.app.gui.GuiProps +import java.awt.datatransfer.DataFlavor +import java.awt.dnd.DnDConstants +import java.awt.dnd.DropTarget +import java.awt.dnd.DropTargetDropEvent import java.io.File +import javax.swing.DropMode import javax.swing.JTextField /** @@ -32,10 +37,11 @@ import javax.swing.JTextField class ScrollTextFileField( guiProps: GuiProps, text: String, + dropType: FileFieldDropType, textField: JTextField = JTextField(text), horizontalScrollbarVisibility: Int = HORIZONTAL_SCROLLBAR_AS_NEEDED ) : ScrollTextField(guiProps, text, null, textField, horizontalScrollbarVisibility) { - constructor(guiProps: GuiProps,file: File, documentChangeListener: DocumentChangeListener) : this(guiProps,file.absolutePath) { + constructor(guiProps: GuiProps,file: File, dropType: FileFieldDropType, documentChangeListener: DocumentChangeListener) : this(guiProps,file.absolutePath, dropType) { this.addDocumentListener(documentChangeListener) } @@ -50,5 +56,68 @@ class ScrollTextFileField( init { textField.isEditable = guiProps.allowManualEditing file = File(text).absoluteFile + + textField.setDropMode(DropMode.INSERT) + textField.dropTarget = object : DropTarget() { + override fun drop(event: DropTargetDropEvent?) { + val transferable = event?.transferable ?: return + if (!event.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { + return + } + val files : List + + try { + event.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE) + files = transferable.getTransferData(DataFlavor.javaFileListFlavor) as List + } catch (e: Exception) { + return + } + + if (files.size != 1) { + return + } + + val file = files[0] + + when (dropType) { + FileFieldDropType.FILE -> { + if (!file.isFile || file.isDirectory) { + return + } + } + + FileFieldDropType.FOLDER -> { + if (!file.isDirectory) { + return + } + } + + FileFieldDropType.FOLDER_OR_ZIP -> { + if (!file.isDirectory && !file.name.endsWith(".zip", ignoreCase = true)) { + return + } + } + + FileFieldDropType.IMAGE -> { + if (!file.isFile || file.isDirectory || + (!file.name.endsWith(".png", ignoreCase = true) && + !file.name.endsWith(".jpg", ignoreCase = true) && + !file.name.endsWith(".jpeg", ignoreCase = true) && + !file.name.endsWith(".bmp", ignoreCase = true))) { + return + } + } + + FileFieldDropType.PROPERTIES -> { + if (!file.isFile || file.isDirectory || + !file.name.endsWith(".properties", ignoreCase = true)) { + return + } + } + } + + this@ScrollTextFileField.file = file + } + } } } \ No newline at end of file diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/ConfigEditor.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/ConfigEditor.kt index 24c50450e..6a4886d55 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/ConfigEditor.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/ConfigEditor.kt @@ -77,13 +77,13 @@ class ConfigEditor( private val modpackIcon = StatusIcon(guiProps,Translations.createserverpack_gui_createserverpack_labelmodpackdir_tip.toString()) private val modpackLabel = ElementLabel(Translations.createserverpack_gui_createserverpack_labelmodpackdir.toString()) - private val modpackSetting = ScrollTextFileField(guiProps,apiWrapper.apiProperties.homeDirectory, validationChangeListener) + private val modpackSetting = ScrollTextFileField(guiProps,apiWrapper.apiProperties.homeDirectory, FileFieldDropType.FOLDER_OR_ZIP, validationChangeListener) private val modpackChooser = BalloonTipButton(null, guiProps.folderIcon, Translations.createserverpack_gui_browser.toString(), guiProps) { selectModpackDirectory() } private val modpackCheck = BalloonTipButton(null, guiProps.inspectIcon,Translations.createserverpack_gui_buttonmodpackdir_scan_tip.toString(), guiProps) { updateGuiFromSelectedModpack() } private val propertiesIcon = StatusIcon(guiProps,Translations.createserverpack_gui_createserverpack_labelpropertiespath_tip.toString()) private val propertiesLabel = ElementLabel(Translations.createserverpack_gui_createserverpack_labelpropertiespath.toString()) - private val propertiesSetting = ScrollTextFileField(guiProps,apiWrapper.apiProperties.defaultServerProperties, validationChangeListener) + private val propertiesSetting = ScrollTextFileField(guiProps,apiWrapper.apiProperties.defaultServerProperties, FileFieldDropType.PROPERTIES, validationChangeListener) private val propertiesQuickSelectLabel = ElementLabel(Translations.createserverpack_gui_quickselect.toString()) private val propertiesQuickSelect = QuickSelect(tabbedConfigsTab.propertiesQuickSelections()) { setProperties() } private val propertiesChooser = BalloonTipButton(null, guiProps.folderIcon, Translations.createserverpack_gui_browser.toString(), guiProps) { selectServerProperties() } @@ -91,7 +91,7 @@ class ConfigEditor( private val iconIcon = StatusIcon(guiProps,Translations.createserverpack_gui_createserverpack_labeliconpath_tip.toString()) private val iconLabel = ElementLabel(Translations.createserverpack_gui_createserverpack_labeliconpath.toString()) - private val iconSetting = ScrollTextFileField(guiProps,apiWrapper.apiProperties.defaultServerIcon, validationChangeListener) + private val iconSetting = ScrollTextFileField(guiProps,apiWrapper.apiProperties.defaultServerIcon, FileFieldDropType.IMAGE, validationChangeListener) private val iconQuickSelectLabel = ElementLabel(Translations.createserverpack_gui_quickselect.toString()) private val iconQuickSelect = QuickSelect(tabbedConfigsTab.iconQuickSelections()) { setIcon() } private val iconChooser = BalloonTipButton(null, guiProps.folderIcon, Translations.createserverpack_gui_browser.toString(), guiProps) { selectServerIcon() } diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/TabbedConfigsTab.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/TabbedConfigsTab.kt index 75df1e912..0b17a90ed 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/TabbedConfigsTab.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/TabbedConfigsTab.kt @@ -38,6 +38,10 @@ import org.apache.commons.io.monitor.FileAlterationListener import org.apache.commons.io.monitor.FileAlterationMonitor import org.apache.commons.io.monitor.FileAlterationObserver import org.apache.logging.log4j.kotlin.cachedLoggerOf +import java.awt.datatransfer.DataFlavor +import java.awt.dnd.DnDConstants +import java.awt.dnd.DropTarget +import java.awt.dnd.DropTargetDropEvent import java.awt.event.MouseAdapter import java.awt.event.MouseEvent import java.io.File @@ -88,6 +92,29 @@ class TabbedConfigsTab( } + tabs.dropTarget = object : DropTarget() { + override fun drop(event: DropTargetDropEvent) { + val transferable = event?.transferable ?: return + if (!event.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { + return + } + val files : List + + try { + event.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE) + files = transferable.getTransferData(DataFlavor.javaFileListFlavor) as List + } catch (e: Exception) { + return + } + + for (file in files) { + if (file.name.endsWith(".conf", ignoreCase = true)) { + loadConfig(file) + } + } + } + } + val lastLoadedConfigs = guiProps.getGuiProperty("lastloaded") if (!lastLoadedConfigs.isNullOrBlank()) { val configs = if (lastLoadedConfigs.contains(",")) { diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/InclusionsEditor.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/InclusionsEditor.kt index ed5a741ae..55e5e03c9 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/InclusionsEditor.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/InclusionsEditor.kt @@ -32,6 +32,7 @@ import net.miginfocom.swing.MigLayout import org.apache.logging.log4j.kotlin.cachedLoggerOf import java.awt.BorderLayout import java.awt.Dimension +import java.awt.datatransfer.DataFlavor import java.awt.event.MouseAdapter import java.awt.event.MouseEvent import java.io.File @@ -194,6 +195,9 @@ class InclusionsEditor( inclusionList.selectionMode = ListSelectionModel.SINGLE_SELECTION inclusionList.cellRenderer = InclusionSpecificationRenderer() inclusionList.addListSelectionListener { event -> selectionOccurred(event) } + inclusionList.dropMode = DropMode.INSERT + inclusionList.transferHandler = InclusionsListHandler(this) + leftPanel.add(listScroller, BorderLayout.CENTER) selectedInclusionDetailsScrollPanel.text = Translations.createserverpack_gui_inclusions_editor_tip_default.toString() expertInclusionSettingsPanel.isVisible = false @@ -219,7 +223,7 @@ class InclusionsEditor( rightPanel.add(sourceSelect, "cell 2 0") rightPanel.add(expertInclusionSettingsPanel, "cell 1 1 2 4, grow, w 50:50:, h 150:200:, hidemode 3") rightPanel.add(selectedInclusionDetailsScrollPanel, "cell 1 1 2 4, grow, w 50:50:, h 150:200:, hidemode 3") - //rightPanel.add(inclusionsSelection, "cell 3 0") + rightPanel.add(inclusionsRevert, "cell 3 2") rightPanel.add(inclusionsReset, "cell 3 3") source.addDocumentListener(sourceListener) @@ -507,13 +511,13 @@ class InclusionsEditor( */ @Suppress("SameParameterValue") private fun addEntry(entry: String) { - addEntry(InclusionSpecification(entry)) + addEntry(createInclusionSpec(File(entry))) } /** * @author Griefed */ - private fun addEntry(entry: InclusionSpecification) { + fun addEntry(entry: InclusionSpecification) { inclusionModel.addElement(entry) inclusionList.selectedIndex = inclusionList.lastVisibleIndex if (inclusionList.model.size == 1) { @@ -593,7 +597,7 @@ class InclusionsEditor( /** * @author Griefed */ - private fun createInclusionSpec(sourceFile: File): InclusionSpecification { + fun createInclusionSpec(sourceFile: File): InclusionSpecification { return if (sourceFile.path.startsWith(configEditor.getModpackDirectory())) { val cleaned = sourceFile.path.replace(configEditor.getModpackDirectory() + File.separator, "") InclusionSpecification(cleaned) @@ -647,4 +651,35 @@ class InclusionsEditor( "autocomplete.${exclusionFilter.identifier}", exclusionSuggestions.joinToString(",") { entry -> entry.trim { it <= ' ' } }.trim { it <= ' ' }) } + + class InclusionsListHandler(private val editor: InclusionsEditor): TransferHandler() { + override fun canImport(support: TransferSupport): Boolean { + if (!support.isDrop) { + return false + } + return support.isDataFlavorSupported(DataFlavor.javaFileListFlavor) + } + + override fun importData(support: TransferSupport): Boolean { + if (!canImport(support)) { + return false + } + + val transferable = support.transferable + val files: List + try { + files = transferable.getTransferData(DataFlavor.javaFileListFlavor) as List + } catch (e: Exception) { + return false + } + + val inclSpecs = files.map { editor.createInclusionSpec(it) } + + for (spec in inclSpecs) { + editor.addEntry(spec) + } + + return true + } + } } \ No newline at end of file diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/SelectedInclusionDetails.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/SelectedInclusionDetails.kt index 68a56730c..ab538fdff 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/SelectedInclusionDetails.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/SelectedInclusionDetails.kt @@ -70,14 +70,16 @@ class SelectedInclusionDetails( menu.add(addToWhitelist) textPane.addMouseListener(object: MouseAdapter() { override fun mouseClicked(e: MouseEvent) { - val selection = inclusionList.selectedValue + if (inclusionList.valueIsAdjusting) { + return + } if (inclusionList.isSelectionEmpty) { return } if (!SwingUtilities.isRightMouseButton(e)) { return } - when (selection.source) { + when (inclusionList.selectedValue.source) { "mods" -> { if (textPane.selectedText.isNullOrEmpty()) { addToExclusions.isEnabled = false diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/GlobalSettings.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/GlobalSettings.kt index 36450a039..5c33adac9 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/GlobalSettings.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/GlobalSettings.kt @@ -54,7 +54,7 @@ class GlobalSettings( private val homeIcon = StatusIcon(guiProps, Translations.settings_global_home_tooltip.toString()) private val homeLabel = ElementLabel(Translations.settings_global_home_label.toString()) - private val homeSetting = ScrollTextFileField(guiProps, apiProperties.homeDirectory.absoluteFile, changeListener) + private val homeSetting = ScrollTextFileField(guiProps, apiProperties.homeDirectory.absoluteFile, FileFieldDropType.FOLDER, changeListener) private val homeRevert = BalloonTipButton(null, guiProps.revertIcon, Translations.settings_revert.toString(), guiProps) { homeSetting.file = apiProperties.homeDirectory } private val homeReset = BalloonTipButton(null, guiProps.resetIcon,Translations.settings_reset.toString(), guiProps) { homeSetting.file = apiProperties.home } private val homeChoose = BalloonTipButton(null, guiProps.folderIcon,Translations.settings_select_directory.toString(), guiProps) { @@ -87,7 +87,7 @@ class GlobalSettings( private val serverPacksIcon = StatusIcon(guiProps, Translations.settings_global_serverpacks_tooltip.toString()) private val serverPacksLabel = ElementLabel(Translations.settings_global_serverpacks_label.toString()) - private val serverPacksSetting = ScrollTextFileField(guiProps, apiProperties.serverPacksDirectory.absoluteFile, changeListener) + private val serverPacksSetting = ScrollTextFileField(guiProps, apiProperties.serverPacksDirectory.absoluteFile, FileFieldDropType.FOLDER, changeListener) private val serverPacksRevert = BalloonTipButton(null, guiProps.revertIcon, Translations.settings_revert.toString(), guiProps) { serverPacksSetting.file = apiProperties.serverPacksDirectory } private val serverPacksReset = BalloonTipButton(null, guiProps.resetIcon,Translations.settings_reset.toString(), guiProps) { serverPacksSetting.file = apiProperties.defaultServerPacksDirectory() } private val serverPacksChoose = BalloonTipButton(null, guiProps.folderIcon,Translations.settings_select_directory.toString(), guiProps) { diff --git a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/WebserviceSettings.kt b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/WebserviceSettings.kt index 5f7086ecf..4d282bca1 100644 --- a/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/WebserviceSettings.kt +++ b/serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/settings/WebserviceSettings.kt @@ -94,7 +94,7 @@ class WebserviceSettings( private val logDirectoryIcon = StatusIcon(guiProps,Translations.settings_webservice_tomcat_logs_tooltip.toString()) private val logDirectoryLabel = ElementLabel(Translations.settings_webservice_tomcat_logs_label.toString()) - private val logDirectorySetting = ScrollTextFileField(guiProps,apiProperties.tomcatLogsDirectory.absoluteFile, documentChangeListener) + private val logDirectorySetting = ScrollTextFileField(guiProps,apiProperties.tomcatLogsDirectory.absoluteFile, FileFieldDropType.FOLDER, documentChangeListener) private val logDirectoryRevert = BalloonTipButton(null, guiProps.revertIcon,Translations.settings_revert.toString(), guiProps) { logDirectorySetting.file = apiProperties.tomcatLogsDirectory.absoluteFile } private val logDirectoryReset = BalloonTipButton(null, guiProps.resetIcon,Translations.settings_reset.toString(), guiProps) { logDirectorySetting.file = apiProperties.defaultTomcatLogsDirectory().absoluteFile } private val logDirectoryChoose = BalloonTipButton(null, guiProps.folderIcon,Translations.settings_select_directory.toString(), guiProps) { @@ -113,7 +113,7 @@ class WebserviceSettings( private val baseDirIcon = StatusIcon(guiProps,Translations.settings_webservice_tomcat_dir_tooltip.toString()) private val baseDirLabel = ElementLabel(Translations.settings_webservice_tomcat_dir_label.toString()) - private val baseDirSetting = ScrollTextFileField(guiProps,apiProperties.tomcatBaseDirectory.absoluteFile, documentChangeListener) + private val baseDirSetting = ScrollTextFileField(guiProps,apiProperties.tomcatBaseDirectory.absoluteFile, FileFieldDropType.FOLDER, documentChangeListener) private val baseDirRevert = BalloonTipButton(null, guiProps.revertIcon,Translations.settings_revert.toString(), guiProps) { baseDirSetting.file = apiProperties.tomcatBaseDirectory.absoluteFile } private val baseDirReset = BalloonTipButton(null, guiProps.resetIcon,Translations.settings_reset.toString(), guiProps) { baseDirSetting.file = apiProperties.defaultTomcatBaseDirectory().absoluteFile } private val baseDirChoose = BalloonTipButton(null, guiProps.folderIcon,Translations.settings_select_directory.toString(), guiProps) {