This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 224752 - unable to change element or attribute ref from design view
Summary: unable to change element or attribute ref from design view
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xsd (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Keith Chong CLA
QA Contact: Keith Chong CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-28 19:53 EDT by Amy Wu CLA
Modified: 2008-04-04 15:05 EDT (History)
2 users (show)

See Also:
for.work.things: review+


Attachments
Apply to org.eclipse.wst.xsd.ui (14.09 KB, patch)
2008-04-01 15:30 EDT, Keith Chong CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Amy Wu CLA 2008-03-28 19:53:07 EDT
using wtp 3.0 m6 I20080328145129

1. create a complex type
2. add element ref
3. click on the element ref combo box and browse for existing element
4. select something and then hit ok.

you end up with the following in the log:
org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3766)
	at org.eclipse.swt.SWT.error(SWT.java:3684)
	at org.eclipse.swt.SWT.error(SWT.java:3655)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:462)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:335)
	at org.eclipse.swt.custom.CCombo.getSelectionIndex(CCombo.java:712)
	at org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ADTComboBoxCellEditor.applyEditorValueAndDeactivate(ADTComboBoxCellEditor.java:302)
	at org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ADTComboBoxCellEditor$2.widgetSelected(ADTComboBoxCellEditor.java:169)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)

same thing also happens if you select New instead of Browse..

For both cases, the element ref you want is not used.  You can set the element ref from the properties view fine though.
Also same problem if you try attribute ref as well.
Comment 1 Amy Wu CLA 2008-03-31 14:58:53 EDT
i meant to open this on the xsd component, not wsdl.
Comment 2 Nitin Dahyabhai CLA 2008-04-01 15:02:09 EDT
Keith, be sure to attach the patch and have it reviewed by someone before releasing it.  Test well.
Comment 3 Keith Chong CLA 2008-04-01 15:09:15 EDT
This probelm is caused by a change in behaviour to the custom SWT widget CCombo which broke our customized code.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=142981

Their change deactivates the CCombo asynchronously.

When the user selects Browse... or New... from our custom combo box cell editor, the appropriate Browse/New dialog appears.  This takes focus away from the CCombo and subsequently gets deactivated and disposed.   When the user is clicks OK from the Browse/New dialog, the custom cell editor is supposed to apply the editor value and deactivate.  Unfortunately, by this time, the cell editor/combobox has already been deactivated and disposed.
Comment 4 Keith Chong CLA 2008-04-01 15:30:19 EDT
Created attachment 94419 [details]
Apply to org.eclipse.wst.xsd.ui
Comment 5 Amy Wu CLA 2008-04-02 10:55:34 EDT
fix looks good.
Comment 6 Keith Chong CLA 2008-04-02 15:26:51 EDT
Thanks Amy for reviewing this.  Released for 3.0 M6.
Comment 7 Amy Wu CLA 2008-04-03 16:51:32 EDT
verified for wtp3.0M6 20080403100029-sdk
Comment 8 Valentin Baciu CLA 2008-04-04 15:05:20 EDT
Closing.