本文整理了Java中org.eclipse.swt.widgets.TableColumn.getText()
方法的一些代码示例,展示了TableColumn.getText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.getText()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.TableColumn
类名称:TableColumn
方法名:getText
暂无
代码示例来源:origin: pentaho/pentaho-kettle
private String getSelectedText() {
String selection = "";
for ( int c = 1; c < table.getColumnCount(); c++ ) {
TableColumn tc = table.getColumn( c );
if ( c > 1 ) {
selection += CLIPBOARD_DELIMITER;
}
selection += tc.getText();
}
selection += Const.CR;
TableItem[] items = table.getSelection();
if ( items.length == 0 ) {
return null;
}
for ( int r = 0; r < items.length; r++ ) {
TableItem ti = items[r];
for ( int c = 1; c < table.getColumnCount(); c++ ) {
if ( c > 1 ) {
selection += CLIPBOARD_DELIMITER;
}
selection += ti.getText( c );
}
selection += Const.CR;
}
return selection;
}
代码示例来源:origin: pentaho/pentaho-kettle
int max = 0;
if ( header ) {
max = TableView.dummyGC.textExtent( tc.getText(), SWT.DRAW_TAB | SWT.DRAW_DELIMITER ).x;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
String getNameText () {
return getText ();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
String getNameText() {
return getText();
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
String getNameText () {
return getText ();
}
代码示例来源:origin: inspectIT/inspectIT
/**
* Return the names of all columns in the table. Not visible columns names will also be
* included. The order of the names will be same to the initial table column order, thus not
* reflecting the current state of the table if the columns were moved.
*
* @return List of column names.
*/
public List<String> getColumnNames() {
List<String> names = new ArrayList<>();
for (TableColumn column : tableViewer.getTable().getColumns()) {
names.add(column.getText());
}
return names;
}
代码示例来源:origin: net.anwiba.eclipse/net.anwiba.eclipse.project.dependencies
private int getSortColumnIndex(final Table table) {
final TableColumn sortColumn = table.getSortColumn();
if (sortColumn == null) {
return -1;
}
return getColumnIndex(sortColumn.getText());
}
代码示例来源:origin: net.anwiba.eclipse/net.anwiba.eclipse.project.dependencies
private int getSortColumnIndex(final Table table) {
final TableColumn sortColumn = table.getSortColumn();
if (sortColumn == null) {
return -1;
}
return getColumnIndex(sortColumn.getText());
}
代码示例来源:origin: stackoverflow.com
for (int i = 0; i < 4; i++)
{
final TableColumn column = new TableColumn(table, SWT.NONE);
column.setText("Column " + i);
column.addListener(SWT.Selection, new Listener()
{
@Override
public void handleEvent(Event arg0)
{
System.out.println(column.getText());
}
});
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* @param item
* @return
*/
private String getColumnName(Item item) {
String result = ""; //$NON-NLS-1$
if (item instanceof TableColumn) {
result = ((TableColumn) item).getText();
if (result.trim().equals("")) { //$NON-NLS-1$
result = ((TableColumn) item).getToolTipText();
}
} else if (item instanceof TreeColumn) {
result = ((TreeColumn) item).getText();
if (result.trim().equals("")) { //$NON-NLS-1$
result = ((TreeColumn) item).getToolTipText();
}
}
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* @param item
* @return
*/
private String getColumnName(Item item) {
String result = ""; //$NON-NLS-1$
if (item instanceof TableColumn) {
result = ((TableColumn) item).getText();
if (result.trim().equals("")) { //$NON-NLS-1$
result = ((TableColumn) item).getToolTipText();
}
} else if (item instanceof TreeColumn) {
result = ((TreeColumn) item).getText();
if (result.trim().equals("")) { //$NON-NLS-1$
result = ((TreeColumn) item).getToolTipText();
}
}
return result;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* @param item
* @return
*/
private String getColumnName(Item item) {
String result = ""; //$NON-NLS-1$
if (item instanceof TableColumn) {
result = ((TableColumn) item).getText();
if (result.trim().equals("")) { //$NON-NLS-1$
result = ((TableColumn) item).getToolTipText();
}
} else if (item instanceof TreeColumn) {
result = ((TreeColumn) item).getText();
if (result.trim().equals("")) { //$NON-NLS-1$
result = ((TreeColumn) item).getToolTipText();
}
}
return result;
}
代码示例来源:origin: stackoverflow.com
for ( TableColumn tableColumn : tableView.getColumns() ) {
// build label
Label label = new Label( tableColumn.getText() );
HBox lableBox = new HBox( label );
lableBox.getStyleClass().add( "labelBoxTxt" );
lableBox.setAlignment( Pos.CENTER );
// build hor line
StackPane HL = new StackPane();
HL.getStyleClass().add( "greyBorder" );
// build text field
TextField textField = new TextField();
HBox.setHgrow( textField, Priority.ALWAYS );
HBox.setMargin( textField, new Insets( 3 ) );
HBox textInputBox = new HBox( textField );
// put together
VBox vBox = new VBox( lableBox, HL, textInputBox );
tableColumn.setText( "" );
tableColumn.setGraphic( vBox );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
for( int i = 0; i < columnHolder.size(); i++ ) {
TableColumn column = columnHolder.getItem( i );
if( column.getText().contains( "\n" ) ) {
int columnTextHeight = TextSizeUtil.textExtent( headerFont, column.getText(), 0 ).y;
textHeight = Math.max( textHeight, columnTextHeight );
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
int minKeyWidth= computeWidth(table, keyColumn.getText()) + HEADER_MARGIN;
for (int i= 0; i < fModel.elements.size(); i++) {
minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.elements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
int minKeyWidth= computeWidth(table, keyColumn.getText()) + HEADER_MARGIN;
for (int i= 0; i < fModel.elements.size(); i++) {
minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.elements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
int minKeyWidth= computeWidth(table, keyColumn.getText()) + HEADER_MARGIN;
for (int i= 0; i < fModel.elements.size(); i++) {
minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.elements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
for (int i= 0; i < fModel.elements.size(); i++) {
minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.elements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
for (int i= 0; i < fModel.elements.size(); i++) {
minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.elements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
for (int i= 0; i < fModel.elements.size(); i++) {
minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.elements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
内容来源于网络,如有侵权,请联系作者删除!