use of org.uberfire.commons.async.DescriptiveRunnable in project kie-wb-common by kiegroup.
the class ExplorerServiceHelper method store.
public void store(final WorkspaceProject project, final Module selectedModule, final FolderListing folderListing, final Package selectedPackage, final ActiveOptions options) {
final org.uberfire.java.nio.file.Path userNavPath = userServices.buildPath("explorer", "user.nav");
final org.uberfire.java.nio.file.Path lastUserNavPath = userServices.buildPath("explorer", "last.user.nav");
final Module _selectedModule = selectedModule;
final FolderItem _selectedItem = folderListing.getItem();
final org.guvnor.common.services.project.model.Package _selectedPackage;
if (selectedPackage != null) {
_selectedPackage = selectedPackage;
} else if (folderListing.getItem().getItem() instanceof Package) {
_selectedPackage = (Package) folderListing.getItem().getItem();
} else {
_selectedPackage = null;
}
this.executorService.execute(new DescriptiveRunnable() {
@Override
public String getDescription() {
return "Serialize Navigation State";
}
@Override
public void run() {
try {
store(userNavPath, lastUserNavPath, project, _selectedModule, _selectedPackage, _selectedItem, options);
} catch (final Exception e) {
LOGGER.error("Can't serialize user's state navigation", e);
}
}
});
}
use of org.uberfire.commons.async.DescriptiveRunnable in project kie-wb-common by kiegroup.
the class ExplorerServiceImpl method getFolderListing.
@Override
public FolderListing getFolderListing(final WorkspaceProject project, final Module module, final FolderItem item, final ActiveOptions options) {
// TODO: BUSINESS_CONTENT, TECHNICAL_CONTENT
final FolderListing result = helper.getFolderListing(item, options);
if (result != null) {
final org.uberfire.java.nio.file.Path userNavPath = userServices.buildPath("explorer", "user.nav");
final org.uberfire.java.nio.file.Path lastUserNavPath = userServices.buildPath("explorer", "last.user.nav");
this.executorService.execute(new DescriptiveRunnable() {
@Override
public String getDescription() {
return "Serialize Navigation State";
}
@Override
public void run() {
try {
Package pkg = null;
if (item.getItem() instanceof Package) {
pkg = (Package) item.getItem();
}
helper.store(userNavPath, lastUserNavPath, project, module, pkg, item, options);
} catch (final Exception e) {
LOGGER.error("Can't serialize user's state navigation", e);
}
}
});
}
return result;
}
Aggregations