ColumnFilter.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:TableFilterFX 作者:
private void onFilterButtonClicked(MouseEvent event) {
    if (!filterPopup.isShowing()) {
        Bounds bounds = header.getBoundsInLocal();
        Bounds screenBounds = header.localToScreen(bounds);
        int lastColIndex = tableFilter.getTableView().getColumns().size() - 1;
        int thisColIndex = tableFilter.getTableView().getColumns().indexOf(column);
        double xpos;
        if (thisColIndex == lastColIndex) {
            filterPopup.setAnchorLocation(AnchorLocation.CONTENT_TOP_RIGHT);
            Bounds boundsTable = tableFilter.getTableView().getBoundsInLocal();
            Bounds screentToTable = tableFilter.getTableView().localToScreen(boundsTable);
            xpos = screentToTable.getMaxX();
        } else {
            filterPopup.setAnchorLocation(AnchorLocation.CONTENT_TOP_LEFT);
            xpos = screenBounds.getMinX();
        }
        // TODO hack to init with right width
        filterPopup.show(header.getScene().getWindow());
        filterPopup.hide();
        filterPopup.show(header, xpos, screenBounds.getMaxY());
    }
    event.consume();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号