Skip to content

Instantly share code, notes, and snippets.

@andytill
Created July 29, 2012 19:24
Show Gist options
  • Save andytill/3201278 to your computer and use it in GitHub Desktop.
Save andytill/3201278 to your computer and use it in GitHub Desktop.
JavaFX controller implementing IdentifiableController
import javafx.fxml.FXML;
import javafx.scene.Parent;
@FXMLLoadingScoped
public class ListBuilderController<T> implements IdentifiableController {
@FXML
private Parent root;
@Override
public String getId() {
return getParentId(root);
}
private String getParentId(Parent parent) {
if(parent.getId() != null && !"Content".equals(parent.getId())) {
return parent.getId();
}
else {
return getParentId(parent.getParent());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment