Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Creating a custom control and viewer(Some tips for creating a custom control)
Creating a custom control and viewer [message #635276] Tue, 26 October 2010 09:03 Go to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Hello,

I am currently creating a custom SWT control. Its purpose is a bit similar to a table but it is more graphically oriented than simply text in a row. In fact, each element is represented by an image. Some properties of the element are displayed (as text) below the image and above the image you have the name of the element. Furthermore, some icons are displayed on top of the image representing some state of the element.

So, the control is in fact turned into a list of graphical elements presenting quite some information for each of them.

I have more or less an idea how to implement this custom control in SWT but I would like to have a mechanism similar as the JFace viewers to wrap the custom control.

But for that part, I am a bit lost because the information to display is much more than a simple text and a simple image.

Does anybody have some tips on how I can implement something like that ?
Thanks
Re: Creating a custom control and viewer [message #635447 is a reply to message #635276] Tue, 26 October 2010 19:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Sounds like the Gallery Widget from Nebula.

Tom

Am 26.10.10 11:03, schrieb Cedric:
> Hello,
>
> I am currently creating a custom SWT control. Its purpose is a bit
> similar to a table but it is more graphically oriented than simply text
> in a row. In fact, each element is represented by an image. Some
> properties of the element are displayed (as text) below the image and
> above the image you have the name of the element. Furthermore, some
> icons are displayed on top of the image representing some state of the
> element.
>
> So, the control is in fact turned into a list of graphical elements
> presenting quite some information for each of them.
>
> I have more or less an idea how to implement this custom control in SWT
> but I would like to have a mechanism similar as the JFace viewers to
> wrap the custom control.
> But for that part, I am a bit lost because the information to display is
> much more than a simple text and a simple image.
> Does anybody have some tips on how I can implement something like that ?
> Thanks
Re: Creating a custom control and viewer [message #635498 is a reply to message #635447] Wed, 27 October 2010 07:02 Go to previous messageGo to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Hello Tom,

Thanks for your answer. In fact, no it's not really like the Gallery from Nebula (I downloaded it to have an example of a custom control).
It is something very specific to my needs: it is something similar as you see in roleplaying video games. You have a list of characters represented by their images, the name of the character on top of the image and some properties of the character below the image (like attacks, defenses, skills, ...) displayed as text. Then, on the image itself you have some icons representing the effects that are currently affecting them. And probably next to the image would be a bar representing the hit points of the character.
I am doing this on a spare time project in order to improve my skills in SWT/JFace (I'm really interested in learning more on how to create custom controls).

So, the gallery widget from Nebula is not a match for my requirements here. Maybe the use of Viewer is unnecessary here, but I will anyway need some kind of controller. I liked the Viewer approach because it automatically manages the changes in the model and the user has only to write a label provider and a content provider.
Of course here the case is much more complex since an entry in my widget is made of several elements.

I was wondering which approach to take in order to handle this problem. I'm not looking for a full solution, only advices on what is a good approach for this (as I said, my main concern is to learn how to do this properly).
Re: Creating a custom control and viewer [message #1220408 is a reply to message #635498] Wed, 11 December 2013 14:47 Go to previous message
Paul Ramsden is currently offline Paul RamsdenFriend
Messages: 84
Registered: February 2011
Location: BW, Germany
Member
Hi Cedric

did you find a solution to this? I'm looking for something similar. I want to display a list of multi-line objects - preferably linked to an observable list.

Paul
Previous Topic:TitleAreaDialog in a XWT file
Next Topic:Can I add Button to Coolbar
Goto Forum:
  


Current Time: Thu Apr 25 16:36:57 GMT 2024

Powered by FUDForum. Page generated in 0.03574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top