Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 279349

Summary: [CSS] Control's background does not change if a gradient was previously applied
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED WORKSFORME QA Contact: Bogdan Gheorghe <gheorghe>
Severity: normal    
Priority: P3    
Version: 0.9   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard: stalebug

Description Remy Suen CLA 2009-06-06 09:05:14 EDT
Press the button to change the shell's background colour, nothing will happen. What is our strategy in terms of cleaning up styles (in this case, removing the gradient listener from the control)?

------------

final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new GridLayout());

String style = "Shell { background-color: #202020 #373737 60% ";

new Button(shell, SWT.PUSH).addSelectionListener(new SelectionAdapter() {
	public void widgetSelected(SelectionEvent e) {
		String style2 = "Shell { background-color: black ";

		CSSEngine engine = new CSSSWTEngineImpl(display);

		engine.setErrorHandler(new CSSErrorHandler() {
			public void error(Exception e) {
				e.printStackTrace();
			}
		});

		try {
			engine.parseStyleSheet(new StringReader(style2));
			engine.applyStyles(shell, true);
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
});

CSSEngine engine = new CSSSWTEngineImpl(display);

engine.setErrorHandler(new CSSErrorHandler() {
	public void error(Exception e) {
		e.printStackTrace();
	}
});

try {
	engine.parseStyleSheet(new StringReader(style));
	engine.applyStyles(shell, true);
} catch (IOException e) {
	e.printStackTrace();
	return;
}

shell.setSize(400, 300);
shell.open();

while (!shell.isDisposed()) {
	if (!display.readAndDispatch())
		display.sleep();
}
display.dispose();
Comment 1 Eclipse Genie CLA 2019-04-19 15:06:25 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Lars Vogel CLA 2019-06-05 07:27:05 EDT
This is a mass change to close all e4 bugs marked with "stalebug" whiteboard.

If this bug is still valid, please reopen and remove the "stalebug" keyword.