{
try
{
final StatusDialog sd = getStatusDialog();
final Task task = new Task("LoadDocs", PropertyNames.EMPTY_STRING, 10);
sd.execute(this, task, resources.resLoadingSession);
task.start();
setSelectedDoc(EMPTY_SHORT_ARRAY);
Helper.setUnoPropertyValue(getModel(lstDocuments), PropertyNames.SELECTED_ITEMS, EMPTY_SHORT_ARRAY);
Helper.setUnoPropertyValue(getModel(lstDocuments), PropertyNames.STRING_ITEM_LIST, EMPTY_STRING_ARRAY);
Object view = null;
if (sessionToLoad.equals(PropertyNames.EMPTY_STRING))
{
view = Configuration.getConfigurationRoot(xMSF, CONFIG_PATH + "/DefaultSession", false);
}
else
{
view = Configuration.getConfigurationRoot(xMSF, CONFIG_PATH + "/SavedSessions", false);
view = Configuration.getNode(sessionToLoad, view);
}
CGSession session = new CGSession();
session.setRoot(settings);
session.readConfiguration(view, CONFIG_READ_PARAM);
task.setMax(session.cp_Content.cp_Documents.getSize() * 5 + 7);
task.advance(true);
if (sessionToLoad.equals(PropertyNames.EMPTY_STRING))
{
setSaveSessionName(session);
}
mount(session, task, false, sd.xControl);
checkSteps();
currentSession = sessionToLoad;
while (task.getStatus() <= task.getMax())
{
task.advance(false);
}
task.removeTaskListener(sd);
}
catch (Exception ex)
{
unexpectedError(ex);
}