private Composite createFontPreviewControl() { fontSampler = new Canvas(previewComposite, SWT.NONE); GridLayout gridLayout = new GridLayout(); gridLayout.marginWidth = 0; gridLayout.marginHeight = 0; fontSampler.setLayout(gridLayout); fontSampler.setLayoutData(new GridData(GridData.FILL_BOTH)); fontSampler.addPaintListener(e -> { if (currentFont != null) // do the font preview paintFontSample(e.gc); }); return fontSampler; }
public TitleRegion(Composite parent) { super(parent, SWT.NULL); titleLabel = new Label(this, SWT.WRAP); titleLabel.setVisible(false); titleCache = new SizeCache(); super.setLayout(new TitleRegionLayout()); hookHoverListeners(); addListener(SWT.Dispose, new Listener() { @Override public void handleEvent(Event e) { if (dragImage != null) { dragImage.dispose(); dragImage = null; } } }); }
private Composite createColorPreviewControl() { colorSampler = new Canvas(previewComposite, SWT.NONE); GridLayout gridLayout = new GridLayout(); gridLayout.marginWidth = 0; gridLayout.marginHeight = 0; colorSampler.setLayout(gridLayout); colorSampler.setLayoutData(new GridData(GridData.FILL_BOTH)); colorSampler.addPaintListener(e -> { if (currentColor != null) // do the color preview paintColorSample(e.gc); }); return colorSampler; }
public TitleRegion(Composite parent) { super(parent, SWT.NULL); titleLabel = new Label(this, SWT.WRAP); titleLabel.setVisible(false); titleCache = new SizeCache(); super.setLayout(new TitleRegionLayout()); hookHoverListeners(); addListener(SWT.Dispose, e -> { if (dragImage != null) { dragImage.dispose(); dragImage = null; } }); }
canvas.setLayout(new Layout() {
super.setLayout(new FormHeadingLayout()); titleRegion = new TitleRegion(this);
canvas.setLayout(new FillLayout());
super.setLayout(new FormHeadingLayout()); titleRegion = new TitleRegion(this);
if ((expansionStyle & TITLE_BAR) != 0) setBackgroundMode(SWT.INHERIT_DEFAULT); super.setLayout(new ExpandableLayout()); if (hasTitleBar()) { this.addPaintListener(new PaintListener() {
super.setLayout(null); setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE)); setBackgroundMode(SWT.INHERIT_FORCE);
if ((expansionStyle & TITLE_BAR) != 0) setBackgroundMode(SWT.INHERIT_DEFAULT); super.setLayout(new ExpandableLayout()); if (hasTitleBar()) { this.addPaintListener(e -> {