Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321935 - ToggleButtonRidget - setOutputOnly(...) interferes with setSelected()
Summary: ToggleButtonRidget - setOutputOnly(...) interferes with setSelected()
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: communication (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.0.0.M2   Edit
Assignee: Elias Volanakis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 20:14 EDT by Elias Volanakis CLA
Modified: 2010-10-29 06:18 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Volanakis CLA 2010-08-05 20:14:04 EDT
Due to a hack introduced to fix Bug 271762 we have the following undesired behavior: if the toggle-button-ridget is output-only and state change via setSelected(boolean) will be blocked. Output-only should only block changes from the user (i.e. UI) and not interfere with programmatic API calls. Fixing.

Note: the fix slightly modifies the semantics of setSelected(...) but since the broken/unexpected behavior was not specified in the javadoc, I consider it an implementation detail.

Test case:

	public void testSetSelectedOnOutputOnlyCheckboxChangesState() {
		final IToggleButtonRidget ridget = getRidget();

		ridget.setOutputOnly(false);
		ridget.setSelected(false);

		assertFalse(ridget.isSelected());

		ridget.setOutputOnly(true);
		ridget.setSelected(true);

		assertTrue(ridget.isSelected());   // <--- this fails, it should be true
	}
Comment 1 Elias Volanakis CLA 2010-08-05 22:45:37 EDT
Resolved in HEAD.