Package com.tagtraum.beatunes
Class MediaLibraryDelegateImpl
- java.lang.Object
-
- com.tagtraum.beatunes.MediaLibraryDelegateImpl
-
- All Implemented Interfaces:
MediaLibraryUIDelegate
public class MediaLibraryDelegateImpl extends Object implements MediaLibraryUIDelegate
Media library UI delegate implementation.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description MediaLibraryDelegateImpl(BeaTunes application)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JDialog
createDatabaseRecoveryDialog()
Database recovery dialog.JDialog
createDatabaseUpdateDialog()
Database update dialog.JDialog
createRebuildSearchIndexDialog()
Full text index rebuild dialog.JDialog
createSynchronizationProgressDialog()
BeaTunes
getApplication()
String
getApplicationVersion()
Version String used for the settings table.org.hibernate.boot.MetadataSources
metadataSources(org.hibernate.boot.MetadataSources metadataSources)
Gives the delegate the chance to modify or replace the given configuration.void
showDatabaseIsCorruptDialog()
Database is corrupt-dialog.void
showDatabaseMigrationErrorMessage(Exception e)
Display error message about a failed database migration.boolean
showDatabaseRecoveryErrorMessage(Exception e)
Display error message about a failed database recovery.void
showOutOfMemoryMessage()
Shows appropriate out of memory error message.boolean
showRetryCommunicationDialog()
Makes the user aware of the fact that communication with iTunes failed and ask, whether it should be tried again.void
showSchemaEvolutionErrorMessage(Exception e)
Display error message about a failed schema evolution.void
showSchemasDontMatchMessage(String expected, String actual)
Display error message about mismatching schemas.void
showSeriousErrorMessage(Throwable t)
Shows appropriate serious error message.
-
-
-
Constructor Detail
-
MediaLibraryDelegateImpl
public MediaLibraryDelegateImpl(BeaTunes application)
-
-
Method Detail
-
getApplication
public BeaTunes getApplication()
-
createSynchronizationProgressDialog
public JDialog createSynchronizationProgressDialog()
- Specified by:
createSynchronizationProgressDialog
in interfaceMediaLibraryUIDelegate
- Returns:
- a dialog that should implement the
ProgressListener
interface, if it wants to be notified of whatever progress is being made
-
showOutOfMemoryMessage
public void showOutOfMemoryMessage()
Description copied from interface:MediaLibraryUIDelegate
Shows appropriate out of memory error message.- Specified by:
showOutOfMemoryMessage
in interfaceMediaLibraryUIDelegate
-
showSeriousErrorMessage
public void showSeriousErrorMessage(Throwable t)
Description copied from interface:MediaLibraryUIDelegate
Shows appropriate serious error message.- Specified by:
showSeriousErrorMessage
in interfaceMediaLibraryUIDelegate
- Parameters:
t
- throwable
-
showRetryCommunicationDialog
public boolean showRetryCommunicationDialog()
Description copied from interface:MediaLibraryUIDelegate
Makes the user aware of the fact that communication with iTunes failed and ask, whether it should be tried again.- Specified by:
showRetryCommunicationDialog
in interfaceMediaLibraryUIDelegate
- Returns:
- true, if communication should be retried.
-
metadataSources
public org.hibernate.boot.MetadataSources metadataSources(org.hibernate.boot.MetadataSources metadataSources)
Description copied from interface:MediaLibraryUIDelegate
Gives the delegate the chance to modify or replace the given configuration.- Specified by:
metadataSources
in interfaceMediaLibraryUIDelegate
- Parameters:
metadataSources
- hibernate configuration.- Returns:
- modified or replaced configuration
-
getApplicationVersion
public String getApplicationVersion()
Description copied from interface:MediaLibraryUIDelegate
Version String used for the settings table.- Specified by:
getApplicationVersion
in interfaceMediaLibraryUIDelegate
- Returns:
- a version string for this version of the application
-
showSchemaEvolutionErrorMessage
public void showSchemaEvolutionErrorMessage(Exception e)
Description copied from interface:MediaLibraryUIDelegate
Display error message about a failed schema evolution.- Specified by:
showSchemaEvolutionErrorMessage
in interfaceMediaLibraryUIDelegate
- Parameters:
e
- exception
-
showDatabaseMigrationErrorMessage
public void showDatabaseMigrationErrorMessage(Exception e)
Description copied from interface:MediaLibraryUIDelegate
Display error message about a failed database migration.- Specified by:
showDatabaseMigrationErrorMessage
in interfaceMediaLibraryUIDelegate
- Parameters:
e
- exception
-
createDatabaseUpdateDialog
public JDialog createDatabaseUpdateDialog()
Description copied from interface:MediaLibraryUIDelegate
Database update dialog.- Specified by:
createDatabaseUpdateDialog
in interfaceMediaLibraryUIDelegate
- Returns:
- a dialog that can be shown, while we are updating the database.
-
createRebuildSearchIndexDialog
public JDialog createRebuildSearchIndexDialog()
Description copied from interface:MediaLibraryUIDelegate
Full text index rebuild dialog.- Specified by:
createRebuildSearchIndexDialog
in interfaceMediaLibraryUIDelegate
- Returns:
- a dialog that can be shown, while we are rebuilding the full text index
-
showSchemasDontMatchMessage
public void showSchemasDontMatchMessage(String expected, String actual)
Description copied from interface:MediaLibraryUIDelegate
Display error message about mismatching schemas.- Specified by:
showSchemasDontMatchMessage
in interfaceMediaLibraryUIDelegate
- Parameters:
expected
- expected schema versionactual
- schema version
-
createDatabaseRecoveryDialog
public JDialog createDatabaseRecoveryDialog()
Description copied from interface:MediaLibraryUIDelegate
Database recovery dialog.- Specified by:
createDatabaseRecoveryDialog
in interfaceMediaLibraryUIDelegate
- Returns:
- a dialog that can be shown, while we are recovering the database.
-
showDatabaseRecoveryErrorMessage
public boolean showDatabaseRecoveryErrorMessage(Exception e)
Description copied from interface:MediaLibraryUIDelegate
Display error message about a failed database recovery.- Specified by:
showDatabaseRecoveryErrorMessage
in interfaceMediaLibraryUIDelegate
- Parameters:
e
- exception- Returns:
- true, if the user wants us to delete the database
-
showDatabaseIsCorruptDialog
public void showDatabaseIsCorruptDialog()
Description copied from interface:MediaLibraryUIDelegate
Database is corrupt-dialog. To be displayed, when we- Specified by:
showDatabaseIsCorruptDialog
in interfaceMediaLibraryUIDelegate
-
-