MCPcopy Create free account
hub / github.com/PCGen/pcgen / loadSourceSelection

Method loadSourceSelection

code/src/java/pcgen/gui2/PCGenFrame.java:484–506  ·  view source on GitHub ↗

Loads a selection of sources into PCGen asynchronously and tracks the load progress on the status bar. While sources are being loaded any calls to this method are ignored until sources are finished loading. @param sources a SourceSelectionFacade specifying the sources to load @return true if the sou

(SourceSelectionFacade sources)

Source from the content-addressed store, hash-verified

482 * @return true if the sources are loaded or are loading
483 */
484 public boolean loadSourceSelection(SourceSelectionFacade sources)
485 {
486 if (sources == null)
487 {
488 return false;
489 }
490 if (sourceLoader != null && sourceLoader.isAlive())
491 {
492 return checkSourceEquality(sources, sourceLoader.sources);
493 }
494 if (checkSourceEquality(sources, currentSourceSelection.get()))
495 {
496 return true;
497 }
498 //make sure all characters are closed before loading new sources.
499 if (closeAllCharacters())
500 {
501 sourceLoader = new SourceLoadWorker(sources, this);
502 sourceLoader.start();
503 return true;
504 }
505 return false;
506 }
507
508 private boolean checkSourceEquality(SourceSelectionFacade source1, SourceSelectionFacade source2)
509 {

Callers 7

loadCharacterFromFileMethod · 0.95
loadPartyFromFileMethod · 0.95
actionPerformedMethod · 0.80
maybeAutoLoadSourcesMethod · 0.80
maybeLoadCampaignMethod · 0.80
itemStateChangedMethod · 0.80
fireSourceLoadMethod · 0.80

Calls 4

checkSourceEqualityMethod · 0.95
closeAllCharactersMethod · 0.95
getMethod · 0.65
startMethod · 0.65

Tested by

no test coverage detected