Dynamic GWT Menu -


How do I modify a GWT menu - Some entries are grayed out, according to the status of my application, Can I put a checkmark near?

My app has a menu bar at the top - file, edit, view, insert, format, etc. I have several paragraphs, each of which may have a different format when the user clicks on the format, then I want to show a checkmark near the menu menu in the Format menu that matches the format of the currently selected paragraph . Some formats are currently inappropriate for the selected paragraph, so I want to gray them up.

The main issue is to update when: (A) when the Format menu button is clicked, or (b) every time my user chooses a new paragraph?

I find the option (A) more attractive. But how can I find out this? There is no facility to add event listeners to a menu event. It can be a mouse click that I want, but it can be a mouseover: If the user clicks on the Insert menu, the Insert menu will appear, but If the mouse is moved to the format then the Format menu will appear.

Option (B) seems easy, but it consumes more processor time.

For my context menu (right click on paragraph), this is very easy, because the menu is created only when the right click is done.

I have resorted to using class-root symbols (& # 8730) for tickets. Does anyone know a good way? Do I need to use HTML and use "& nbsp; plain-format" for my menu item?

Finally, there is a way to deactivate a menu item, so that it does not happen as option (A) looks better than the perspective of protected resources.

Instead of using square-root symbol, why do not you use the image ( Using the com.google.gwt.user.client.ui.Image category?)

I think that to use the checkbox class for your menu items There may be more elegant / simple solutions, in this way you can do automated tics / check instead of using an image or a square-parent symbol. In addition, you can set the value of setEnabled (false) The "gray-out" items will be enabled otherwise you will have to write your own widget for "gray-out" items or add your functionality to your menu labels.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -