Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317028 - Disabling ITextRidget with direct writing corrupts ridget
Summary: Disabling ITextRidget with direct writing corrupts ridget
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: UI (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0.0.M2   Edit
Assignee: Elias Volanakis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-16 07:31 EDT by Benno Baumgartner CLA
Modified: 2010-10-29 06:14 EDT (History)
1 user (show)

See Also:


Attachments
Snippet to reproduce bug (2.72 KB, text/plain)
2010-06-25 18:08 EDT, Elias Volanakis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2010-06-16 07:31:36 EDT
2.0.0 RC3

1. Given following snipped:
DatePickerComposite widget= UIControlsFactory.createDatePickerComposite(parent, "date"); //$NON-NLS-1$

GridData layoutData= new GridData(SWT.FILL, SWT.TOP, false, false);
widget.setLayoutData(layoutData);

final IDateTextRidget ridget= (IDateTextRidget) SwtRidgetFactory.createRidget(widget);
ridget.setDirectWriting(true);

Button button1= new Button(parent, SWT.PUSH);
button1.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
button1.setText("Enable/Disable");
button1.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent e) {
		ridget.setEnabled(!ridget.isEnabled());
	}
});

Button button2= new Button(parent, SWT.PUSH);
button2.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
button2.setText("Read/Write");
button2.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent e) {
		ridget.setOutputOnly(!ridget.isOutputOnly());
	}
});

2. Do not select a date (field shows " . . ")
3. Press Enable/Disable button
4. Press Enable/Disable button again
IS: Now the field shows "" and it is no longer possible to enter a date with the keyboard
SHOULD: Field shows " . . " and entering a date with keyboard is possible
5. Select a date with the picker
6. Press Enable/Disable button
IS: Selected date is gone
SHOULD: Selected date is shown and ridget is rendered disabled

Similar problem when changing the output only state of the ridget.

It works fine when not setting direct writing, but I need direct writing.
Comment 1 Elias Volanakis CLA 2010-06-25 18:08:54 EDT
Created attachment 172822 [details]
Snippet to reproduce bug

Reproducible.
Comment 2 Elias Volanakis CLA 2010-06-25 19:56:23 EDT
This occurred all Text*Ridgets when directWriting is enabled.

Fixed in HEAD.