org.eclipse.swt.widgets.Table.getBackground()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中org.eclipse.swt.widgets.Table.getBackground()方法的一些代码示例,展示了Table.getBackground()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getBackground()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getBackground

Table.getBackground介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

  1. public Color getBackground () {
  2. // This method must be overridden otherwise, in a TableTree in which the first
  3. // item has no sub items, a grey (Widget background colour) square will appear in
  4. // the first column of the first item.
  5. // It is not possible in the constructor to set the background of the TableTree
  6. // to be the same as the background of the Table because this interferes with
  7. // the TableTree adapting to changes in the System color settings.
  8. return table.getBackground();
  9. }
  10. public Rectangle getClientArea () {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

  1. @Override
  2. public Color getBackground () {
  3. // This method must be overridden otherwise, in a TableTree in which the first
  4. // item has no sub items, a grey (Widget background colour) square will appear in
  5. // the first column of the first item.
  6. // It is not possible in the constructor to set the background of the TableTree
  7. // to be the same as the background of the Table because this interferes with
  8. // the TableTree adapting to changes in the System color settings.
  9. return table.getBackground();
  10. }
  11. @Override

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

  1. @Override
  2. public Color getBackground () {
  3. // This method must be overridden otherwise, in a TableTree in which the first
  4. // item has no sub items, a grey (Widget background colour) square will appear in
  5. // the first column of the first item.
  6. // It is not possible in the constructor to set the background of the TableTree
  7. // to be the same as the background of the Table because this interferes with
  8. // the TableTree adapting to changes in the System color settings.
  9. return table.getBackground();
  10. }
  11. @Override

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

  1. @Override
  2. public Color getBackground () {
  3. // This method must be overridden otherwise, in a TableTree in which the first
  4. // item has no sub items, a grey (Widget background colour) square will appear in
  5. // the first column of the first item.
  6. // It is not possible in the constructor to set the background of the TableTree
  7. // to be the same as the background of the Table because this interferes with
  8. // the TableTree adapting to changes in the System color settings.
  9. return table.getBackground();
  10. }
  11. @Override

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

  1. @Override
  2. public Color getBackground () {
  3. // This method must be overridden otherwise, in a TableTree in which the first
  4. // item has no sub items, a grey (Widget background colour) square will appear in
  5. // the first column of the first item.
  6. // It is not possible in the constructor to set the background of the TableTree
  7. // to be the same as the background of the Table because this interferes with
  8. // the TableTree adapting to changes in the System color settings.
  9. return table.getBackground();
  10. }
  11. @Override

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

  1. /**
  2. * Creates a label which will display the key binding to expand
  3. * the search results.
  4. *
  5. * @param parent parent composite with {@link GridLayout}
  6. * @return the created label
  7. */
  8. public Label createInfoLabel(Composite parent) {
  9. infoLabel = new Label(parent, SWT.NONE);
  10. infoLabel.setFont(parent.getFont());
  11. infoLabel.setForeground(grayColor);
  12. infoLabel.setBackground(table.getBackground());
  13. GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  14. gd.horizontalAlignment = SWT.RIGHT;
  15. gd.grabExcessHorizontalSpace = false;
  16. infoLabel.setLayoutData(gd);
  17. updateInfoLabel();
  18. return infoLabel;
  19. }

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

  1. /**
  2. * Returns the receiver's background color.
  3. *
  4. * @return the background color
  5. *
  6. * @exception SWTException <ul>
  7. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  8. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  9. * </ul>
  10. *
  11. * @since 2.0
  12. */
  13. public Color getBackground () {
  14. checkWidget ();
  15. if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
  16. return background != null ? background : parent.getBackground ();
  17. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

  1. Color _getBackground () {
  2. long /*int*/ [] ptr = new long /*int*/ [1];
  3. OS.gtk_tree_model_get (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, ptr, -1);
  4. if (ptr [0] == 0) return parent.getBackground ();
  5. GdkColor gdkColor = new GdkColor ();
  6. OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
  7. OS.gdk_color_free (ptr [0]);
  8. return Color.gtk_new (display, gdkColor);
  9. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

  1. Color _getBackground () {
  2. int /*long*/ [] ptr = new int /*long*/ [1];
  3. OS.gtk_tree_model_get (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, ptr, -1);
  4. if (ptr [0] == 0) return parent.getBackground ();
  5. GdkColor gdkColor = new GdkColor ();
  6. OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
  7. OS.gdk_color_free (ptr [0]);
  8. return Color.gtk_new (display, gdkColor);
  9. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

  1. Color _getBackground () {
  2. int /*long*/ [] ptr = new int /*long*/ [1];
  3. OS.gtk_tree_model_get (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, ptr, -1);
  4. if (ptr [0] == 0) return parent.getBackground ();
  5. GdkColor gdkColor = new GdkColor ();
  6. OS.memmove (gdkColor, ptr [0], GdkColor.sizeof);
  7. OS.gdk_color_free (ptr [0]);
  8. return Color.gtk_new (display, gdkColor);
  9. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

  1. /**
  2. * Returns the receiver's background color.
  3. *
  4. * @return the background color
  5. *
  6. * @exception SWTException <ul>
  7. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  8. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  9. * </ul>
  10. *
  11. * @since 2.0
  12. */
  13. public Color getBackground () {
  14. checkWidget ();
  15. if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
  16. if (background == -1) return parent.getBackground ();
  17. return Color.win32_new (display, background);
  18. }

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

  1. /**
  2. * Returns the receiver's background color.
  3. *
  4. * @return the background color
  5. *
  6. * @exception SWTException <ul>
  7. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  8. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  9. * </ul>
  10. */
  11. public Color getBackground() {
  12. checkWidget ();
  13. // TODO [rst] Replace with local index field access
  14. if( !parent.checkData( this, parent.indexOf( this ) ) ) {
  15. error( SWT.ERROR_WIDGET_DISPOSED );
  16. }
  17. Color result;
  18. if( background == null ) {
  19. result = parent.getBackground();
  20. } else {
  21. result = background;
  22. }
  23. return result;
  24. }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

  1. private Color computeDashLineColor() {
  2. Color fg= fTable.getForeground();
  3. int fGray= (int)(0.3*fg.getRed() + 0.59*fg.getGreen() + 0.11*fg.getBlue());
  4. Color bg= fTable.getBackground();
  5. int bGray= (int)(0.3*bg.getRed() + 0.59*bg.getGreen() + 0.11*bg.getBlue());
  6. int gray= (int)((fGray + bGray) * 0.66);
  7. return new Color(fDisplay, gray, gray, gray);
  8. }

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

  1. private Color computeDashLineColor() {
  2. Color fg= fTable.getForeground();
  3. int fGray= (int)(0.3*fg.getRed() + 0.59*fg.getGreen() + 0.11*fg.getBlue());
  4. Color bg= fTable.getBackground();
  5. int bGray= (int)(0.3*bg.getRed() + 0.59*bg.getGreen() + 0.11*bg.getBlue());
  6. int gray= (int)((fGray + bGray) * 0.66);
  7. return new Color(fDisplay, gray, gray, gray);
  8. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  1. private Color computeDashLineColor() {
  2. Color fg= fTable.getForeground();
  3. int fGray= (int)(0.3*fg.getRed() + 0.59*fg.getGreen() + 0.11*fg.getBlue());
  4. Color bg= fTable.getBackground();
  5. int bGray= (int)(0.3*bg.getRed() + 0.59*bg.getGreen() + 0.11*bg.getBlue());
  6. int gray= (int)((fGray + bGray) * 0.66);
  7. return new Color(fDisplay, gray, gray, gray);
  8. }

代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui

  1. private Color computeDashLineColor() {
  2. Color fg= fTable.getForeground();
  3. int fGray= (int)(0.3*fg.getRed() + 0.59*fg.getGreen() + 0.11*fg.getBlue());
  4. Color bg= fTable.getBackground();
  5. int bGray= (int)(0.3*bg.getRed() + 0.59*bg.getGreen() + 0.11*bg.getBlue());
  6. int gray= (int)((fGray + bGray) * 0.66);
  7. return new Color(fDisplay, gray, gray, gray);
  8. }

代码示例来源:origin: com.diffplug.durian/durian-swt

  1. this.setBackground(table.getBackground());
  2. rowHeight = table.getItemHeight();
  3. itemCount = table.getItemCount();

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

  1. IWorkbenchPreferenceConstants.USE_COLORED_LABELS)) {
  2. boldStyle = new TextStyle(boldFont, null, null);
  3. grayColor = resourceManager.createColor(ColorUtil.blend(table.getBackground().getRGB(),
  4. table.getForeground().getRGB()));
  5. } else {

代码示例来源:origin: org.eclipse.egit/ui

  1. Color bg = rawTable.getBackground();
  2. RGB dimmedForegroundRgb = ColorUtil.blend(fg.getRGB(), bg.getRGB(), 60);

相关文章

Table类方法