本文整理了Java中javax.swing.table.TableColumn.addPropertyChangeListener()
方法的一些代码示例,展示了TableColumn.addPropertyChangeListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.addPropertyChangeListener()
方法的具体详情如下:
包路径:javax.swing.table.TableColumn
类名称:TableColumn
方法名:addPropertyChangeListener
暂无
代码示例来源:origin: stackoverflow.com
TableColumn col=table.getColumnModel().getTableColumn(colNumber);
col.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent e) {
// has the column width changed ?
}
});
代码示例来源:origin: tinyMediaManager/tinyMediaManager
private void initListeners() {
// install a listener to cause the whole table to repaint when a column is resized. we do this because the extended grid
// lines may need to be repainted. this could be cleaned up, but for now, it works fine.
PropertyChangeListener listener = createTableColumnWidthListener();
for (int i = 0; i < fTable.getColumnModel().getColumnCount(); i++) {
fTable.getColumnModel().getColumn(i).addPropertyChangeListener(listener);
}
}
代码示例来源:origin: cpesch/RouteConverter
private void addColumn(int columnIndex, TableColumn aColumn) {
if (aColumn == null) {
throw new IllegalArgumentException("Object is null");
}
tableColumns.add(columnIndex, aColumn);
aColumn.addPropertyChangeListener(this);
recalcWidthCache();
// post columnAdded event notification
fireColumnAdded(new TableColumnModelEvent(this, columnIndex, columnIndex));
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui
public void addColumn(TableColumn column) {
super.addColumn(column);
final int index = column.getModelIndex();
column.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (PROP_COLUMN_WIDTH.equals(evt.getPropertyName())) {
int oldWidth = ((Integer)evt.getOldValue()).intValue();
int newWidth = ((Integer)evt.getNewValue()).intValue();
fireColumnWidthChanged(index, oldWidth, newWidth);
}
}
});
}
代码示例来源:origin: net.sf.sfac/sfac-core
@Override
public void addColumn(TableColumn aColumn) {
// if this method is called, column number is updated from the outside.
// Most likely, a new column set is added after all previous columns have been removed.
// In this case we consider that all the columns are shown
// and we have to resynchronize with supreclass content
synchWithSuperclass();
// add the column
aColumn.removePropertyChangeListener(widthListener);
aColumn.addPropertyChangeListener(widthListener);
allColumns.add(aColumn);
hidingSelectionDialog = null;
super.addColumn(aColumn);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
revalidateScrollBar();
} else if ("treeColumnIndex".equals(evt.getPropertyName())) { // NOI18N
treeTable.getColumnModel().getColumn(((TreeTable)treeTable).getTreeColumnIndex()).addPropertyChangeListener(listener);
} else if ("column_moved".equals(evt.getPropertyName())) { // NOI18N
int from = ((Integer)evt.getOldValue()).intValue();
代码示例来源:origin: com.eas.platypus/platypus-js-forms
/**
* Constructs model column, bounded with view's column.
*
* @param aName
* @param aOnRender
* @param aOnSelect
* @param aReadOnly
* @param aView
* @param aEditor
*/
public ModelColumn(String aName, JSObject aOnRender, JSObject aOnSelect, boolean aReadOnly, ModelWidget aView, ModelWidget aEditor) {
super();
name = aName;
onRender = aOnRender;
onSelect = aOnSelect;
readOnly = aReadOnly;
view = aView;
super.setCellRenderer(aView);
editor = aEditor;
super.setCellEditor(editor);
super.setWidth(50);
tempWidth = super.getWidth();
tempMinWidth = super.getMinWidth();
tempMaxWidth = super.getMaxWidth();
tempResizable = super.getResizable();
tempMoveable = moveable;
super.addPropertyChangeListener((PropertyChangeEvent evt) -> {
changeSupport.firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
});
}
代码示例来源:origin: org.xworker/xworker_core
public static void createPropertyChangeListeners(ActionContext actionContext){
Thing self = (Thing) actionContext.get("self");
TableColumn parent = (TableColumn) actionContext.get("parent");
for(Thing child : self.getChilds()){
PropertyChangeListener obj = (PropertyChangeListener) child.doAction("create", actionContext);
if(obj != null){
parent.addPropertyChangeListener(obj);
}
}
}
代码示例来源:origin: khuxtable/seaglass
/**
* Adds striping to the background of the given {@link JTable}. The actual
* striping is installed on the containing {@link JScrollPane}'s
* {@link JViewport}, so if this table is not added to a {@code JScrollPane}
* , then no stripes will be painted. This method can be called before the
* given table is added to a scroll pane, though, as a
* {@link PropertyChangeListener} will be installed to handle "ancestor"
* changes.
*
* @param table the table to paint row stripes for.
*/
public static void setViewPortListeners(JTable table) {
table.addPropertyChangeListener("ancestor", createAncestorPropertyChangeListener(table));
// Install a listener to cause the whole table to repaint when a column
// is resized. We do this because the extended grid lines may need to be
// repainted. This could be cleaned up, but for now, it works fine.
for (int i = 0; i < table.getColumnModel().getColumnCount(); i++) {
table.getColumnModel().getColumn(i).addPropertyChangeListener(createAncestorPropertyChangeListener(table));
table.getColumnModel().addColumnModelListener(createTableColumnModelListener(table));
}
}
代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core
private void installColumn(TableColumn column) {
this.column = column;
column.addPropertyChangeListener(getColumnListener());
updateFromColumnHeader(column.getHeaderValue());
// #429-swing: actionCommand must be string
if (column.getIdentifier() != null) {
setActionCommand(column.getIdentifier().toString());
}
boolean visible = (column instanceof TableColumnExt) ?
((TableColumnExt) column).isVisible() : true;
updateFromColumnVisible(visible);
}
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
private void installColumn(TableColumn column) {
this.column = column;
column.addPropertyChangeListener(getColumnListener());
updateFromColumnHeader(column.getHeaderValue());
// #429-swing: actionCommand must be string
if (column.getIdentifier() != null) {
setActionCommand(column.getIdentifier().toString());
}
boolean visible = (column instanceof TableColumnExt) ?
((TableColumnExt) column).isVisible() : true;
updateFromColumnVisible(visible);
}
代码示例来源:origin: org.swinglabs.swingx/swingx-core
private void installColumn(TableColumn column) {
this.column = column;
column.addPropertyChangeListener(getColumnListener());
updateFromColumnHeader(column.getHeaderValue());
// #429-swing: actionCommand must be string
if (column.getIdentifier() != null) {
setActionCommand(column.getIdentifier().toString());
}
boolean visible = (column instanceof TableColumnExt) ?
((TableColumnExt) column).isVisible() : true;
updateFromColumnVisible(visible);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop
private void installColumn(TableColumn column) {
this.column = column;
column.addPropertyChangeListener(getColumnListener());
updateFromColumnHeader(column.getHeaderValue());
// #429-swing: actionCommand must be string
if (column.getIdentifier() != null) {
setActionCommand(column.getIdentifier().toString());
}
boolean visible = (column instanceof TableColumnExt) ?
((TableColumnExt) column).isVisible() : true;
updateFromColumnVisible(visible);
}
代码示例来源:origin: com.eas.platypus/platypus-js-grid
public final void setTableColumn(TableColumn aColumn) {
if (tableColumn != null) {
tableColumn.removePropertyChangeListener(columnListener);
}
if (aColumn == null && tableColumn != null) {
minWidth = tableColumn.getMinWidth();
maxWidth = tableColumn.getMaxWidth();
if (tableColumn.getHeaderValue() instanceof String) {
title = (String) tableColumn.getHeaderValue();
}
}
tableColumn = aColumn;
if (tableColumn != null) {
tableColumn.addPropertyChangeListener(columnListener);
}
}
代码示例来源:origin: org.swinglabs.swingx/swingx-all
private void installColumn(TableColumn column) {
this.column = column;
column.addPropertyChangeListener(getColumnListener());
updateFromColumnHeader(column.getHeaderValue());
// #429-swing: actionCommand must be string
if (column.getIdentifier() != null) {
setActionCommand(column.getIdentifier().toString());
}
boolean visible = (column instanceof TableColumnExt) ?
((TableColumnExt) column).isVisible() : true;
updateFromColumnVisible(visible);
}
代码示例来源:origin: com.haulmont.thirdparty/glazedlists
throw new IllegalStateException("null TableColumn objects are not allowed in EventTableColumnModel");
newColumn.addPropertyChangeListener(this);
fireColumnAdded(new TableColumnModelEvent(this, 0, getColumnCount() - 1));
newColumn.addPropertyChangeListener(this);
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15
throw new IllegalStateException("null TableColumn objects are not allowed in EventTableColumnModel");
newColumn.addPropertyChangeListener(this);
fireColumnAdded(new TableColumnModelEvent(this, 0, getColumnCount() - 1));
newColumn.addPropertyChangeListener(this);
代码示例来源:origin: com.haulmont.thirdparty/glazedlists
/**
* Creates a new model that contains the {@link TableColumn} objects from
* the given <code>source</code>. Changes to the <code>source</code> are
* reflected in this model.
*/
public EventTableColumnModel(EventList<T> source) {
setSelectionModel(createSelectionModel());
setColumnMargin(1);
invalidateWidthCache();
setColumnSelectionAllowed(false);
// lock the source list for reading since we want to prevent writes
// from occurring until we fully initialize this EventTableColumnModel
source.getReadWriteLock().readLock().lock();
try {
// ensure all of the TableColumns are non-null
for (int i = 0, n = source.size(); i < n; i++) {
if (source.get(i) == null)
throw new IllegalStateException("null TableColumn objects are not allowed in EventTableColumnModel");
}
// start listening to each of the TableColumns for property changes that may resize the table header
for (int i = 0, n = source.size(); i < n; i++)
source.get(i).addPropertyChangeListener(this);
disposeSwingThreadSource = !GlazedListsSwing.isSwingThreadProxyList(source);
swingThreadSource = disposeSwingThreadSource ? GlazedListsSwing.swingThreadProxyList(source) : (TransformedList<T, T>) source;
swingThreadSource.addListEventListener(this);
} finally {
source.getReadWriteLock().readLock().unlock();
}
}
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15
/**
* Creates a new model that contains the {@link TableColumn} objects from
* the given <code>source</code>. Changes to the <code>source</code> are
* reflected in this model.
*/
public EventTableColumnModel(EventList<T> source) {
setSelectionModel(createSelectionModel());
setColumnMargin(1);
invalidateWidthCache();
setColumnSelectionAllowed(false);
// lock the source list for reading since we want to prevent writes
// from occurring until we fully initialize this EventTableColumnModel
source.getReadWriteLock().readLock().lock();
try {
// ensure all of the TableColumns are non-null
for (int i = 0, n = source.size(); i < n; i++) {
if (source.get(i) == null)
throw new IllegalStateException("null TableColumn objects are not allowed in EventTableColumnModel");
}
// start listening to each of the TableColumns for property changes that may resize the table header
for (int i = 0, n = source.size(); i < n; i++)
source.get(i).addPropertyChangeListener(this);
disposeSwingThreadSource = !GlazedListsSwing.isSwingThreadProxyList(source);
swingThreadSource = disposeSwingThreadSource ? GlazedListsSwing.swingThreadProxyList(source) : (TransformedList<T, T>) source;
swingThreadSource.addListEventListener(this);
} finally {
source.getReadWriteLock().readLock().unlock();
}
}
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16
/**
* Creates a new model that contains the {@link TableColumn} objects from
* the given <code>source</code>. Changes to the <code>source</code> are
* reflected in this model.
*/
public EventTableColumnModel(EventList<T> source) {
setSelectionModel(createSelectionModel());
setColumnMargin(1);
invalidateWidthCache();
setColumnSelectionAllowed(false);
// lock the source list for reading since we want to prevent writes
// from occurring until we fully initialize this EventTableColumnModel
source.getReadWriteLock().readLock().lock();
try {
// ensure all of the TableColumns are non-null
for (int i = 0, n = source.size(); i < n; i++) {
if (source.get(i) == null)
throw new IllegalStateException("null TableColumn objects are not allowed in EventTableColumnModel");
}
// start listening to each of the TableColumns for property changes that may resize the table header
for (int i = 0, n = source.size(); i < n; i++)
source.get(i).addPropertyChangeListener(this);
disposeSwingThreadSource = !GlazedListsSwing.isSwingThreadProxyList(source);
swingThreadSource = disposeSwingThreadSource ? GlazedListsSwing.swingThreadProxyList(source) : (TransformedList<T, T>) source;
swingThreadSource.addListEventListener(this);
} finally {
source.getReadWriteLock().readLock().unlock();
}
}
内容来源于网络,如有侵权,请联系作者删除!