Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Adding context menus to fields((ValueFields, Images etc))
Adding context menus to fields [message #1064444] Wed, 19 June 2013 05:59 Go to next message
Urs Beeli is currently offline Urs Beeli
Messages: 325
Registered: October 2012
Location: Bern, Switzerland
Senior Member
In our application we have a requirement that we need to be able to execute some actions from fields based on their content. As an example there might be a StringField containing someone's e-mail address, we would then need to offer the possibility of letting the user send a message to that e-mail address. Or we might have an icon indicating some status and would like to be able to change this status by interacting with the image. The easiest thing to make this possible from a user perspective would be using a context menu on those elements.

In the Scout SDK I didn't see a possibility of adding menu entries to anything but a table field. Is it possible to add a context menu to another field (say an ImageField or anything derived from ValueField)? If so, how would I do this?
Re: Adding context menus to fields [message #1064452 is a reply to message #1064444] Wed, 19 June 2013 07:00 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 675
Registered: October 2011
Senior Member
From what I know, for the moment menus can be added to:
* Table
* Button
* SmartField

I think that the application model could be extended...
Re: Adding context menus to fields [message #1064462 is a reply to message #1064452] Wed, 19 June 2013 08:04 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 325
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Is this something I could do myself or does it involve heavy digging in the scout internals?
Re: Adding context menus to fields [message #1064668 is a reply to message #1064462] Thu, 20 June 2013 09:21 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 675
Registered: October 2011
Senior Member
I is probably no "heavy digging", but I do not see how you can change it, without changing stuff in the Scout classes:
- Application model: you will need a "IMenu[] getMenus()" method on the interfaces representing the corresponding fields -- similar to what you have on ISmartField
- Rendering engine (eg org.eclipse.scout.rt.ui.swt) needs to render these menus.
Re: Adding context menus to fields [message #1064682 is a reply to message #1064668] Thu, 20 June 2013 10:09 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 325
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Thanks for your reply, in that case I'll open a Bug for this.

Edit: Bug 411266 opened

[Updated on: Thu, 20 June 2013 10:47]

Report message to a moderator

Re: Adding context menus to fields [message #1064802 is a reply to message #1064682] Fri, 21 June 2013 03:52 Go to previous messageGo to next message
Judith Gull is currently offline Judith Gull
Messages: 49
Registered: February 2010
Member
Adding context menus to all value fields has been requested before. But, because context menus are not very practical on a mobile platform, it was not implemented.

You can however define context menus on image fields: You can find an example here on LeftField: https://github.com/BSI-Business-Systems-Integration-AG/org.eclipsescout.demo/blob/master/widgets/org.eclipsescout.demo.widgets.client/src/org/eclipsescout/demo/widgets/client/ui/forms/ImageFieldForm.java
Re: Adding context menus to fields [message #1065047 is a reply to message #1064802] Mon, 24 June 2013 02:18 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 325
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Judith

Thanks for your reply. Context menus might not be very practical on a mobile platform, but it seems like a shame that a feature that would be very practical in an SWT client is not available just because it isn't a benefit to mobile platforms.

Edit: removed comments about not finding anything in LeftField about how to add context menus to ImageFields as I just found out that ImageFields already support context menus in the SDK, don't know how I missed that...

[Updated on: Mon, 24 June 2013 02:39]

Report message to a moderator

Re: Adding context menus to fields [message #1065133 is a reply to message #1065047] Mon, 24 June 2013 09:19 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 325
Registered: October 2012
Location: Bern, Switzerland
Senior Member
I've now successfully added a context menu to an ImageField and can access it by right-clicking the image.

However, on of our requirements is that the application be usable only with the keyboard (without the mouse).

However, even though my ImageField has both the "Focusable" as well as the "Focus visible" property set, I do not seem to be able to focus it (either using the Tab key or using the mouse to left click on it). As the image is not focusable, I cannot use the "context menu key" on the keyboard to open the context menu (something that works on a table for example). I thought I'd add a keystroke to do that, but here I have the same problem, as I cannot set the focus on the ImageField, any keystrokes I define for it does not seem to be triggered.

As a workaround, I've defined a keystroke on the containing GroupBox which *is* triggered. How would I trigger the display of the the ImageField's context menu from the keystroke's execAction command?

Re: Adding context menus to fields [message #1263285 is a reply to message #1065133] Tue, 04 March 2014 05:44 Go to previous message
Matthias Villiger is currently offline Matthias Villiger
Messages: 78
Registered: September 2011
Member
I created Bug 429556 for the issue that the imagefield cannot get the focus.
Previous Topic:Different scopes in formfield definition for SWT, RAP and Swing
Next Topic:Object instances / serialization in Scout offline-applications
Goto Forum:
  


Current Time: Fri Aug 29 01:35:30 EDT 2014

Powered by FUDForum. Page generated in 0.55591 seconds