| Summary: | [JavaScript-Bridging] Background and Foreground color | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Tom Seidel <tom.seidel> | ||||||
| Component: | Mylyn | Assignee: | Tom Seidel <tom.seidel> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | robert.munteanu, salever | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 1.6.0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Tom Seidel
Created attachment 184954 [details]
Patch with two new commands for setting the colors
I tested the patch, and it works. Here is BackgroundAction:
public class BackgroundAction extends AbstractCommandWrapper {
public BackgroundAction(HtmlComposer composer) {
super("Background", IAction.AS_CHECK_BOX, composer);
//Missing icon...
}
@Override
protected Command getWrappedCommand() {
return new SetBackgroundColorCommand();
}
public void run() {
ColorDialog dialog = new ColorDialog(this.composer.getShell());
RGB rgb = dialog.open();
if (rgb != null) {
((SetBackgroundColorCommand) getWrappedCommand()).setColor(rgb);
super.run();
}
}
}
(In reply to comment #2) > I tested the patch, and it works. Here is BackgroundAction: > > public class BackgroundAction extends AbstractCommandWrapper { > > public BackgroundAction(HtmlComposer composer) { > super("Background", IAction.AS_CHECK_BOX, composer); > //Missing icon... > } > > @Override > protected Command getWrappedCommand() { > return new SetBackgroundColorCommand(); > } > > public void run() { > > ColorDialog dialog = new ColorDialog(this.composer.getShell()); > RGB rgb = dialog.open(); > if (rgb != null) { > ((SetBackgroundColorCommand) getWrappedCommand()).setColor(rgb); > super.run(); > } > } > > } ((SetBackgroundColorCommand) getWrappedCommand()).setColor(rgb); should be ((SetBackgroundColorCommand) wrappedCommand).setColor(rgb); I tested the demo at http://ckeditor.com/demo Under MAC OS, default browser Safari ,version 5.0.2, set background and foreground color works well. And with Firefox 3.6.13, set background and foreground color also works well. But using CKEditor in RCP in MAC, set foreground color command behaves like set background color command. I have tested this and can reproduce the problem. There seems to be a problem with the ColorDialog in this scenario. This is not a problem of the HtmlComposer but rather a problem of SWT. I have posted already on the SWT Newsgroup with a reproducable snippet, see http://www.eclipse.org/forums/index.php/t/217160/ You have to provide your own colorchooser dialog in the action to work around this problem, the commands are working like expected. Closing this as fixed and pushing it to the repository. Created attachment 198936 [details]
mylyn/context/zip
|