@Override protected void configureShell( Shell shell ) { super.configureShell( shell ); shell.setBackground( shell.getDisplay().getSystemColor( DIALOG_COLOR ) ); shell.setBackgroundMode( SWT.INHERIT_FORCE ); } };
if(((e.stateMask & SWT.CTRL) == SWT.CTRL) && (e.keyCode == 'f')) shell.setBackground(orig); System.out.println("Key up !!"); if(((e.stateMask & SWT.CTRL) == SWT.CTRL) && (e.keyCode == 'f')) shell.setBackground(green); System.out.println("Key down !!");
@Override public void setBackgroundColor(Color background) { mShell.setBackground(background); }
@Override protected void configureShell( Shell shell ) { super.configureShell( shell ); shell.setBackground( shell.getDisplay().getSystemColor( DIALOG_COLOR ) ); shell.setBackgroundMode( SWT.INHERIT_FORCE ); } };
@Override protected Control createContents(Composite parent) { getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); Control createDialogArea = createDialogArea(parent); return createDialogArea; }
/** * Overridden to make the shell background white. * * @param shell */ @Override protected void configureShell( Shell shell ) { super.configureShell( shell ); shell.setBackground( shell.getDisplay().getSystemColor( SWT.COLOR_WHITE ) ); shell.setBackgroundMode( SWT.INHERIT_FORCE ); }
/** * Initializes a new instance. * * @param parent the parent * @param contentHandler the content handler */ public CustomInformationControl(Shell parent, ICustomInformationControlContentHandler contentHandler) { mContentHandler = contentHandler; mShell = new Shell(parent, SWT.NO_FOCUS | SWT.ON_TOP); mShell.setLayout(new FillLayout()); Display display = mShell.getDisplay(); mShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK)); }
public void setBackground(final Color background) { this.shell.setBackgroundMode(SWT.INHERIT_DEFAULT); this.shell.setBackground(new org.eclipse.swt.graphics.Color(this.shell.getDisplay(), background.red, background.green, background.blue)); }
@Override protected Control createContents(Composite parent) { getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); initializeBounds(); return createDialogArea(parent); }
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); shell.setText("StackOverflow"); shell.setBackground(display.getSystemColor(SWT.COLOR_BLUE)); shell.setBackgroundMode(SWT.INHERIT_FORCE); new Button(shell, SWT.PUSH).setText("Button"); new Label(shell, SWT.NONE).setText("Label"); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
@Override protected Control createContents(Composite parent) { getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); initializeBounds(); return createDialogArea(parent); }
@Override public void initialize(AnimationEngine engine) { Color color = getAnimationShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW); getAnimationShell().setBackground(color); // Ensure that the background won't show on the initial display shellRegion = new Region(getAnimationShell().getDisplay()); getAnimationShell().setRegion(shellRegion); }
public void create() { super.create(); getShell().setBackground( GUIResource.getInstance().getColorWhite() ); }
Hover(Shell parent) { final Display display = parent.getDisplay(); hoverShell = new Shell(parent, SWT.NO_TRIM | SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL); hoverShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); hoverShell.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); hoverShell.addPaintListener(new PaintListener() { public void paintControl(PaintEvent pe) { pe.gc.drawText(text, hm, hm); if(!CARBON) { pe.gc.drawPolygon(getPolygon(true)); } } }); hoverShell.addMouseListener(new MouseAdapter() { public void mouseDown(MouseEvent e) { hideHover(); } }); }
/** * @param parent */ public TableTextEditor(TableCursor parent, int style) { m_shell = new Shell(parent.getShell(), SWT.TOOL); m_shell.setBounds(computeBounds(parent, style)); m_shell.setBackground(parent.getShell().getDisplay().getSystemColor(SWT.COLOR_GREEN)); FillLayout layout = new FillLayout(); layout.marginHeight = BORDER_WIDTH; layout.marginWidth = BORDER_WIDTH; m_shell.setLayout(layout); m_text = new Text(m_shell, style); m_text.setBackground(m_text.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); }
/** * Create the Shell and Label for the fake tooltip showing URLs */ private void createFakeToolTip() { fakeToolTip = new Shell(GUI.shell, SWT.ON_TOP); fakeToolTip.setLayout(LayoutShop.createFillLayout(2, 2)); fakeToolTip.setForeground(GUI.display .getSystemColor(SWT.COLOR_INFO_FOREGROUND)); fakeToolTip.setBackground(GUI.display .getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fakeToolTipLabel = new Label(fakeToolTip, SWT.NONE); fakeToolTipLabel.setForeground(GUI.display .getSystemColor(SWT.COLOR_INFO_FOREGROUND)); fakeToolTipLabel.setBackground(GUI.display .getSystemColor(SWT.COLOR_INFO_BACKGROUND)); }
public Overlay(Shell shell) { baseShell = shell; Rectangle cr = baseShell.getClientArea(); Rectangle trim = baseShell.computeTrim(cr.x, cr.y, cr.width, cr.height); offsetX = -trim.x; offsetY = -trim.y; overlayShell = new Shell(baseShell, SWT.NO_TRIM | SWT.ON_TOP); overlayShell.setBounds(baseShell.getBounds()); overlayShell.setBackground(baseShell.getDisplay().getSystemColor( SWT.COLOR_DARK_GREEN)); overlayShell.setAlpha(128); blue = new Color(baseShell.getDisplay(), 0, 0, 128); overlayShell.addPaintListener(e -> { e.gc.setForeground(blue); e.gc.setBackground(blue); for (Adornment adornment : adornments) { adornment.drawAdornment(e.gc); } }); }
protected void initializeBounds() { super.initializeBounds(); getShell().setBackground(bgColor); getShell().addListener(SWT.MouseDown, this); Rectangle r = GUI.shell.getBounds(); getShell().setLocation(r.x + 160, r.y + 160); getShell().addListener(SWT.Deactivate, this); }
/** * Creates the context information popup. This is the tooltip like overlay window. */ private void createContextInfoPopup() { if (Helper2.okToUse(fContextInfoPopup)) return; Control control= fViewer.getTextWidget(); Display display= control.getDisplay(); fContextInfoPopup= new Shell(control.getShell(), SWT.NO_TRIM | SWT.ON_TOP); fContextInfoPopup.setBackground(display.getSystemColor(SWT.COLOR_BLACK)); fContextInfoText= new StyledText(fContextInfoPopup, SWT.MULTI | SWT.READ_ONLY); Color c= fContentAssistant.getContextInformationPopupBackground(); if (c == null) c= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fContextInfoText.setBackground(c); c= fContentAssistant.getContextInformationPopupForeground(); if (c == null) c= display.getSystemColor(SWT.COLOR_INFO_FOREGROUND); fContextInfoText.setForeground(c); }
/** * Creates the context information popup. This is the tooltip like overlay window. */ private void createContextInfoPopup() { if (Helper2.okToUse(fContextInfoPopup)) return; Control control= fViewer.getTextWidget(); Display display= control.getDisplay(); fContextInfoPopup= new Shell(control.getShell(), SWT.NO_TRIM | SWT.ON_TOP); fContextInfoPopup.setBackground(display.getSystemColor(SWT.COLOR_BLACK)); fContextInfoText= new StyledText(fContextInfoPopup, SWT.MULTI | SWT.READ_ONLY); Color c= fContentAssistant.getContextInformationPopupBackground(); if (c == null) c= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fContextInfoText.setBackground(c); c= fContentAssistant.getContextInformationPopupForeground(); if (c == null) c= display.getSystemColor(SWT.COLOR_INFO_FOREGROUND); fContextInfoText.setForeground(c); }