Package org.opt4j.config.visualization
Class FileOperations
- java.lang.Object
-
- org.opt4j.config.visualization.FileOperations
-
public class FileOperations extends Object
TheFileOperations
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FileOperations.FileOperationsListener
-
Field Summary
Fields Modifier and Type Field Description protected File
file
protected FileChooser
fileChooser
protected Set<FileOperations.FileOperationsListener>
listeners
protected ModuleRegister
moduleRegister
protected SelectedModules
selectedModules
-
Constructor Summary
Constructors Constructor Description FileOperations(ModuleRegister moduleRegister, SelectedModules selectedModules, FileChooser fileChooser)
Constructs aFileOperations
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(FileOperations.FileOperationsListener listener)
Adds a listener.File
getFile()
Returns the current file.void
load()
Opens the file chooser for loading the current configuration file.void
load(File file)
Loads the selected modules from the specified file.void
removeListener(FileOperations.FileOperationsListener listener)
Removes a listener.void
save()
Saves the current selected modules to the current file.void
save(File file)
Saves the current selected modules to the specified file.void
saveAs()
Opens the file chooser for saving the current configuration file.protected void
setFile(File file)
Sets the current file
-
-
-
Field Detail
-
file
protected File file
-
fileChooser
protected final FileChooser fileChooser
-
moduleRegister
protected final ModuleRegister moduleRegister
-
selectedModules
protected final SelectedModules selectedModules
-
listeners
protected final Set<FileOperations.FileOperationsListener> listeners
-
-
Constructor Detail
-
FileOperations
@Inject public FileOperations(ModuleRegister moduleRegister, SelectedModules selectedModules, FileChooser fileChooser)
Constructs aFileOperations
.- Parameters:
moduleRegister
- all available modulesselectedModules
- all selected modulesfileChooser
- the FileChooser
-
-
Method Detail
-
setFile
protected void setFile(File file)
Sets the current file- Parameters:
file
- the current file- See Also:
getFile()
-
getFile
public File getFile()
Returns the current file.- Returns:
- the current file
- See Also:
setFile(java.io.File)
-
load
public void load()
Opens the file chooser for loading the current configuration file.
-
saveAs
public void saveAs()
Opens the file chooser for saving the current configuration file.
-
load
public void load(File file)
Loads the selected modules from the specified file.- Parameters:
file
- the configuration file
-
save
public void save()
Saves the current selected modules to the current file.
-
save
public void save(File file)
Saves the current selected modules to the specified file.- Parameters:
file
- the configuration file
-
addListener
public void addListener(FileOperations.FileOperationsListener listener)
Adds a listener.- Parameters:
listener
- the listener to add- See Also:
removeListener(org.opt4j.config.visualization.FileOperations.FileOperationsListener)
-
removeListener
public void removeListener(FileOperations.FileOperationsListener listener)
Removes a listener.- Parameters:
listener
- the listener to remove- See Also:
addListener(org.opt4j.config.visualization.FileOperations.FileOperationsListener)
-
-