Is there a way to disable check box in SWT TableColumn - swt

I have a SWT table with SWT.CHECK column. I want to populate another table based on the check box selection in the first table. I am achieving this using Table Selection. So, I want to disable the SWT.CHECK in the first table. Is there any way to disable to the check box?

Use TableItem.setGrayed (boolean grayed). Even though it is grayed out, still you can check/uncheck it. To disable check/uncheck, use TableItem.setChecked(boolean checked)

Related

Add empty rows in a tableviewer

I want to use a "Add" button to add empty rows in the table using table viewer. After adding a new row, the user can edit it. How can I implement this design? Thanks!
You should add the rows to the data that your content provider returns in the getElements method using something that the label provider will show as empty. You then call refresh on the table.
For editing you will use the normal EditingSupport and make sure it can deal with empty entries.

i want to protect the contents of table and add the row below the table in word.How to achieve this?

In Microsoft word 2010, I have enabled Restrict editing, from review tab.
Question.
i want to protect the contents of table and enable other users add the row below the table.How to achieve this?
By enabling protection,was able to protect the table plus its contents,was not enabled to add row below.
For instert new row- add a new row to an Word table, I have no idea about how to set Word table as non-editable.

Is there a hover Event for a table row in a TableViewer

i have a JFace table-viewer, which consists of large number of rows, i thought that it would be better if there is a short description for each row,as a workaround i was trying to implement doubleclick listner but that's not apt to my need,i don't know if there is an event like hover for this,which shows a tooltip containing a brief info about the particular row.
The answer to this question depends somewhat on the exact implementation of your table viewer. Having said that, the primary options are:
Add a MouseTrackListener to the underlying table
Add a SWT Listener for SWT.MouseHover to the underlying table
If you use a CellLabelProvider, have a look at the various getToolTip...(Object) methods
For the first two, you have to figure out the row element yourself - look at event.item.getData(), whereas that is provide to you in the last option...

Selecting different columns in SWT Table, using JFace TableViewer

I have a 2-column SWT Table that uses TableViewer. Trouble is that I can only select (and edit) cells in the first column -- clicking on the second column does nothing.
I read from somewhere (lost the link) that there's no easy way to get such functionality (!) -- you're supposed to mess around with several extra concepts if you want to select (and edit) different columns in your table.
This snippet
(http://www.goneeded.com/snippet/eclipse/JFace/Viewers/Snippet035TableCursorCellHighlighter.html)
seems to be relevant, but it's not clear which part of it is necessary and it has depenendencies to other snippets. I tried to get it working but it did nothing.
Seems that new table editing and cell-selecting features were added in Eclipse 3.3 -- is there a tutorial or smth available on how to use them? The snippets are too cryptic for me.
You should be able to edit and select cells independently. You might have the SWT.FULL_SELECTION style bit set on the Table constructor. That forces every selection to span the whole row instead of a single cell.
I'd check out this tutorial for more on TableViewers:
http://www.eclipse.org/articles/Article-Table-viewer/table_viewer.html

How do I gain Control of a row in Tabular Layout in Oracle

This might be simple but I am new to Oracle. I am using Oracle 10g and have a form that lists our information from a linked table in a tabular Layout. The last column of data is a "list Item" item type that has the Element list of Enabled (T) and Disabled (F).
What I need is when a user changes this dropdown, to disabled, I want ONLY that row to have some of the columns be disabled and not the entire column.
This is also assuming on load of the form, it will disable and enable rows of data depending on what values are being pulled from the EnabledDisabled column in the database.
Thanks for the help!
Option 1: use the ENABLED item property.
Unfortunately Oracle Forms does not allow changing the ENABLED property of an item at the item instance level.
What you can do, however, is enable or disable the whole item when the user enters a record - use the WHEN-NEW-RECORD-INSTANCE trigger - depending on the value of the current record's value for the list item, the trigger would set the ENABLED property to PROPERTY_TRUE or PROPERTY_FALSE.
Of course, your list item would also have the same code in its WHEN-LIST-CHANGED trigger.
The downside to this approach is that the whole column will "look" disabled to the user, and they will not be able to select a different record using those disabled items.
Option 2: use the INSERT_ALLOWED and UPDATE_ALLOWED properties.
You can set these properties at the item instance level using SET_ITEM_INSTANCE_PROPERTY. You would set them in the block's POST-QUERY trigger, as well as in the list item's WHEN-LIST-CHANGED trigger.
This would not, however, change how the items look on the screen. To solve this, you could also set a visual attribute at the item instance level (e.g. change the items to use a dark gray background or something).
More comments.