/** * Set the specified foreground color for the specified control and all of * its children. Subclasses may override this method, but typically do not. * If a subclass wishes to exclude a particular control in its contents from * getting the specified foreground color, it may instead override * {@link #getForegroundColorExclusions()}. * * @param color * the color to use as the foreground color * @param control * the control whose color is to be changed * @see PopupDialog#getForegroundColorExclusions() */ protected void applyForegroundColor(Color color, Control control) { applyForegroundColor(color, control, getForegroundColorExclusions()); }
/** * Set the specified foreground color for the specified control and all of * its children. Subclasses may override this method, but typically do not. * If a subclass wishes to exclude a particular control in its contents from * getting the specified foreground color, it may instead override * {@link #getForegroundColorExclusions()}. * * @param color * the color to use as the foreground color * @param control * the control whose color is to be changed * @see PopupDialog#getForegroundColorExclusions() */ protected void applyForegroundColor(Color color, Control control) { applyForegroundColor(color, control, getForegroundColorExclusions()); }
/** * Set the specified foreground color for the specified control and all of * its children. Subclasses may override this method, but typically do not. * If a subclass wishes to exclude a particular control in its contents from * getting the specified foreground color, it may instead override * {@link #getForegroundColorExclusions()}. * * @param color * the color to use as the foreground color * @param control * the control whose color is to be changed * @see PopupDialog#getForegroundColorExclusions() */ protected void applyForegroundColor(Color color, Control control) { applyForegroundColor(color, control, getForegroundColorExclusions()); }
/** * Set the specified foreground color for the specified control and all of * its children, except for those specified in the list of exclusions. * * @param color * the color to use as the foreground color * @param control * the control whose color is to be changed * @param exclusions * a list of controls who are to be excluded from getting their * color assigned */ private void applyForegroundColor(Color color, Control control, List<Control> exclusions) { if (!exclusions.contains(control)) { control.setForeground(color); } if (control instanceof Composite) { Control[] children = ((Composite) control).getChildren(); for (int i = 0; i < children.length; i++) { applyForegroundColor(color, children[i], exclusions); } } }
/** * Set the specified foreground color for the specified control and all of * its children, except for those specified in the list of exclusions. * * @param color * the color to use as the foreground color * @param control * the control whose color is to be changed * @param exclusions * a list of controls who are to be excluded from getting their * color assigned */ private void applyForegroundColor(Color color, Control control, List<Control> exclusions) { if (!exclusions.contains(control)) { control.setForeground(color); } if (control instanceof Composite) { Control[] children = ((Composite) control).getChildren(); for (Control element : children) { applyForegroundColor(color, element, exclusions); } } }
/** * Set the specified foreground color for the specified control and all of * its children, except for those specified in the list of exclusions. * * @param color * the color to use as the foreground color * @param control * the control whose color is to be changed * @param exclusions * a list of controls who are to be excluded from getting their * color assigned */ private void applyForegroundColor(Color color, Control control, List exclusions) { if (!exclusions.contains(control)) { control.setForeground(color); } if (control instanceof Composite) { Control[] children = ((Composite) control).getChildren(); for (int i = 0; i < children.length; i++) { applyForegroundColor(color, children[i], exclusions); } } }
/** * Apply any desired color to the specified composite and its children. * * @param composite * the contents composite */ private void applyColors(Composite composite) { // The getForeground() and getBackground() methods // should not answer null, but IColorProvider clients // are accustomed to null meaning use the default, so we guard // against this assumption. Color color = getForeground(); if (color == null) color = getDefaultForeground(); applyForegroundColor(color, composite, getForegroundColorExclusions()); color = getBackground(); if (color == null) color = getDefaultBackground(); applyBackgroundColor(color, composite, getBackgroundColorExclusions()); }
/** * Apply any desired color to the specified composite and its children. * * @param composite * the contents composite */ private void applyColors(Composite composite) { // The getForeground() and getBackground() methods // should not answer null, but IColorProvider clients // are accustomed to null meaning use the default, so we guard // against this assumption. Color color = getForeground(); if (color == null) color = getDefaultForeground(); applyForegroundColor(color, composite, getForegroundColorExclusions()); color = getBackground(); if (color == null) color = getDefaultBackground(); applyBackgroundColor(color, composite, getBackgroundColorExclusions()); }
/** * Apply any desired color to the specified composite and its children. * * @param composite * the contents composite */ private void applyColors(Composite composite) { // The getForeground() and getBackground() methods // should not answer null, but IColorProvider clients // are accustomed to null meaning use the default, so we guard // against this assumption. Color color = getForeground(); if (color == null) color = getDefaultForeground(); applyForegroundColor(color, composite, getForegroundColorExclusions()); color = getBackground(); if (color == null) color = getDefaultBackground(); applyBackgroundColor(color, composite, getBackgroundColorExclusions()); }