private void updateBgImage() { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); control.setBackgroundImage(showBgImage ? BG_PATTERN_IMAGE : null); } }
private void updateBgColor() { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); control.setBackground(bgColors[bgIndex]); } }
private void updateFgColor() { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); control.setForeground(fgColors[fgIndex]); } }
private void updateEnabled() { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); control.setEnabled(enabled); } }
private void updateVisible() { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); control.setVisible(visible); } }
private void updateFont() { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); control.setFont(font); } // Force layout if (controls.size() > 0) { Composite parent = ((Control) controls.get(0)).getParent(); parent.layout(true, true); } }
private void updateRoundedBorder( final int width, final Color color, final int topLeft, final int topRight, final int bottomRight, final int bottomLeft) { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); Object adapter = control.getAdapter(IWidgetGraphicsAdapter.class); IWidgetGraphicsAdapter gfxAdapter = (IWidgetGraphicsAdapter) adapter; gfxAdapter.setRoundedBorder(width, color, topLeft, topRight, bottomRight, bottomLeft); } }
private void updateCursor(final String selection) { Cursor cursor = null; Class swtClass = SWT.class; if (selection != null) { try { Field field = swtClass.getField(selection); int cursorStyle = field.getInt(swtClass); cursor = Display.getCurrent().getSystemCursor(cursorStyle); } catch (Exception e) { e.printStackTrace(); } } Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); control.setCursor(cursor); } }
private void updateBgGradient() { Iterator iter = controls.iterator(); while (iter.hasNext()) { Control control = (Control) iter.next(); Object adapter = control.getAdapter(IWidgetGraphicsAdapter.class); IWidgetGraphicsAdapter gfxAdapter = (IWidgetGraphicsAdapter) adapter; if (showBgGradient) { Color[] gradientColors = new Color[] { BGG_COLOR_BLUE, BGG_COLOR_GREEN, BGG_COLOR_BLUE, BGG_COLOR_GREEN, BGG_COLOR_BLUE }; int[] percents = new int[] {0, 25, 50, 75, 100}; gfxAdapter.setBackgroundGradient(gradientColors, percents); } else { gfxAdapter.setBackgroundGradient(null, null); } } }