本文整理了Java中org.eclipse.swt.widgets.Table.getLinesVisible()
方法的一些代码示例,展示了Table.getLinesVisible()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getLinesVisible()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getLinesVisible
[英]Returns true
if the receiver's lines are visible, and false
otherwise. Note that some platforms draw grid lines while others may draw alternating row colors.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
[中]如果接收方的行可见,则返回true
,否则返回false
。请注意,一些平台会绘制网格线,而其他平台可能会绘制交替的行颜色。
如果接收者的祖先之一不可见,或者某些其他条件使接收者不可见,则此方法可能仍然表明它被认为是可见的,即使它实际上可能没有显示。
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static void writeLinesVisible( final Table table ) throws IOException
{
JSWriter writer = JSWriter.getWriterFor( table );
Boolean newValue = Boolean.valueOf( table.getLinesVisible() );
writer.set( PROP_LINES_VISIBLE, "linesVisible", newValue, Boolean.FALSE );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
if (table.getLinesVisible()) {
cell.width--;
cell.height--;
代码示例来源:origin: org.eclipse.xtext/ui
public static int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result = table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
result += table.getGridLineWidth() * (rows - 1);
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
} catch (IllegalArgumentException ex) {}
headerVisibleButton.setSelection (table1.getHeaderVisible());
linesVisibleButton.setSelection (table1.getLinesVisible());
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
public static int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
public static int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public static int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.search
public static int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.search
public static int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
return result;
}
代码示例来源:origin: oyse/yedit
public static int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Computes the table hight hint for <code>table</code>.
*
* @param table the table to compute the height for
* @param rows the number of rows to compute the height for
* @return the height hint for <code>table</code>
*/
private int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows;
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
// TODO adjust to correct size. +4 works on windows, but not others
// return result + 4;
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Computes the table hight hint for <code>table</code>.
*
* @param table the table to compute the height for
* @param rows the number of rows to compute the height for
* @return the height hint for <code>table</code>
*/
private int getTableHeightHint(Table table, int rows) {
if (table.getFont().equals(JFaceResources.getDefaultFont()))
table.setFont(JFaceResources.getDialogFont());
int result= table.getItemHeight() * rows;
if (table.getLinesVisible())
result+= table.getGridLineWidth() * (rows - 1);
// TODO adjust to correct size. +4 works on windows, but not others
// return result + 4;
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.common.ui
public static int getTableHeightHint(Table table, int rows)
{
if (table.getFont().equals(JFaceResources.getDefaultFont()))
{
table.setFont(JFaceResources.getDialogFont());
}
int result = table.getItemHeight() * rows + table.getHeaderHeight();
if (table.getLinesVisible())
{
result += table.getGridLineWidth() * (rows - 1);
}
return result;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
public void preserveValues( final Widget widget ) {
Table table = ( Table )widget;
ControlLCAUtil.preserveValues( table );
IWidgetAdapter adapter = WidgetUtil.getAdapter( table );
adapter.preserve( PROP_HEADER_HEIGHT,
new Integer( table.getHeaderHeight() ) );
adapter.preserve( PROP_HEADER_VISIBLE,
Boolean.valueOf( table.getHeaderVisible() ) );
adapter.preserve( PROP_LINES_VISIBLE,
Boolean.valueOf( table.getLinesVisible() ) );
adapter.preserve( PROP_ITEM_HEIGHT, new Integer( table.getItemHeight() ) );
TableLCAUtil.preserveItemMetrics( table );
adapter.preserve( PROP_ITEM_COUNT, new Integer( table.getItemCount() ) );
adapter.preserve( PROP_TOP_INDEX, new Integer( table.getTopIndex() ) );
adapter.preserve( PROP_SELECTION_LISTENERS,
Boolean.valueOf( SelectionEvent.hasListener( table ) ) );
adapter.preserve( PROP_DEFAULT_COLUMN_WIDTH,
new Integer( getDefaultColumnWidth( table ) ) );
TableLCAUtil.preserveFocusIndex( table );
WidgetLCAUtil.preserveCustomVariant( table );
adapter.preserve( PROP_ALWAYS_HIDE_SELECTION,
alwaysHideSelection( table ) );
adapter.preserve( PROP_HAS_H_SCROLL_BAR, hasHScrollBar( table ) );
adapter.preserve( PROP_HAS_V_SCROLL_BAR, hasVScrollBar( table ) );
adapter.preserve( PROP_LEFT_OFFSET, getLeftOffset( table ) );
adapter.preserve( PROP_SCROLLBARS_SELECTION_LISTENER,
hasScrollBarsSelectionListener( table ) );
adapter.preserve( PROP_ENABLE_CELL_TOOLTIP,
new Boolean( CellToolTipUtil.isEnabledFor( table ) ) );
}
代码示例来源:origin: BiglySoftware/BiglyBT
public static void alternateRowBackground(TableItem item) {
if (Utils.TABLE_GRIDLINE_IS_ALTERNATING_COLOR) {
if (!item.getParent().getLinesVisible())
item.getParent().setLinesVisible(true);
return;
}
if (item == null || item.isDisposed())
return;
Color[] colors = {
Colors.getSystemColor(item.getDisplay(), SWT.COLOR_LIST_BACKGROUND),
Colors.colorAltRow
};
Color newColor = colors[item.getParent().indexOf(item) % colors.length];
if (!item.getBackground().equals(newColor)) {
item.setBackground(newColor);
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
if (!table.getLinesVisible())
table.setLinesVisible(true);
return;
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void tableMouseDown(Event event) {
if (isDisposed() || !isVisible()) return;
Point pt = new Point(event.x, event.y);
int lineWidth = table.getLinesVisible() ? table.getGridLineWidth() : 0;
TableItem item = table.getItem(pt);
if ((table.getStyle() & SWT.FULL_SELECTION) != 0) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void tableMouseDown(Event event) {
if (isDisposed() || !isVisible()) return;
Point pt = new Point(event.x, event.y);
int lineWidth = table.getLinesVisible() ? table.getGridLineWidth() : 0;
TableItem item = table.getItem(pt);
if ((table.getStyle() & SWT.FULL_SELECTION) != 0) {
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
renderProperty( table, PROP_HEADER_FOREGROUND, table.getHeaderForeground(), null );
renderProperty( table, PROP_HEADER_BACKGROUND, table.getHeaderBackground(), null );
renderProperty( table, PROP_LINES_VISIBLE, table.getLinesVisible(), false );
renderProperty( table, PROP_SORT_DIRECTION, getSortDirection( table ), DEFAULT_SORT_DIRECTION );
renderAfterItems( table, new Runnable() {
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public void preserveValues( Table table ) {
preserveProperty( table, PROP_ITEM_COUNT, table.getItemCount() );
preserveProperty( table, PROP_ITEM_HEIGHT, table.getItemHeight() );
preserveProperty( table, PROP_ITEM_METRICS, getItemMetrics( table ) );
preserveProperty( table, PROP_COLUMN_COUNT, table.getColumnCount() );
preserveProperty( table, PROP_COLUMN_ORDER, getColumnOrder( table ) );
preserveProperty( table, PROP_FIXED_COLUMNS, getFixedColumns( table ) );
preserveProperty( table, PROP_HEADER_HEIGHT, table.getHeaderHeight() );
preserveProperty( table, PROP_HEADER_VISIBLE, table.getHeaderVisible() );
preserveProperty( table, PROP_HEADER_FOREGROUND, table.getHeaderForeground() );
preserveProperty( table, PROP_HEADER_BACKGROUND, table.getHeaderBackground() );
preserveProperty( table, PROP_LINES_VISIBLE, table.getLinesVisible() );
preserveProperty( table, PROP_TOP_ITEM_INDEX, table.getTopIndex() );
preserveProperty( table, PROP_FOCUS_ITEM, getFocusItem( table ) );
preserveProperty( table, PROP_SCROLL_LEFT, getScrollLeft( table ) );
preserveProperty( table, PROP_SELECTION, getSelection( table ) );
preserveProperty( table, PROP_SORT_DIRECTION, getSortDirection( table ) );
preserveProperty( table, PROP_SORT_COLUMN, table.getSortColumn() );
preserveProperty( table, PROP_ALWAYS_HIDE_SELECTION, hasAlwaysHideSelection( table ) );
preserveProperty( table, PROP_ENABLE_CELL_TOOLTIP, CellToolTipUtil.isEnabledFor( table ) );
preserveProperty( table, PROP_CELL_TOOLTIP_TEXT, null );
}
内容来源于网络,如有侵权,请联系作者删除!