Issue while editing a Table using SWT TableEditor - swt

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet88.java
In the Table Editor example described in the above link, EDITABLECOLUMN is set to "1", i.e. edit second column of the table.
If i want to edit the first column i changed that variable to "0", and when i try to edit that column(1st) in the table, the second column value disappears. I mean the Text widget which is being created so as to serve as a listener for the cell, it occupying the next column as well.

Do you perhaps have following line in your code?
editor.minimumWidth = 250;

Related

Problem adding new child row to parent row; new row always added to bottom of sheet

I'm trying to add a new indented row as a child of an existing row and it just adds a new row to the bottom of the sheet instead of indented underneath parent row.
new_row = ssc.models.Row()
new_row.cells.append({
'column_id':5050181304510340,
'parentId':1379272254089092,
'strict':False,
'value':"test_value",
})
response = ssc.Sheets.add_rows(6110498509875076, [new_row])
Thanks for any help.
Seems like you have a typo in one of the property names. Try changing parentId to parent_id instead.
Also worth mentioning that the Specify Row Location section of the docs contains some good info about how to set various row properties to specify row position. (Mentioning this here mainly for the benefit of others who may find this thread later while looking for info about row positioning).
OMFG...been working for 2 days trying to return the parent and sibling and turns out it's a typo in the docs. This post is $$$
print(row.parent_id)
print(row.sibling_id)
print(row.row_number)

Click on checkboxes based on text in another column and status of checkbox

I have a table on a page with 50 check boxes and some columns, and I need to click on the ones that has a specific text on the last column. So I used this command:
//table[#id='edit-entities']/tbody/tr[td[6][contains(text(), 'New')]]/td/div/input
It worked, Selenium clicks on the first one. Now I need to know how can I make Selenium to click in the other ones.
I tried:
//table[#id='edit-entities']/tbody/tr[td[6][contains(text(), 'New')]]/td/div/input[2]
I put the index [2] in the front of the input to test if it would click on the second check box matching this condition, but it says it did not find the element.
Figured out ... the index must be the row index and not the checkbox index:
//table[#id='edit-entities']/tbody/tr[td[6][contains(text(), 'New')]][4]/td/div/input

Set column default value in Google Sheets

I have a finance tracking worksheet that has a number of formulas for each row. What I'd like to add is have these formulas replicate whenever a new row is inserted (fill it with a "default value").
Sheet before adding the row:
Sheet after adding the row:
I'd like some of these cells (B28 in this case) to contain a formula. for this row the formula is:
=IF(ISBLANK(C27), "", CONCATENATE(YEAR(C27), "-", MONTH(C27)))
You might want to consider an ArrayFormula. Here's a place for getting detail. In your case, the big trick is knowing that you can run the formula through all of Column C using the notation something like C1:C. Doing it this way is far more self documenting than burying it in a Google function and it's way more general.
Because the formula is the same for all rows, I added a function that just does the following:
function addRow() {
SpreadsheetApp.getActiveSheet().getRange('B7:B').setValue('=IF(ISBLANK(C7), "", CONCATENATE(YEAR(C7), "-", MONTH(C7)))');
}
I set this function to run on a trigger whenever the sheet is edited. The row numbers increment themselves so not problem there either.
Used this SO question for help: Default cell values when Inserting new row in Google Sheets
delete everything in your B column and paste this into B1 cell:
={"Date", ARRAYFORMULA(IF(C2:C<>"", YEAR(C2:C)&"-"&MONTH(C2:C)))}

Put text not repeatable in horizontal detail

I want to put a static text not repeatable in horizontal band detail of my report written with iReport.
I've created my band in this way:
Print Order: Horizontal
Columns no.: 10
But I want an effect like this:
But the only effect proposed is: repeating of header name and age together the value.
How can I resolve this?
I used iReport 5.1.0
Solved!
I want to share my solution step by step:
I've created a band detail to explode in horizontal way and I've set number of column (10)
I've added a text field "Name"
I've set the following XML properties on "Name" text field:
isPrintRepeatedValues = false
printWhenGroupChanges = "name of group container"
I've put field $F{Name} in the same column of text field "Name"
The result has been:
All value of name field are repeated and the text field has shown only once.
Have a nice day ;)

Creating columns with editable cells in Gtk treeview using Glade

I am trying to create a simple GUI with table containing x and y coordinates of samples. I use treeview, and I want the cells of the table to be editable by user. Is it possible to specify if the cells should be editable directly in Glade in cellrenderer properties, or do I have to specify it in my code? I use Glade 3.6.1
I have just found out that unticking box "Editable" in the Tree View Editor when editing my treeview, enables me to specify whether the cells shall be editable or not, because if the box is unticked, the cells editable property is no longer connected with the model.
But if I run the program, cells are editable, but the value that I write inside disappears. How can I fix that? Why doesn't the cell store the value I type inside?
Thanks for any hint
For anyone dealing with a similar problem, I have solved it - whenever a cell is edited, appropriate record in the model needs to be changed, example code in Python:
cell.connect("edited", self.text_edited, model, column)
def text_edited( self, w, row, new_text, model, column)
model[row][column] = new_text
I found I had to do something just a little different, but I am also using Ubuntu's Quickly development environment. I did have to go into Glade and uncheck the "Editable" box in my cellrenderer, which then brought up a toggable "Yes/No" button. Then my code looks like:
#psuedo-code function definition
cellcolumn_widget.connect("edited", self.function, list_or_treestore, columnnumber)
#actual code, editing second column so column is passed as 1
self.builder.get_object("cellrenderer_chapter").connect("edited", self.cell_edited, self.builder.get_object("liststore_chapters"),1)
def cell_edited(self, widget, row, new_text, model, column):
model.set_value(model.get_iter(row),column,new_text)
for python GTK, by default, text in Gtk.CellRendererText widgets is not editable, you can change this by setting the value of the “editable” property to True:
renderer = Gtk.CellRendererText();
renderer.set_property("editable", True);
then you can connect to the “edited” signal and update your Gtk.TreeModel and/or database accordingly:
renderer.connect("edited", self.entry_edited);
def entry_edited(self, widget, path, text):
self.listStore[path][number_of_row] = text; # put the number_of_row to be edited
check this tutorial for more information python gtk 3 tutorial - CellRendererText