Skip to content

Instantly share code, notes, and snippets.

@MwBakker
Last active May 29, 2019 17:30
Show Gist options
  • Save MwBakker/113259a842844f47112546476d2fde70 to your computer and use it in GitHub Desktop.
Save MwBakker/113259a842844f47112546476d2fde70 to your computer and use it in GitHub Desktop.
// adds the component
// checks if category is new
public void addComponent()
{
if (newCategoryObsv.get())
{
executor.execute(() ->
{
componentRepository.insertComponent(rackID, processNewCategoryInput(), uiComponent.nameObsv.get(), uiComponent.codeObsv.get(),
uiComponent.getImgPath(), 0);
});
}
else
{
componentRepository.getAllComponentCategories().observe(owner, componentCategories ->
{
componentRepository.insertComponent(rackID, componentCategories.get(categoryListPosition.get()).getID(), uiComponent.nameObsv.get(),
uiComponent.codeObsv.get(), uiComponent.getImgPath(), 0);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment