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

Bug 369423

Summary: [FileUpload] Make FileUpload themeable (separate form the Button)
Product: [RT] RAP Reporter: Stephan Leicht Vogt <stephan.leichtvogt>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: tbuschto
Version: 1.5   
Target Milestone: 1.5 M6   
Hardware: All   
OS: All   
Whiteboard:

Description Stephan Leicht Vogt CLA 2012-01-23 11:56:23 EST
I'd like to use the FileUpload widget like the Button widget.
- Themabillity
- Mouse Events
- Context Menus

That would be perfect.
Comment 1 Tim Buschtoens CLA 2012-01-24 08:54:28 EST
FileUpload uses the Push-Button theming. That means a custom-variant could be used to theme them. (Thats just a workaround, i agree that it should be themeable). But mouse events and context menu should already work, or is there a problem with that?
Comment 2 Ivan Furnadjiev CLA 2012-02-01 06:41:31 EST
Custom variant property was not rendered for FileUpload (changed this in CVS). Now it's possible to style the FileUpload by custom variant:
FileUpload fileUpload = new FileUpload( parent, SWT.NONE );
fileUpload.setData( WidgetUtil.CUSTOM_VARIANT, "fileUpload" );
---
Button[PUSH].fileUpload {
  background-color: red;
  background-image: none;
}
Comment 3 Ralf Sternberg CLA 2012-02-01 10:26:44 EST
Apart from this possibility, I think we should provide a separate theming for the FileUpload. It's a widget of its own and re-using the Button theming was just a shortcut.
However, this brings up the same problem outlined in bug 369958 and bug 369957: there's currently no standard way of contributing when there is no extension registry.
Until this is fixed, I guess we have to live with the custom variant hack.
Comment 4 Ivan Furnadjiev CLA 2012-02-01 10:37:24 EST
(In reply to comment #3)
> However, this brings up the same problem outlined in bug 369958 and bug 369957:
> there's currently no standard way of contributing when there is no extension
> registry.
Maybe I missed something, but FileUpload (the RWT control) is a control as every other RWT controls. The only thing we need is to make it themeable widget (add FileUpload.appearances.js, FileUpload.theme.xml, FileUpload.default.css and the property definitions in the themes).
Comment 5 Ralf Sternberg CLA 2012-02-01 11:08:37 EST
Right, I mixed this up. +1 for a FileUpload element. And we need to include it in the themeable widgets list in the ThemeManager, right?
Comment 6 Ivan Furnadjiev CLA 2012-02-22 05:12:45 EST
Added a dedicated CSS elements FileUpload and FileUpload-FocusIndicator. Supported properties are the same like for the PUSH button. Default, business and fancy themes adjusted.