Package com.tagtraum.beatunes.inspection
Class SortInspector
- java.lang.Object
-
- com.tagtraum.beatunes.inspection.Inspector
-
- com.tagtraum.beatunes.inspection.SortInspector
-
- All Implemented Interfaces:
DetailView
,View
,ApplicationComponent<BeaTunes>
- Direct Known Subclasses:
SortAlbumArtistInspector
,SortAlbumInspector
,SortArtistInspector
,SortComposerInspector
,SortNameInspector
,SortShowInspector
public abstract class SortInspector extends Inspector
Sort inspector.- Author:
- Hendrik Schreiber
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
id
protected static org.slf4j.Logger
LOG
-
Fields inherited from class com.tagtraum.beatunes.inspection.Inspector
propertyChangeSupport
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SortInspector(BeaTunes application)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected com.tagtraum.beatunes.inspection.SortInspector.SortNameNotSubstringIssue
createNotSubstringIssue(List<AudioSong> songs)
protected com.tagtraum.beatunes.inspection.SortInspector.SortNameRemovedWrongArticleIssue
createRemovedWrongArticleIssue(List<AudioSong> songs, Locale[] possibleLanguages)
protected abstract String
getCallableSolutionDescription(String sortName)
protected abstract String
getCallableSolutionProgressMessage(String sortName)
String
getCategory()
Indicates the inspection's category or grouping.protected abstract String
getInappropriateSortNameDescription(String sortName, String language)
protected abstract String
getInputDescription()
protected abstract String
getInputPrompt()
String
getPropertyName()
Indicates which property is inspected by this inspector.protected String
getRegularName(AudioSong song)
Returns the regular name (as opposed to sort name) for this sort inspector.abstract Property<String>
getRegularProperty()
protected abstract String
getSolutionClassDescription(String sortName, String originalName)
protected abstract String
getSolutionDescription(String sortName, String originalName)
protected String
getSortName(AudioSong song)
abstract Property<String>
getSortProperty()
protected String
getTrackSortName(AudioSong song)
void
inspect(InspectionProgressListener inspectionProgressListener)
Inspects the given songs for problems of a specific kind.protected void
setSortName(AudioSong song, String sortName)
-
Methods inherited from class com.tagtraum.beatunes.inspection.Inspector
addIssue, addIssues, addPropertyChangeListener, cancel, checkInterruption, clearIssues, createDisabledIcon, createIcon, getApplication, getComponent, getDescription, getFocusRoot, getIcon, getId, getInspection, getInspectionProgress, getInspectorCategory, getInspectorView, getIssueModel, getIssues, getIssues, getName, getSolution, getStatusLabel, init, isAvailable, isBeforeFirstInspection, isCancelled, isEnabled, isIndeterminateProgress, isInspecting, isPartiallyEnabled, issueCount, performInspection, performInspection, refreshLocations, removeIssue, removeIssues, removePropertyChangeListener, setApplication, setAvailable, setEnabled, setInspectionProgress, shutdown, toString
-
-
-
-
Constructor Detail
-
SortInspector
protected SortInspector(BeaTunes application)
-
-
Method Detail
-
getPropertyName
public final String getPropertyName()
Description copied from class:Inspector
Indicates which property is inspected by this inspector. This will be used when highlighting said property in views of a song that has issues.- Specified by:
getPropertyName
in classInspector
- Returns:
- property name
-
getCategory
public String getCategory()
Description copied from class:Inspector
Indicates the inspection's category or grouping. By default this returnsGENERAL
.- Overrides:
getCategory
in classInspector
- Returns:
- category, by default General
-
getRegularName
protected String getRegularName(AudioSong song)
Returns the regular name (as opposed to sort name) for this sort inspector. Implementations should return getName(), getArtist() etc.- Parameters:
song
- song- Returns:
- regular name (not sort name)
-
getSortName
protected String getSortName(AudioSong song)
- Parameters:
song
- song- Returns:
- sort name
- See Also:
getRegularName(com.tagtraum.audiokern.AudioSong)
-
getCallableSolutionDescription
protected abstract String getCallableSolutionDescription(String sortName)
-
getCallableSolutionProgressMessage
protected abstract String getCallableSolutionProgressMessage(String sortName)
-
getSolutionDescription
protected abstract String getSolutionDescription(String sortName, String originalName)
-
getSolutionClassDescription
protected abstract String getSolutionClassDescription(String sortName, String originalName)
-
getInappropriateSortNameDescription
protected abstract String getInappropriateSortNameDescription(String sortName, String language)
-
getInputDescription
protected abstract String getInputDescription()
-
getInputPrompt
protected abstract String getInputPrompt()
-
inspect
public void inspect(InspectionProgressListener inspectionProgressListener)
Description copied from class:Inspector
Inspects the given songs for problems of a specific kind. Found issues are accessible through the issues property. Implementations need to add issues usingInspector.addIssue(Issue)
. If this is a long running inspection, you might want to checkInspector.isCancelled()
every now and then and abort the inspection should the method returntrue
. Note that this method is called in a separate thread, i.e. not the event dispatch thread. You can report progress throughInspectionProgressListener.progress(Inspector, String, float)
.- Specified by:
inspect
in classInspector
- Parameters:
inspectionProgressListener
- progress listener- See Also:
Inspector.getIssues()
,Inspector.addIssue(Issue)
,Inspector.isCancelled()
-
createNotSubstringIssue
protected com.tagtraum.beatunes.inspection.SortInspector.SortNameNotSubstringIssue createNotSubstringIssue(List<AudioSong> songs)
-
-