How to refresh a TableViewer in Eclipse RCP Application - swt

I’m using JFace viewer Framework in my eclipse rcp application, I’ve created a Table Viewer, which populates some data .My view has a refresh button below tableviewer, when I select a row in tableviewer and trigger refresh button the selected row still appears in gray color.
Scenario is depicted below
Before selecting a row
After selecting a row
After refresh
In what way can i remove the gray background as in the above figure and make it as 1st image.
My refresh button listener code is simple which has
viewer.refresh();
as a workaround i tried implementing methods like
viewer.getTable().redraw();
viewer.getTable().setRedraw(true);
which doesn't work, is there a solution to refresh it or should I refresh the view totally
Note: My Execution environment is windows xp

That gray line is current, not previous selection. It's gray because table is not in focus. Use setSelection(StructuredSelection.EMPTY).

If you create the table with the style flag SWT.HIDE_SELECTION the table will not show its selection when it loses focus. I.e. it will look like your first image.

Related

ag-grid popup cellEditor - how to prevent close on click?

I have an ag-grid popup cellEditor which contains an angular mat-select control. Is there a way to prevent the popup cell editor default behavior of closing on a click outside the cell? When an item is selected the ag-grid popup cellEditor closes. I believe this is due to the click on the select drop down being interpreted as outside the cell. Is it possible to prevent popup cell closure for this case or even in all cases such that I can control it completely via code using gridApi.stopEditing()?
See https://material.angular.io/components/select/overview for information on the select control. I am not including full details here as it is likely not important.
Image of popup editor, You can see how cell is before editor is invoked as well. See where the blue number one appears

Nattable - ButtonPainter on cell is going on edit mode on click ,

i am trying to follow class Rendereing_a_cell_as_a_button
https://github.com/eclipse/nebula.widgets.nattable/blob/master/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/Rendering_cells_as_a_link_and_button.java
from Nattable example to create similar button , i have copied same example code.
Button is showing on the desired column, but on click the style is not getting change of button like clicked and also listener is not getting called, it is going to edit mode and showing the content of cell.
Before Click
After click
If your table also supports editing you need to ensure that cells in the column that shows buttons should be not editable. This can be done by registering an IEditableRule#NEVER_EDITABLE for that column.

How to edit the objects in FileMakerPro

I have one doubt in filemaker pro. In my project I have one layout with a button(Lets say layout1). If I click on the button, it is navigating to next page(Lets say layout2). If I go to layout mode in this page(layout2), it is showing the layout mode of previous page(layout1). I checked the button setup in this page(layout1). It is calling some script(Lets say script1). In the script(script1) it is calling some object using "go to object[object name:nameoftheobject]". I want to make some changes in layout2. Is there any way to find this layout or suggest some ideas to edit the object 'nameoftheobject'?
Your script does not change the layout, instead the interface is re-drawn by going to an object covering a whole layout. It could be a hidden tab control, popover or slide control. Duplicate layout and try to select all and apply a visible border.

Predefined Add Dialog not working as expected in Lightswitch 2012

I've created a query to use in an AutoCompleteBox and it works as expected when the user select the AutoCompleteBox in the grid as shown in the picture below
However if the user click the plus button to add a new record using the predefined Add Dialog then the query and the AutoCompleteBox's format doesn't work as shown in the picture below
Why is this happening and how I can fix that?
Thanks
I haven't yet found a way to edit the default Add New dialog.
Instead, make a new screen, select the "New Data Screen" template, and link it to your entity data. You can customize the screen to fit your needs, even make it a Modal Window by changing the Control Type in the screen properties. Once you have the screen set up the way you want, go back to your grid screen, and double click on the Add... command in the Command Bar of your grid, to edit the AddAndEditNew_Execute code. In that method, call your custom screen.
So, as I got to thinking about this some more, I came back to the thought I had when I tried to do this a few months ago. There has to be a better way, so I Googled it again.
This time, I found something. He's using an old version of Lightswitch, but I've successfully applied his technique in my application built in Lightswitch 2012.
http://www.c-sharpcorner.com/UploadFile/051e29/modal-window-in-editable-grid-screen-in-lightswitch-2011/

Dynamic GWT Menu

How can I modify a GWT menu - grey out some entries, put a checkmark next to others, according to my application state?
My app has a menu bar across the top - File, Edit, View, Insert, Format, etc. I have a number of paragraphs, each of which could have a different format. When the user clicks on Format, I want the format menu to show a checkmark next to the menuItem that corresponds to the format of the currently selected paragraph. If some formats are inappropriate for the currently selected paragraph, I want to grey those menuItems out.
The main issue is when to do the update: (a) when the Format menu button is clicked, or (b) each time my user selects a new paragraph?
I find option (a) more appealing. But how can I detect this? A MenuItem doesn't have any facility for adding event listeners. It could be a mouseClick that I need, but it might be a mouseOver: if the user clicks on the Insert menuItem the Insert menu will appear, but then if the mouse is moved over Format, then the Format menu will appear.
Option (b) sounds simpler, but wastes more processor time.
For my contextMenu (right click on the paragraph), it's much easier, because the menu is only constructed when the right click happens.
I've resorted to using the square-root symbol (&#8730) for a tick. Does anyone know a nicer way? Do I need to use HTML and use " Plain-Format" for my menu item?
Finally, is there a way to disable (grey-out) a menu item so that it can't be selected?
Option (a) sounds better from a conserving resources point of view.
Instead of using the square-root symbol, why don't you use an image (using the com.google.gwt.user.client.ui.Image class)?
I think a more elegant/simple solution might be to use the checkbox class for your menu items. That way you could have automatic ticks/checks instead of having to use an image or the square-root symbol. Also, you will be able to "grey-out" items with setEnabled(false). Otherwise, you will have to write your own widget or add your own functionality to your menu labels in order to "grey-out" items.