Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Height of droplist adjustable
Height of droplist adjustable [message #406606] Fri, 26 January 2007 08:11 Go to next message
Ronald is currently offline Ronald
Messages: 68
Registered: July 2009
Member
Hi all,

Just a minor thing, which would life make a little easier though.
Is it possible to increase / set the number of items visible in a drop list
of the properties view?
Now, only 4 or 5 items are visible at the same time, but I'd like to
increase that to 10 or more.

Is there a reason for displaying only a few items at once?

I suppose somewhere a drop list JFace (?) thing is created somewhere, where
the height is set, but I can't find it.
And is it changeable by either setting a property somewhere or by inheriting
a certain class?

btw, I'm still using emf 2.2.0 v200605231736. I guess I should update one of
these days.

TIA
Ronald
Re: Height of droplist adjustable [message #406607 is a reply to message #406606] Fri, 26 January 2007 10:21 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25226
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030203020305010207060105
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ronald,

I think you'd need to create a specialized version of PropertyDescriptor
(as for when you want a customized cell editor) and use it to create a
specialized version of ExtendedComboBoxCellEditor that uses this method
of CCombo to set the number of visible items:

/**
* Sets the number of items that are visible in the drop
* down portion of the receiver's list.
*
* @param count the new number of items to be visible
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
thread that created the receiver</li>
* </ul>
*
* @since 3.0
*/
public void setVisibleItemCount (int count) {
checkWidget ();
if (count < 0) return;
visibleItemCount = count;
}

I think you'd need to override createControl to have access to the
CCombo control because comboBox is a package protected field; getControl
should return it after createControl creates it and sets it, but you
need to cast in either case. Perhaps we can make this easier to control
somehow...


Ronald wrote:
> Hi all,
>
> Just a minor thing, which would life make a little easier though.
> Is it possible to increase / set the number of items visible in a drop list
> of the properties view?
> Now, only 4 or 5 items are visible at the same time, but I'd like to
> increase that to 10 or more.
>
> Is there a reason for displaying only a few items at once?
>
> I suppose somewhere a drop list JFace (?) thing is created somewhere, where
> the height is set, but I can't find it.
> And is it changeable by either setting a property somewhere or by inheriting
> a certain class?
>
> btw, I'm still using emf 2.2.0 v200605231736. I guess I should update one of
> these days.
>
> TIA
> Ronald
>
>
>


--------------030203020305010207060105
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ronald,<br>
<br>
I think you'd need to create a specialized version of
PropertyDescriptor (as for when you want a customized cell editor) and
use it to create a specialized version of ExtendedComboBoxCellEditor
that uses this method of CCombo to set the number of visible items:<br>
<blockquote><small>/**</small><br>
<small>&nbsp;* Sets the number of items that are visible in the drop</small><br>
<small>&nbsp;* down portion of the receiver's list.</small><br>
<small>&nbsp;*</small><br>
<small>&nbsp;* @param count the new number of items to be visible</small><br>
<small>&nbsp;*</small><br>
<small>&nbsp;* @exception SWTException &lt;ul&gt;</small><br>
<small>&nbsp;*&nbsp;&nbsp;&nbsp; &lt;li&gt;ERROR_WIDGET_DISPOSED - if the receiver has
been disposed&lt;/li&gt;</small><br>
<small>&nbsp;*&nbsp;&nbsp;&nbsp; &lt;li&gt;ERROR_THREAD_INVALID_ACCESS - if not called
from the thread that created the receiver&lt;/li&gt;</small><br>
<small>&nbsp;* &lt;/ul&gt;</small><br>
<small>&nbsp;* </small><br>
<small>&nbsp;* @since 3.0</small><br>
<small>&nbsp;*/</small><br>
<small>public void setVisibleItemCount (int count) {</small><br>
<small>&nbsp;&nbsp;&nbsp; checkWidget ();</small><br>
<small>&nbsp;&nbsp;&nbsp; if (count &lt; 0) return;</small><br>
<small>&nbsp;&nbsp;&nbsp; visibleItemCount = count;</small><br>
<small>}</small><br>
</blockquote>
I think you'd need to override createControl to have access to the
CCombo control because comboBox is a package protected field;
getControl should return it after createControl creates it and sets it,
but you need to cast in either case.&nbsp; Perhaps we can make this easier
to control somehow...<br>
<br>
<br>
Ronald wrote:
<blockquote cite="midepcumf$39m$1@utils.eclipse.org" type="cite">
<pre wrap="">Hi all,

Just a minor thing, which would life make a little easier though.
Is it possible to increase / set the number of items visible in a drop list
of the properties view?
Now, only 4 or 5 items are visible at the same time, but I'd like to
increase that to 10 or more.

Is there a reason for displaying only a few items at once?

I suppose somewhere a drop list JFace (?) thing is created somewhere, where
the height is set, but I can't find it.
And is it changeable by either setting a property somewhere or by inheriting
a certain class?

btw, I'm still using emf 2.2.0 v200605231736. I guess I should update one of
these days.

TIA
Ronald


</pre>
</blockquote>
<br>
</body>
</html>

--------------030203020305010207060105--
Previous Topic:[Announce] EMF 2.3.0 I200701250200 is available
Next Topic:EMF editor as an "outilne"
Goto Forum:
  


Current Time: Tue Oct 08 07:42:05 EDT 2013

Powered by FUDForum. Page generated in 0.01466 seconds