private void initColumnInfos() { if (0 < getComponentCount()) { _lastColumnHeightBeforeSetColums = getColumnHeight(); } /////////////////////////////////////////////////////// // Nicely prevents repaint problems when selecting // the right mouse menu "Check all columns for SQL-SELECT clause", // see also setVisble(true) below setVisible(false); // ///////////////////////////////////////////////////// removeAll(); GridBagConstraints gbc; setBackground(GraphTextAreaFactory.TEXTAREA_BG); for (int i = 0; i < _columnInfoModel.getColCount(); i++) { ColumnInfo columnInfo = _columnInfoModel.getOrderedColAt(i); gbc = new GridBagConstraints( 0, i, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0); add(new QueryColumnPanel(_plugin, _tableName, columnInfo, _dndCallback, _session), gbc); } gbc = new GridBagConstraints( 0, _columnInfoModel.getColCount(), 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0); JPanel dist = new JPanel(); dist.setBackground(GraphTextAreaFactory.TEXTAREA_BG); add(dist, gbc); setVisible(true); addToAllKidComponents(_mouseListenerPx); }
public void setColumnInfoModel(ColumnInfoModel columnInfoModel) { _columnInfoModel = columnInfoModel; _columnInfoModel.addColumnInfoModelListener( new ColumnInfoModelListener() { @Override public void columnInfosChanged(TableFramesModelChangeType changeType) { if (TableFramesModelChangeType.COLUMN_SORTING == changeType || TableFramesModelChangeType.COLUMN_SELECT_ALL == changeType || TableFramesModelChangeType.COLUMN_WHERE_ALL == changeType) { initColumnInfos(); } } }); initColumnInfos(); }
@Override public int getMaxWidth() { return ((QueryColumnPanel) getComponent(0)).getMaxWidth(_columnInfoModel.getAll()); }