public class DefaultProjectExportController extends java.lang.Object implements ProjectExportController
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
TEMP_FOLDER_SUFFIX |
protected java.nio.file.Path |
tempFolderPath |
Constructor and Description |
---|
DefaultProjectExportController()
Instantiates a new default project export controller.
|
DefaultProjectExportController(Project project)
Instantiates a new default project export controller.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterZip(boolean success)
This callback method is called before zipping the exported project.
|
protected boolean |
beforeZip()
This callback method is called before zipping the exported project.
|
protected java.util.HashMap<java.io.File,java.lang.String> |
buildFoldersToAddHasmap()
Builds a HashMap containing the folders to be added to the installation package archive as keys and their paths inside the archive as values
|
void |
exportProject(Project project) |
void |
exportProject(Project project,
ProjectExportSettings exportSettings)
Exports the current project using the provided
ProjectExportSettings ,
and showing the user dialogs if necessary. |
void |
exportProject(Project project,
ProjectExportSettings exportSettings,
boolean showUserDialogs,
boolean useConcurrentThread)
Exports the current project using the provided
ProjectExportSettings . |
java.util.ArrayList<java.io.File> |
getAdditionalSetupFiles(java.lang.String setupName)
This method can be used to specify additional setup-related files, that should
be considered when determining which files to include when exporting projects.
|
protected ArchiveFileHandler |
getArchiveFileHandler()
Gets the archive file handler.
|
java.util.ArrayList<java.nio.file.Path> |
getDefaultExcludeList()
This method can be used to provide a list of files and folders that should
be excluded from the export by default.
|
protected ProjectExportSettings |
getExportSettings() |
protected java.util.List<javax.swing.filechooser.FileNameExtensionFilter> |
getFileNameExtensionFilters()
Provides a list of
FileNameExtensionFilter s for a JFileChooser dialog. |
protected java.util.List<java.nio.file.Path> |
getFolderCopySkipList(java.nio.file.Path sourcePath)
Gets a list of folders and files to be skipped when copying the project directory
|
javax.swing.JFileChooser |
getJFileChooser(Project project)
Creates and initialized a
JFileChooser for selecting the export target |
java.lang.String |
getMessageFailure()
Gets the text for the failure message.
|
java.lang.String |
getMessageSuccess()
Gets the text for the success message
|
protected Project |
getProject()
Gets the project.
|
ProjectExportSettings |
getProjectExportSettings(Project project)
Gets the project export settings.
|
protected java.nio.file.Path |
getProjectFolderPath()
Gets the project folder path.
|
protected java.lang.String |
getProposedFileName(Project project)
Provides a default file name for the export target.
|
protected java.nio.file.Path |
getTempExportFolderPath()
Gets the temporary export folder path
|
protected java.nio.file.Path |
getTempFolderPath()
Gets the temp folder path.
|
boolean |
isExportSuccessful()
Checks if the export was successfully finished
|
protected boolean |
isShowUserDialogs()
Checks if is show user dialogs.
|
protected SimulationSetup |
loadSimSetup(java.lang.String setupName)
Loads the simulation setup with the specified name
|
void |
setConfirmationDialogDisabled(boolean confirmationDialogEnabled)
Allows to disable the confirmation dialog independent of the progress monitor
|
void |
setMessageFailure(java.lang.String newMessageFailure)
Sets the text for the failure message.
|
void |
setMessageSuccess(java.lang.String newMessageSuccess)
Sets the text for the success message
|
protected void |
setProject(Project project)
Sets the project.
|
protected void |
updateProgressMonitor(int currentProgress)
Updates the progress monitor.
|
protected static final java.lang.String TEMP_FOLDER_SUFFIX
protected java.nio.file.Path tempFolderPath
public DefaultProjectExportController()
public DefaultProjectExportController(Project project)
project
- the projectpublic void exportProject(Project project)
public ProjectExportSettings getProjectExportSettings(Project project)
ProjectExportController
getProjectExportSettings
in interface ProjectExportController
public void exportProject(Project project, ProjectExportSettings exportSettings)
ProjectExportSettings
,
and showing the user dialogs if necessary.exportProject
in interface ProjectExportController
the
- project to be exportedexportSettings
- The ProjectExportSettings
public void exportProject(Project project, ProjectExportSettings exportSettings, boolean showUserDialogs, boolean useConcurrentThread)
ProjectExportSettings
.exportProject
in interface ProjectExportController
the
- project to be exportedexportSettings
- The ProjectExportSettings
showUserDialogs
- specifies if user dialogs are shownuseConcurrentThread
- specifies if the project should be exported in a concurrent threadpublic javax.swing.JFileChooser getJFileChooser(Project project)
JFileChooser
for selecting the export targetJFileChooser
protected java.lang.String getProposedFileName(Project project)
protected java.util.List<javax.swing.filechooser.FileNameExtensionFilter> getFileNameExtensionFilters()
FileNameExtensionFilter
s for a JFileChooser
dialog. Can be overridden by
subclasses to customize the list of available filters.FileNameExtensionFilter
sprotected ProjectExportSettings getExportSettings()
protected java.util.List<java.nio.file.Path> getFolderCopySkipList(java.nio.file.Path sourcePath)
sourcePath
- The source path (project directory)protected SimulationSetup loadSimSetup(java.lang.String setupName) throws javax.xml.bind.JAXBException, java.io.IOException
setupName
- The setup to be loadedjavax.xml.bind.JAXBException
- Parsing the setup file failedjava.io.IOException
- Reading the setup file failedprotected java.nio.file.Path getTempExportFolderPath()
protected java.util.HashMap<java.io.File,java.lang.String> buildFoldersToAddHasmap()
protected boolean beforeZip()
protected void afterZip(boolean success)
public void setMessageSuccess(java.lang.String newMessageSuccess)
setMessageSuccess
in interface ProjectExportController
newMessageSuccess
- the new text for the success messagepublic java.lang.String getMessageSuccess()
public void setMessageFailure(java.lang.String newMessageFailure)
setMessageFailure
in interface ProjectExportController
newMessageFailure
- the new text for the failure messagepublic java.lang.String getMessageFailure()
protected void updateProgressMonitor(int currentProgress)
currentProgress
- the current progressprotected ArchiveFileHandler getArchiveFileHandler()
protected Project getProject()
protected void setProject(Project project)
project
- the new projectprotected boolean isShowUserDialogs()
protected java.nio.file.Path getTempFolderPath()
public boolean isExportSuccessful()
ProjectExportController
isExportSuccessful
in interface ProjectExportController
public void setConfirmationDialogDisabled(boolean confirmationDialogEnabled)
confirmationDialogEnabled
- public java.util.ArrayList<java.io.File> getAdditionalSetupFiles(java.lang.String setupName)
ProjectExportController
getAdditionalSetupFiles
in interface ProjectExportController
setupName
- the setup namepublic java.util.ArrayList<java.nio.file.Path> getDefaultExcludeList()
ProjectExportController
getDefaultExcludeList
in interface ProjectExportController
protected java.nio.file.Path getProjectFolderPath()