本文整理了Java中org.eclipse.swt.widgets.TableColumn.addControlListener()
方法的一些代码示例,展示了TableColumn.addControlListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.addControlListener()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.TableColumn
类名称:TableColumn
方法名:addControlListener
[英]Adds the listener to the collection of listeners who will be notified when the control is moved or resized, by sending it one of the messages defined in the ControlListener
interface.
[中]将侦听器添加到侦听器集合中,当控件被移动或调整大小时,将通过向其发送ControlListener
界面中定义的消息之一,通知这些侦听器。
代码示例来源:origin: org.codehaus.openxma/xmartserver
/**
* Adds a column to the TableLayoutManager. If you add a column to a managed table after calling
* {@link #manageTable}, you have to call this method to inform the TableLayoutManager about the
* new column.
* @param column index of the new column in the SWT-Table.
*/
public void addColumn(int column) {
float[] newpercent = new float[percent.length+1];
System.arraycopy(percent,0,newpercent,0,column);
newpercent[column]=-1;
System.arraycopy(percent,column,newpercent,column+1,percent.length-column);
percent = newpercent;
int[] newint = new int[min.length+1];
System.arraycopy(min,0,newint,0,column);
newint[column]=defaultMinWidth;
System.arraycopy(min,column,newint,column+1,min.length-column);
min = newint;
newint = new int[max.length+1];
System.arraycopy(max,0,newint,0,column);
newint[column]=defaultMaxWidth;
System.arraycopy(max,column,newint,column+1,max.length-column);
max = newint;
newint = new int[absolut.length+1];
System.arraycopy(absolut,0,newint,0,column);
newint[column]=defaultAbsolutWidth;
System.arraycopy(absolut,column,newint,column+1,absolut.length-column);
absolut = newint;
table.getColumn(column).addControlListener(this);
}
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Adds a column to the TableLayoutManager. If you add a column to a managed table after calling
* {@link #manageTable}, you have to call this method to inform the TableLayoutManager about the
* new column.
* @param column index of the new column in the SWT-Table.
*/
public void addColumn(int column) {
float[] newpercent = new float[percent.length+1];
System.arraycopy(percent,0,newpercent,0,column);
newpercent[column]=-1;
System.arraycopy(percent,column,newpercent,column+1,percent.length-column);
percent = newpercent;
int[] newint = new int[min.length+1];
System.arraycopy(min,0,newint,0,column);
newint[column]=defaultMinWidth;
System.arraycopy(min,column,newint,column+1,min.length-column);
min = newint;
newint = new int[max.length+1];
System.arraycopy(max,0,newint,0,column);
newint[column]=defaultMaxWidth;
System.arraycopy(max,column,newint,column+1,max.length-column);
max = newint;
newint = new int[absolut.length+1];
System.arraycopy(absolut,0,newint,0,column);
newint[column]=defaultAbsolutWidth;
System.arraycopy(absolut,column,newint,column+1,absolut.length-column);
absolut = newint;
table.getColumn(column).addControlListener(this);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
/**
* Resize column to the preferred size.
*/
@Override
public void resizeColumnsToPreferredSize() {
if (!fIsCreated) {
return;
}
fTableViewer.resizeColumnsToPreferredSize();
if (!fIsShowAddressColumn) {
final TableColumn column = fTableViewer.getTable().getColumn(0);
column.addControlListener(new ControlListener() {
@Override
public void controlMoved(ControlEvent e) {
}
@Override
public void controlResized(ControlEvent e) {
column.removeControlListener(this);
column.setWidth(0);
}
});
}
}
代码示例来源:origin: anb0s/LogViewer
TableColumn[] columns= table.getColumns();
for (int i= 0; i < columns.length; i++) {
columns[i].addControlListener(resizer);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Sets the zero based index of the column of the cell being tracked by this editor.
*
* @param column the zero based index of the column of the cell being tracked by this editor
*/
public void setColumn(int column) {
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
resize();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
resize();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Sets the zero based index of the column of the cell being tracked by this editor.
*
* @param column the zero based index of the column of the cell being tracked by this editor
*/
public void setColumn(int column) {
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
resize();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
resize();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Sets the zero based index of the column of the cell being tracked by this editor.
*
* @param column the zero based index of the column of the cell being tracked by this editor
*/
public void setColumn(int column) {
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
resize();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
resize();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Sets the zero based index of the column of the cell being tracked by this editor.
*
* @param column the zero based index of the column of the cell being tracked by this editor
*/
public void setColumn(int column) {
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
resize();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
resize();
}
/**
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Sets the zero based index of the column of the cell being tracked by this editor.
*
* @param column the zero based index of the column of the cell being tracked by this editor
*/
public void setColumn(int column) {
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
resize();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
resize();
}
/**
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/**
* Sets the zero based index of the column of the cell being tracked by this editor.
*
* @param column the zero based index of the column of the cell being tracked by this editor
*/
public void setColumn(int column) {
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
resize();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
resize();
}
/**
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
public void setColumn(int column) {
Table table = tableTree.getTable();
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
layout();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
layout();
}
public void setItem (TableTreeItem item) {
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
public void setColumn(int column) {
Table table = tableTree.getTable();
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
layout();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
layout();
}
public void setItem (TableTreeItem item) {
代码示例来源:origin: org.codehaus.openxma/xmartserver
/**
* Attaches the TableLayoutManager to an SWT-Table. From this time on, the column widths are controled by
* the TableLayoutManager.
* @param table to manage
* @param take defines which layout information should be calculated from the current width of the columns.
* possible values: {@link #PERCENT}, {@link #SCALEDPERCENT}, {@link #MIN}, {@link #MAX}, {@link #ABSOLUT}. These value may be ored
* together to take more information.
*/
public void manageTable(Table table,int take) {
if(this.table!=null) { // remove from old table if any
this.table.removeControlListener(this);
for(int i=0,size=this.table.getColumnCount();i<size;i++) {
this.table.getColumn(i).removeControlListener(this);
}
}
this.table=table;
this.table.addControlListener(this);
for(int i=0,size=this.table.getColumnCount();i<size;i++) {
this.table.getColumn(i).addControlListener(this);
}
recalcLayoutInfoFromTable(take);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
public void setColumn(int column) {
Table table = tableTree.getTable();
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
layout();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
layout();
}
public void setItem (TableTreeItem item) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
public void setColumn(int column) {
Table table = tableTree.getTable();
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
layout();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
layout();
}
public void setItem (TableTreeItem item) {
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Attaches the TableLayoutManager to an SWT-Table. From this time on, the column widths are controled by
* the TableLayoutManager.
* @param table to manage
* @param take defines which layout information should be calculated from the current width of the columns.
* possible values: {@link #PERCENT}, {@link #SCALEDPERCENT}, {@link #MIN}, {@link #MAX}, {@link #ABSOLUT}. These value may be ored
* together to take more information.
*/
public void manageTable(Table table,int take) {
if(this.table!=null) { // remove from old table if any
this.table.removeControlListener(this);
for(int i=0,size=this.table.getColumnCount();i<size;i++) {
this.table.getColumn(i).removeControlListener(this);
}
}
this.table=table;
this.table.addControlListener(this);
for(int i=0,size=this.table.getColumnCount();i<size;i++) {
this.table.getColumn(i).addControlListener(this);
}
recalcLayoutInfoFromTable(take);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
public void setColumn(int column) {
Table table = tableTree.getTable();
int columnCount = table.getColumnCount();
// Separately handle the case where the table has no TableColumns.
// In this situation, there is a single default column.
if (columnCount == 0) {
this.column = (column == 0) ? 0 : -1;
layout();
return;
}
if (this.column > -1 && this.column < columnCount){
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.removeControlListener(columnListener);
this.column = -1;
}
if (column < 0 || column >= table.getColumnCount()) return;
this.column = column;
TableColumn tableColumn = table.getColumn(this.column);
tableColumn.addControlListener(columnListener);
layout();
}
public void setItem (TableTreeItem item) {
代码示例来源:origin: inspectIT/inspectIT
column.addControlListener(columnResizeListener);
内容来源于网络,如有侵权,请联系作者删除!