java.lang.Object
org.autogui.swing.util.SettingsWindow.FileDialogManager
- Enclosing class:
SettingsWindow
a shared dialog, can be obtained by
SettingsWindow.getFileDialogManager().
The dialog has an accessory which manages history of selected files-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JPanelprotected SettingsWindow.FileBackActionprotected JComponentprotected JFileChooserprotected SettingsWindow.FileListModelprotected List<SettingsWindow.FileDialogManagerListener> protected intprotected SettingsWindow.FileListRemoveActionprotected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFileListPath(Path path) voidvoidprotected ComponentdialogComponent(Component sender) intvoidinit()voidvoidvoidvoidvoidvoidvoidvoidsetAccessory(JComponent accessory) voidsetBackButtonPath(Path path) voidvoidsetFieList(List<Path> ps) protected voidsetFileListWithLimit(List<Path> ps, boolean alwaysSet) voidsetMaxHistoryList(int maxHistoryList) showConfirmDialogIfOverwriting(JComponent sender, Path p) showOpenDialog(Component sender, JComponent accessory) showSaveDialog(Component sender, JComponent accessory, String defaultName) void
-
Field Details
-
fileChooser
-
historyList
-
historyListModel
-
accessory
-
backAction
-
removeAction
-
setDirByUser
protected boolean setDirByUser -
settingDirBySystem
protected int settingDirBySystem -
maxHistoryList
protected int maxHistoryList -
extraAccessory
-
listeners
-
-
Constructor Details
-
FileDialogManager
public FileDialogManager()
-
-
Method Details
-
setCurrentPath
-
addListener
-
removeListener
-
showOpenDialog
-
dialogComponent
-
showSaveDialog
-
showConfirmDialogIfOverwriting
-
getFileChooser
-
init
public void init() -
initFileChooser
public void initFileChooser() -
initFileChooserAfter
public void initFileChooserAfter() -
initHistory
public void initHistory() -
initAccessory
public void initAccessory() -
initPopup
public void initPopup() -
setAccessory
-
selectList
-
getPathFromFileChooserFileOrNull
- Parameters:
file- the file returned byJFileChooser.getCurrentDirectory()orJFileChooser.getSelectedFile(),including special directories like "PC" (My Computer). Those dirs cannot be transformed to Path objects. The method checks and returns null for those dirs .- Returns:
- a file path of the arg, or null
- Since:
- 1.8
-
currentDirectoryChanged
-
updateListModel
public void updateListModel() -
setFieList
-
setFileListWithLimit
-
addFileListPath
-
setBackButtonPath
-
setMaxHistoryList
public void setMaxHistoryList(int maxHistoryList) -
getMaxHistoryList
public int getMaxHistoryList()
-