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

Bug 344383

Summary: Add support for buttons of type SWT.ARROW
Product: [Technology] SWTBot Reporter: Daniel Migowski <dmigowski>
Component: SWTBotAssignee: Project Inbox <swtbot-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0.4   
Target Milestone: 2.0.5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

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