Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » [Neon] - insert dynamic image into menu without being icons.( insert dynamic image into menu without being icons.)
[Neon] - insert dynamic image into menu without being icons. [message #1763899] Mon, 22 May 2017 17:24 Go to next message
juliano ferreira borges is currently offline juliano ferreira borgesFriend
Messages: 4
Registered: December 2016
Location: Brasil
Junior Member
Good afternoon,
I'm using Scout 6 in the neon eclipse.
I have the following problem, I need to create in the menu bar of the desktop an avatar that can be changed by the image that is saved in the database.
The abstractMenu does not allow to insert image, only icons already registered. Is there any way to load an image into a menu without being an icon?
Re: [Neon] - insert dynamic image into menu without being icons. [message #1763991 is a reply to message #1763899] Tue, 23 May 2017 17:30 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 205
Registered: November 2010
Senior Member
Hi Juliano

I did not try it, but it seems to be possible by using special iconIds that are handled by your own IIconProviderService. Have a look at this code:
https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs/blob/releases/6.0.x/code/bahbah/org.eclipsescout.demo.bahbah.client/src/main/java/org/eclipsescout/demo/bahbah/client/services/BuddyAvatarIconProviderService.java

Regards,
Beat
Re: [Neon] - insert dynamic image into menu without being icons. [message #1766708 is a reply to message #1763991] Mon, 26 June 2017 12:24 Go to previous messageGo to next message
juliano ferreira borges is currently offline juliano ferreira borgesFriend
Messages: 4
Registered: December 2016
Location: Brasil
Junior Member
Thank you for your help. Using your suggestion I was able to implement a solution.
Thanks for listening.
Re: [Neon] - insert dynamic image into menu without being icons. [message #1810823 is a reply to message #1766708] Tue, 20 August 2019 08:47 Go to previous messageGo to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi,
In my Scout application I would like to do a very similar thing: present in the desktop menu, dynamically determined avatar from a graphic file downloaded ad-hock from the Internet. I referred to the above-mentioned example BuddyAvatarIconProviderService.java, but I have the following problem with it. During desktop initialization, the icon content (using the loadLocalAvatarIconSpec method) is downloaded twice by a web browser:

  1. Initial POST request, where in the above-mentioned loadLocalAvatarIconSpec method, the ClientSession.get() call returns the session object, and thus further download of the image content is done correctly.
  2. Second GET method, where in the above-mentioned loadLocalAvatarIconSpec method, the ClientSession.get () call returns NULL, and thus the icon content cannot be read (in the session object I store information necessary to download the icon). This finally results in the avatar not being displayed in the menu.


My question:
Why does the ClientSession.get() method return NULL while handling this second GET request?
How to solve this problem?
Re: [Neon] - insert dynamic image into menu without being icons. [message #1814829 is a reply to message #1810823] Thu, 19 September 2019 10:35 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Krzysztof

I overlooked your question, because it was in an old thread. In newer Scout releases this is quite simple. Use an AbstractFormFieldMenu and place an AbstractImageField in the menu, which simply points to the URL of the image. Example code:

@ClassId("ee078d57-7f35-4f8e-9cc8-0e243a4965fe")
public class GraphicalMenu extends AbstractFormFieldMenu {

	@ClassId("e01405aa-4465-42c7-84d5-0068f33142a9")
	public class Image extends AbstractImageField {

		@Override
		protected void execInitField() {
			setImageUrl("https://img.icons8.com/color/2x/bmo.png");
		}
	}
}


See the attached image-menu.jpg for a preview.

Cheers,
André


Eclipse Scout Homepage | Documentation | GitHub
Re: [Neon] - insert dynamic image into menu without being icons. [message #1815094 is a reply to message #1814829] Wed, 25 September 2019 12:00 Go to previous message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi André,

Your solution did not work for me. No image is displayed in the menu.
Maybe because on your attachment "image-menu.jpg" I see, that you have placed the GraphicalMenu declaration in the table/form node menu, and as I wrote earlier, I need to display the image in the desktop main menu.
Previous Topic:Calling a TablePage from somewhere other than the Outline
Next Topic:How to use AbstractImageField doRotate(), etc. methods ?
Goto Forum:
  


Current Time: Fri Apr 19 14:30:36 GMT 2024

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

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

Back to the top