Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344383 - Add support for buttons of type SWT.ARROW
Summary: Add support for buttons of type SWT.ARROW
Status: RESOLVED FIXED
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: 2.0.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.0.5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-30 15:31 EDT by Daniel Migowski CLA
Modified: 2011-06-21 11:02 EDT (History)
0 users

See Also:


Attachments
mylyn/context/zip (2.44 KB, application/octet-stream)
2011-06-21 11:02 EDT, Ketan Padegaonkar CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Migowski CLA 2011-04-30 15:31:44 EDT
Build Identifier: 2.0.4 0338

SWT supports the Button style SWT.ARROW. Arrow buttons do not have the PUSH style bit set, but behave similar.

Sadly, the SWTBotButton checks in its constructor if the PUSH bit is set. And there is no explicit SWTBotArrowButton. So I propose to replace SWTBotButtons constructor with this one:

	public SWTBotButton(Button button, SelfDescribing description) {
		super(button, description);   
		Assert.isTrue(SWTUtils.hasStyle(button, SWT.PUSH) || 
		              SWTUtils.hasStyle(button, SWT.ARROW), 
		              "Expecting a push or arrow button."); //$NON-NLS-1$
	}

Thanks and regards,
Daniel Migowski

PS: Sorry for not providing a patch.

Reproducible: Always
Comment 1 Daniel Migowski CLA 2011-04-30 15:33:07 EDT
Arrow buttons mean buttons that have been constructed with:

    Button b = new Button(parent, SWT.ARROW);
Comment 2 Ketan Padegaonkar CLA 2011-06-21 11:02:15 EDT
Fixed in revision 7b246a8af. It appears that arrow buttons cannot have text, so I've created another api to be able to access buttons of type SWT.ARROW to reflect this.
Comment 3 Ketan Padegaonkar CLA 2011-06-21 11:02:18 EDT
Created attachment 198341 [details]
mylyn/context/zip