Bug 171530 - [api] filter edit pane should be grayed out instead of set non-editable for read only filters
Summary: [api] filter edit pane should be grayed out instead of set non-editable for r...
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 2.0   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-01-24 08:05 EST by Tobias Schwarz CLA
Modified: 2008-08-13 13:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Schwarz CLA 2007-01-24 08:05:25 EST
Build ID: eclipse 3.2.1 rse1.0.1/head

Steps To Reproduce:
1. setting a filter to "not changeable"
2. open the filter property page
3. the page seems to be editable, nothing is grayed out, but you cannot select anything. 


More information:
when a filter should not be edited, the parent composite where the filter edit pane is placed in is set to non-editable.
the result is a pane that looked like it is editable, but everything is "locked".
instead of setting the parent composite non-editable, the filter edit pane should have a method 
public void setEditable(boolean editable)
where all widgets can be set to disabled when a page should not be edited.

in my special case, my own filter page uses a TabFolder.
when setting the parent composite to non-editable, i'm no longer able to switch between the tabs!!
Comment 1 Martin Oberhuber CLA 2007-01-25 06:45:24 EST
When I understand this right, this is no degradation in functionality (when the filter is read-only, changing tabs makes no sense anyway). It just doesn't look as nice as it should. Thus, setting severity minor.
Comment 2 Tobias Schwarz CLA 2007-01-25 08:02:29 EST
martin

i cannot agree with you, that this is just "not nice".

when having tabs on the filter edit page, you are no longer able to view the filter criteria when the filter is read only.
instead the dialog looks like a normal editable dialog - but nothing is "working" - i'm sure you cannot find any similar dialog in eclipse!

so i would like to have at least a "normal" priority, better "major".

the problem is not very hard to fix - there is only one filter edit pane that should implement setEditable().
i also found some comments in the RSE code "// editPane.setEditable(false);", so this method was already there!
Comment 3 Martin Oberhuber CLA 2007-01-25 08:08:29 EST
Agree regarding review of read-only filters. Still, it's not a major degradation in functionality --> NORMAL.

Dave -- before Tobias attaches a patch that doesn't match the way you want this, please comment on why you think "setEditable(false)" is greyed out.
Comment 4 Tobias Schwarz CLA 2007-01-26 04:38:13 EST
hi,
i found a way to workaround this problem:

	public class MySystemFilterEditPane extends SystemFilterStringEditPane {
	...
	public Control createContents(Composite parent) {	
		
		Composite filterComposite = new Composite(parent, SWT.NONE) {
			@Override
			public void setEnabled(boolean enabled) {
				if (enabled) super.setEnabled(enabled);
				setEditable(enabled);
			}
		};
		filterComposite.setLayout(new GridLayout(1, true));
		filterComposite.setLayoutData(new GridData(GridData.FILL_BOTH));

		fTabFolder = new TabFolder(filterComposite, SWT.NONE);
		...

the method setEditable(boolean editable) sets all neccessary controls to diabled.

this workaround seems to work fine.
Comment 5 David Dykstal CLA 2007-01-26 09:27:13 EST
The commenting out of the setEditable method is something that occurred some time ago. I will see if I can get this to work properly so Tobias won't need the workaround.
Comment 6 David Dykstal CLA 2007-02-05 23:12:45 EST
This is an API change since it involved adding a setEditable(boolean) to each subclass of SystemFilterStringEditPane.

setEditable(boolean) should enable/disable controls in the edit panel. It may use the helper method "enable(control, boolean) defined in SystemFilterStringEditPane to enable or disable its component controls.

Comment 7 Martin Oberhuber CLA 2007-02-28 08:23:08 EST
Verified with I20070223-0730
Comment 8 Martin Oberhuber CLA 2008-08-13 13:16:39 EDT
[target cleanup] 2.0 M5 was the original target milestone for this bug