Created
July 29, 2012 19:24
-
-
Save andytill/3201278 to your computer and use it in GitHub Desktop.
JavaFX controller implementing IdentifiableController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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