if ( ti.getForeground().equals( dircolor ) ) { cat = ITEM_CATEGORY_TRANSFORMATION_DIRECTORY; } else { if ( ti.getForeground().equals( dircolor ) ) { cat = ITEM_CATEGORY_JOB_DIRECTORY; } else {
@Override public Color getForeground(int columnIndex) { return item.getForeground(columnIndex); }
@Override public Color getForeground(int columnIndex) { return item.getForeground(columnIndex); }
public Color getForeground(int columnIndex) { return item.getForeground(columnIndex); }
/** * * Returns the foreground color at the given column index in the receiver. * * @param index the column index * @return the foreground color * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @since 3.1 */ public Color getForeground (int index) { checkWidget (); if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED); int count = Math.max (1, parent.columnCount); if (0 > index || index > count -1) return getForeground (); if (cellForeground == null || cellForeground [index] == null) return getForeground (); return cellForeground [index]; }
/** * * Returns the foreground color at the given column index in the receiver. * * @param index the column index * @return the foreground color * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @since 3.1 */ public Color getForeground (int index) { checkWidget (); if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); int count = Math.max (1, parent.getColumnCount ()); if (0 > index || index > count -1) return getForeground (); int pixel = cellForeground != null ? cellForeground [index] : -1; return pixel == -1 ? getForeground () : Color.win32_new (display, pixel); }
/** * Recursively mark all submenues as enabled/disabled */ private void setItemEnabledRec(MenuItem item, boolean enabled) { TreeItem node = (TreeItem) item.getAttached(); if(enabled&&isMenuItemEnabled(item)) { node.setForeground(item.foreground); item.foreground=null; node.setImage(item.image); for(Iterator it=item.getItems().iterator();it.hasNext();) { setItemEnabledRec((MenuItem) it.next(), enabled); } } else if(!enabled) { if(item.foreground==null) { item.foreground=node.getForeground(); } node.setForeground(appShell.getComponent().getDisplay().getSystemColor(SWT.COLOR_GRAY)); node.setImage(getDisabledIcon(item.image)); for(Iterator it=item.getItems().iterator();it.hasNext();) { setItemEnabledRec((MenuItem) it.next(), enabled); } } }
/** * Recursively mark all submenues as enabled/disabled */ private void setItemEnabledRec(MenuItem item, boolean enabled) { TreeItem node = (TreeItem) item.getAttached(); if(enabled&&isMenuItemEnabled(item)) { node.setForeground(item.foreground); item.foreground=null; node.setImage(item.image); for(Iterator it=item.getItems().iterator();it.hasNext();) { setItemEnabledRec((MenuItem) it.next(), enabled); } } else if(!enabled) { if(item.foreground==null) { item.foreground=node.getForeground(); } node.setForeground(appShell.getComponent().getDisplay().getSystemColor(SWT.COLOR_GRAY)); node.setImage(getDisabledIcon(item.image)); for(Iterator it=item.getItems().iterator();it.hasNext();) { setItemEnabledRec((MenuItem) it.next(), enabled); } } }
/** * Sets the foreground color of the Node 1 TreeItems in column 1. */ void setCellForeground () { if (!instance.startup) { textNode1.setForeground (1, cellForegroundColor); imageNode1.setForeground (1, cellForegroundColor); } /* Set the foreground color item's image to match the foreground color of the cell. */ Color color = cellForegroundColor; if (color == null) color = textNode1.getForeground (1); TableItem item = colorAndFontTable.getItem(CELL_FOREGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }
/** * Sets the foreground color of the Node 1 TreeItems. */ void setItemForeground () { if (!instance.startup) { textNode1.setForeground (itemForegroundColor); imageNode1.setForeground (itemForegroundColor); } /* Set the foreground button's color to match the foreground color of the item. */ Color color = itemForegroundColor; if (color == null) color = textNode1.getForeground (); TableItem item = colorAndFontTable.getItem(ITEM_FOREGROUND_COLOR); Image oldImage = item.getImage(); if (oldImage != null) oldImage.dispose(); item.setImage (colorImage(color)); }
text.setForeground(item.getForeground()); text.setSelection(item.getText().length()); text.addListener (SWT.DefaultSelection, new Listener () {
text.setForeground(item.getForeground()); text.setSelection(item.getText().length()); text.addListener (SWT.DefaultSelection, new Listener () {
label.setFont(item.getFont(columnIdx)); label.setBackground(item.getBackground(columnIdx)); label.setForeground(item.getForeground(columnIdx)); return label;
if (item.getForeground() != color) { item.setForeground(color);
if (item.getForeground() != color) { item.setForeground(color);
gc.setBackground (selectionBackground); } else { fg = item.getForeground (columnIndex); gc.setBackground (item.getBackground (columnIndex)); userForeground = item.getForeground (columnIndex); gc.setBackground (selectionBackground); } else { gc.setForeground (userForeground != null ? userForeground : item.getForeground (columnIndex)); gc.setBackground (item.getBackground (columnIndex));
case ITEM_FOREGROUND_COLOR: { Color oldColor = itemForegroundColor; if (oldColor == null) oldColor = textNode1.getForeground (); colorDialog.setRGB(oldColor.getRGB()); RGB rgb = colorDialog.open(); case CELL_FOREGROUND_COLOR: { Color oldColor = cellForegroundColor; if (oldColor == null) oldColor = textNode1.getForeground (1); colorDialog.setRGB(oldColor.getRGB()); RGB rgb = colorDialog.open();
} else { gc.setBackground (item.getBackground (columnIndex)); gc.setForeground (item.getForeground (columnIndex)); } else { gc.setBackground (item.getBackground (columnIndex)); Color foreground = drawForeground != null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex); gc.setForeground (foreground);
} else { gc.setBackground (item.getBackground (columnIndex)); gc.setForeground (item.getForeground (columnIndex)); } else { gc.setBackground (item.getBackground (columnIndex)); Color foreground = drawForeground != null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex); gc.setForeground (foreground);
} else { gc.setBackground (item.getBackground (columnIndex)); gc.setForeground (item.getForeground (columnIndex)); } else { gc.setBackground (item.getBackground (columnIndex)); Color foreground = drawForeground != null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex); gc.setForeground (foreground);