Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ComboBoxPropertyDescriptor event handling 3.0.1
ComboBoxPropertyDescriptor event handling 3.0.1 [message #444456] |
Wed, 13 October 2004 10:58 |
Stefan Junsved Messages: 56 Registered: July 2009 |
Member |
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_001A_01C4B124.5A5BA130
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi.
I display objects in the outline tree and the 'Properties' view displays =
properties for each object selected in the outline.
In one case I want to update the tree when a combo is changed. I change =
a value from 'true' to 'false' in the combo, and
that property change should update the tree (I want to change an icon). =
This works perfectly well in Eclipse 2.1.2 but
in Eclipse 3.0.1, the behaviour has changed. Now, the value is changed =
in the combo, but no event is fired, at least not
an event that can be caught so I can perform the update of the tree. =
Instead, the descriptor is marked dirty and rests
there. When I leave the combo and marks another property or clicks =
somewhere else in the entire GUI, a focus lost
event is fired and then I can do my tree update.
I'd really appreciate some help.
/Stefan
------=_NextPart_000_001A_01C4B124.5A5BA130
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I display objects in the outline tree =
and the=20
'Properties' view displays properties for each object selected in the=20
outline.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>In one case I want to update the tree =
when a combo=20
is changed. I change a value from 'true' to 'false' in the combo,=20
and</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>that property change should update the =
tree (I want=20
to change an icon). This works perfectly well in Eclipse 2.1.2 =
but</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in Eclipse 3.0.1, the behaviour has =
changed. Now,=20
the value is changed in the combo, but no event is fired, at least=20
not</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>an event that can be caught so I can =
perform the=20
update of the tree. Instead, the descriptor is marked dirty and=20
rests</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>there. When I <STRONG>leave</STRONG> =
the combo=20
</FONT><FONT face=3DArial size=3D2>and marks another property or clicks =
somewhere=20
else in the entire GUI, a focus lost</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>event is fired and then I can do my =
tree=20
update.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'd really appreciate some =
help.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>/Stefan</FONT></DIV></BODY></HTML>
------=_NextPart_000_001A_01C4B124.5A5BA130--
|
|
|
Re: ComboBoxPropertyDescriptor event handling 3.0.1 [message #444665 is a reply to message #444456] |
Wed, 20 October 2004 07:53 |
Stefan Junsved Messages: 56 Registered: July 2009 |
Member |
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C4B68A.B99C3220
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I see no other option than to override the ComboBoxCellEditor class. In =
the createControl() method I add the applyEditorValueAndDeactivate() =
call in the widgetSelected() method, and that will bring back the =
earlier behaviour in Eclipse 2.1.2.
protected Control createControl(Composite parent) {
=20
comboBox =3D new CCombo(parent, getStyle());
comboBox.setFont(parent.getFont());
comboBox.addKeyListener(new KeyAdapter() {
// hook key pressed - see PR 14201 =20
public void keyPressed(KeyEvent e) {
keyReleaseOccured(e);
}
});
comboBox.addSelectionListener(new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent event) {
applyEditorValueAndDeactivate();
}
=20
public void widgetSelected(SelectionEvent event) {
selection =3D comboBox.getSelectionIndex();
applyEditorValueAndDeactivate();
}
});
comboBox.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
if (e.detail =3D=3D SWT.TRAVERSE_ESCAPE || e.detail =3D=3D =
SWT.TRAVERSE_RETURN) {
e.doit =3D false;
}
}
});
comboBox.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
applyEditorValueAndDeactivate();
}
});
return comboBox;
}
My suggestion is that it should be configurable how the =
ComboBoxCellEditor should work. Let the present behaviour be the =
default, and make it possible to set some kind of "forceUpdate" flag to =
enable listeners to make an immediate update when the combo value =
changes.
/Stefan
"Stefan Junsved" <stefan.junsved@comactivity.net> wrote in message =
news:ckj1es$f1e$1@eclipse.org...
Hi.
I display objects in the outline tree and the 'Properties' view =
displays properties for each object selected in the outline.
In one case I want to update the tree when a combo is changed. I =
change a value from 'true' to 'false' in the combo, and
that property change should update the tree (I want to change an =
icon). This works perfectly well in Eclipse 2.1.2 but
in Eclipse 3.0.1, the behaviour has changed. Now, the value is changed =
in the combo, but no event is fired, at least not
an event that can be caught so I can perform the update of the tree. =
Instead, the descriptor is marked dirty and rests
there. When I leave the combo and marks another property or clicks =
somewhere else in the entire GUI, a focus lost
event is fired and then I can do my tree update.
I'd really appreciate some help.
/Stefan
------=_NextPart_000_0008_01C4B68A.B99C3220
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I see no other option than to override =
the=20
ComboBoxCellEditor class. In the createControl() method I add the=20
<STRONG>applyEditorValueAndDeactivate</STRONG>() call in the <FONT=20
color=3D#0000ff>widgetSelected</FONT>() method, and that will bring back =
the=20
earlier behaviour in Eclipse 2.1.2.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>protected Control =
createControl(Composite parent)=20
{<BR> <BR> comboBox =3D new CCombo(parent,=20
getStyle());<BR> =20
comboBox.setFont(parent.getFont());</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =20
comboBox.addKeyListener(new KeyAdapter() {<BR> =20
// hook key pressed - see PR=20
14201 <BR> public =
void=20
keyPressed(KeyEvent e) =
{<BR> =20
keyReleaseOccured(e);<BR> =20
}<BR> });</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> comboBox.addSelectionListener(new =
SelectionAdapter() {<BR> public void=20
widgetDefaultSelected(SelectionEvent event)=20
{<BR> =20
applyEditorValueAndDeactivate();<BR> =20
}<BR> <BR> public void <FONT=20
color=3D#0000ff>widgetSelected</FONT>(SelectionEvent event)=20
{<BR> selection =
=3D=20
comboBox.getSelectionIndex();<BR> <STRONG> &n=
bsp;=20
=20
</STRONG><STRONG>applyEditorValueAndDeactivate</STRONG>(); <BR>  =
; =20
}<BR> });</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> comboBox.addTraverseListener(new=20
TraverseListener() {<BR> public void=20
keyTraversed(TraverseEvent e) {<BR> =20
if (e.detail =3D=3D SWT.TRAVERSE_ESCAPE || e.detail =
=3D=3D=20
SWT.TRAVERSE_RETURN) {<BR> =20
e.doit =3D=20
false;<BR> =20
}<BR> }<BR> });</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> comboBox.addFocusListener(new =
FocusAdapter()=20
{<BR> public void =
focusLost(FocusEvent e)=20
{<BR> =20
applyEditorValueAndDeactivate();<BR> =20
}<BR> });<BR> return comboBox;<BR>}<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My suggestion is that it should be =
configurable how=20
the ComboBoxCellEditor should work. Let the present behaviour be the =
default,=20
and make it possible to set some kind of "forceUpdate" flag to enable =
listeners=20
to make an immediate update when the combo value changes.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </DIV></FONT>
<DIV><FONT face=3DArial size=3D2>/Stefan</DIV></FONT>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Stefan Junsved" <<A=20
=
href=3D"mailto:stefan.junsved@comactivity.net">stefan.junsved@comactivity=
..net</A>>=20
wrote in message <A=20
=
href=3D"news:ckj1es$f1e$1@eclipse.org">news:ckj1es$f1e$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>Hi.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I display objects in the outline tree =
and the=20
'Properties' view displays properties for each object selected in the=20
outline.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>In one case I want to update the tree =
when a=20
combo is changed. I change a value from 'true' to 'false' in the =
combo,=20
and</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>that property change should update =
the tree (I=20
want to change an icon). This works perfectly well in Eclipse 2.1.2=20
but</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in Eclipse 3.0.1, the behaviour has =
changed. Now,=20
the value is changed in the combo, but no event is fired, at least=20
not</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>an event that can be caught so I can =
perform the=20
update of the tree. Instead, the descriptor is marked dirty and=20
rests</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>there. When I <STRONG>leave</STRONG> =
the combo=20
</FONT><FONT face=3DArial size=3D2>and marks another property or =
clicks somewhere=20
else in the entire GUI, a focus lost</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>event is fired and then I can do my =
tree=20
update.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'd really appreciate some =
help.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2>/Stefan</FONT></DIV></BLOCKQUOTE></BODY></HTML >
------=_NextPart_000_0008_01C4B68A.B99C3220--
|
|
|
Re: ComboBoxPropertyDescriptor event handling 3.0.1 [message #444682 is a reply to message #444665] |
Wed, 20 October 2004 14:02 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_00DF_01C4B68B.EEEF5C30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
See the following bug reports on this topic:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D41347
https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D54989
"Stefan Junsved" <stefan.junsved@comactivity.net> wrote in message =
news:cl558c$fqb$1@eclipse.org...
I see no other option than to override the ComboBoxCellEditor class. =
In the createControl() method I add the applyEditorValueAndDeactivate() =
call in the widgetSelected() method, and that will bring back the =
earlier behaviour in Eclipse 2.1.2.
protected Control createControl(Composite parent) {
=20
comboBox =3D new CCombo(parent, getStyle());
comboBox.setFont(parent.getFont());
comboBox.addKeyListener(new KeyAdapter() {
// hook key pressed - see PR 14201 =20
public void keyPressed(KeyEvent e) {
keyReleaseOccured(e);
}
});
comboBox.addSelectionListener(new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent event) {
applyEditorValueAndDeactivate();
}
=20
public void widgetSelected(SelectionEvent event) {
selection =3D comboBox.getSelectionIndex();
applyEditorValueAndDeactivate();
}
});
comboBox.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
if (e.detail =3D=3D SWT.TRAVERSE_ESCAPE || e.detail =3D=3D =
SWT.TRAVERSE_RETURN) {
e.doit =3D false;
}
}
});
comboBox.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
applyEditorValueAndDeactivate();
}
});
return comboBox;
}
My suggestion is that it should be configurable how the =
ComboBoxCellEditor should work. Let the present behaviour be the =
default, and make it possible to set some kind of "forceUpdate" flag to =
enable listeners to make an immediate update when the combo value =
changes.
/Stefan
"Stefan Junsved" <stefan.junsved@comactivity.net> wrote in message =
news:ckj1es$f1e$1@eclipse.org...
Hi.
I display objects in the outline tree and the 'Properties' view =
displays properties for each object selected in the outline.
In one case I want to update the tree when a combo is changed. I =
change a value from 'true' to 'false' in the combo, and
that property change should update the tree (I want to change an =
icon). This works perfectly well in Eclipse 2.1.2 but
in Eclipse 3.0.1, the behaviour has changed. Now, the value is =
changed in the combo, but no event is fired, at least not
an event that can be caught so I can perform the update of the tree. =
Instead, the descriptor is marked dirty and rests
there. When I leave the combo and marks another property or clicks =
somewhere else in the entire GUI, a focus lost
event is fired and then I can do my tree update.
I'd really appreciate some help.
/Stefan
------=_NextPart_000_00DF_01C4B68B.EEEF5C30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>See the following bug reports on this=20
topic:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D41347">https://bu=
gs.eclipse.org/bugs/show_bug.cgi?id=3D41347</A></FONT></DIV >
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D54989">https://bu=
gs.eclipse.org/bugs/show_bug.cgi?id=3D54989</A></FONT></DIV >
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Stefan Junsved" <<A=20
=
href=3D"mailto:stefan.junsved@comactivity.net">stefan.junsved@comactivity=
..net</A>>=20
wrote in message <A=20
=
href=3D"news:cl558c$fqb$1@eclipse.org">news:cl558c$fqb$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>I see no other option than to =
override the=20
ComboBoxCellEditor class. In the createControl() method I add the =
<STRONG>applyEditorValueAndDeactivate</STRONG>() call in the <FONT=20
color=3D#0000ff>widgetSelected</FONT>() method, and that will bring =
back the=20
earlier behaviour in Eclipse 2.1.2.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>protected Control =
createControl(Composite parent)=20
{<BR> <BR> comboBox =3D new =
CCombo(parent,=20
getStyle());<BR> =20
comboBox.setFont(parent.getFont());</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =20
comboBox.addKeyListener(new KeyAdapter() {<BR> =
// hook key pressed - see PR=20
14201 <BR> =
public void=20
keyPressed(KeyEvent e) =
{<BR> =20
keyReleaseOccured(e);<BR> =20
}<BR> });</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2> comboBox.addSelectionListener(new=20
SelectionAdapter() {<BR> public void=20
widgetDefaultSelected(SelectionEvent event)=20
{<BR> =20
applyEditorValueAndDeactivate();<BR> =20
}<BR> <BR> public void <FONT=20
color=3D#0000ff>widgetSelected</FONT>(SelectionEvent event)=20
{<BR> selection =
=3D=20
=
comboBox.getSelectionIndex();<BR> <STRONG> &n=
bsp;=20
=20
=
</STRONG><STRONG>applyEditorValueAndDeactivate</STRONG>(); <BR>  =
; =20
}<BR> });</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2> comboBox.addTraverseListener(new=20
TraverseListener() {<BR> public void=20
keyTraversed(TraverseEvent e) =
{<BR> =20
if (e.detail =3D=3D SWT.TRAVERSE_ESCAPE || e.detail =
=3D=3D=20
SWT.TRAVERSE_RETURN) {<BR> =20
e.doit =3D=20
false;<BR> =20
}<BR> }<BR> });</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> comboBox.addFocusListener(new=20
FocusAdapter() {<BR> public void=20
focusLost(FocusEvent e) {<BR> =20
=20
applyEditorValueAndDeactivate();<BR> =20
}<BR> });<BR> return comboBox;<BR>}<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My suggestion is that it should be =
configurable=20
how the ComboBoxCellEditor should work. Let the present behaviour be =
the=20
default, and make it possible to set some kind of "forceUpdate" flag =
to enable=20
listeners to make an immediate update when the combo value=20
changes.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </DIV></FONT>
<DIV><FONT face=3DArial size=3D2>/Stefan</DIV></FONT>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Stefan Junsved" <<A=20
=
href=3D"mailto:stefan.junsved@comactivity.net">stefan.junsved@comactivity=
..net</A>>=20
wrote in message <A=20
=
href=3D"news:ckj1es$f1e$1@eclipse.org">news:ckj1es$f1e$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3DArial size=3D2>Hi.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I display objects in the outline =
tree and the=20
'Properties' view displays properties for each object selected in =
the=20
outline.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>In one case I want to update the =
tree when a=20
combo is changed. I change a value from 'true' to 'false' in the =
combo,=20
and</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>that property change should update =
the tree (I=20
want to change an icon). This works perfectly well in Eclipse 2.1.2=20
but</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in Eclipse 3.0.1, the behaviour has =
changed.=20
Now, the value is changed in the combo, but no event is fired, at =
least=20
not</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>an event that can be caught so I =
can perform=20
the update of the tree. Instead, the descriptor is marked dirty and=20
rests</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>there. When I =
<STRONG>leave</STRONG> the combo=20
</FONT><FONT face=3DArial size=3D2>and marks another property or =
clicks=20
somewhere else in the entire GUI, a focus lost</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>event is fired and then I can do my =
tree=20
update.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'd really appreciate some =
help.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>/Stefan</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE> </BODY></HTML>
------=_NextPart_000_00DF_01C4B68B.EEEF5C30--
|
|
|
Goto Forum:
Current Time: Wed Apr 24 17:44:10 GMT 2024
Powered by FUDForum. Page generated in 0.06404 seconds
|