Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid - Inline Editing
Grid - Inline Editing [message #52659] Sun, 11 May 2008 11:52 Go to next message
Eclipse UserFriend
Originally posted by: mail.ppfeifer.net

Hello.

I'm using the GridTableViewer with inline editing support and moveable
columns. Inline editing works as it's supposed to, but when I move some
gridcolumns the inline editing tab order is still the same, as it was
after creation. Lets say I have got 4 columns (col1, col2, col3, col4)
and I move col3 to the second postion (col1, col3, col2, col4). Then
inline editing is still moving from col1 to col2 to col3 to col4. Is
there a way to tell the inline editing, to take the new column order
into account?

Thanks in adavance.

Peter
Re: Grid - Inline Editing [message #52687 is a reply to message #52659] Sun, 11 May 2008 15:08 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
I don't think this is possible with JFace 3.3 codebase (reordering was
not included in the 3.3 codestream). We (JFace) fixed this in 3.4 and if
Grid behaves like SWT-Table (which it should else I'd consider this a
Grid-bug) this should work out of the box with JFace from 3.4M7 (which
is in a fairly complete state because we are working towards 3.4RC1).

Tom

Peter Pfeifer schrieb:
> Hello.
>
> I'm using the GridTableViewer with inline editing support and moveable
> columns. Inline editing works as it's supposed to, but when I move some
> gridcolumns the inline editing tab order is still the same, as it was
> after creation. Lets say I have got 4 columns (col1, col2, col3, col4)
> and I move col3 to the second postion (col1, col3, col2, col4). Then
> inline editing is still moving from col1 to col2 to col3 to col4. Is
> there a way to tell the inline editing, to take the new column order
> into account?
>
> Thanks in adavance.
>
> Peter


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #52712 is a reply to message #52687] Sun, 11 May 2008 16:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mail.ppfeifer.net

Hello Tom.

Thanks for your answer. This means, if I change to Eclipse >= 3.4M7 this
should work out of the box?

There is one more thing I emcountered. When I do inline editing in a
GridTableViewer with eg. 60 lines where only 10 are displayed at once in
the GridTableViewer, the table does not scroll down to the line which is
currently edited. If you scroll down by using the vertical scrollbar
inline editing is still possible. Is it possible to scroll automatically
to the position of the line, if this line isn't shown?

Thanks Peter


Tom Schindl schrieb:
> I don't think this is possible with JFace 3.3 codebase (reordering was
> not included in the 3.3 codestream). We (JFace) fixed this in 3.4 and if
> Grid behaves like SWT-Table (which it should else I'd consider this a
> Grid-bug) this should work out of the box with JFace from 3.4M7 (which
> is in a fairly complete state because we are working towards 3.4RC1).
>
> Tom
>
> Peter Pfeifer schrieb:
>> Hello.
>>
>> I'm using the GridTableViewer with inline editing support and moveable
>> columns. Inline editing works as it's supposed to, but when I move
>> some gridcolumns the inline editing tab order is still the same, as it
>> was after creation. Lets say I have got 4 columns (col1, col2, col3,
>> col4) and I move col3 to the second postion (col1, col3, col2, col4).
>> Then inline editing is still moving from col1 to col2 to col3 to col4.
>> Is there a way to tell the inline editing, to take the new column
>> order into account?
>>
>> Thanks in adavance.
>>
>> Peter
>
>
Re: Grid - Inline Editing [message #52739 is a reply to message #52712] Sun, 11 May 2008 18:44 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Peter Pfeifer schrieb:
> Hello Tom.
>
> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7 this
> should work out of the box?

Yes.

>
> There is one more thing I emcountered. When I do inline editing in a
> GridTableViewer with eg. 60 lines where only 10 are displayed at once in
> the GridTableViewer, the table does not scroll down to the line which is
> currently edited. If you scroll down by using the vertical scrollbar
> inline editing is still possible. Is it possible to scroll automatically
> to the position of the line, if this line isn't shown?
>

This is also a fix in 3.4 stream. The bugfixes you are interested in are:
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #52766 is a reply to message #52739] Mon, 12 May 2008 10:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mail.ppfeifer.net

Hello Tom.

Many thanks, It seems that it's a bug of the Grid beacause I downloaded
Exlipse 3.4M7 and tried what you suggested. But still it has the same
behaviour. Neither the inline editing nor the scrolling works as
supposed to. I've never filed a bug before. How does the procedure look
like, or is there already a bug entry in bugzilla?

Regards, Peter

Tom Schindl schrieb:
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7
>> this should work out of the box?
>
> Yes.
>
>>
>> There is one more thing I emcountered. When I do inline editing in a
>> GridTableViewer with eg. 60 lines where only 10 are displayed at once
>> in the GridTableViewer, the table does not scroll down to the line
>> which is currently edited. If you scroll down by using the vertical
>> scrollbar inline editing is still possible. Is it possible to scroll
>> automatically to the position of the line, if this line isn't shown?
>>
>
> This is also a fix in 3.4 stream. The bugfixes you are interested in are:
> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908
>
> Tom
>
Re: Grid - Inline Editing [message #52819 is a reply to message #52766] Mon, 12 May 2008 12:40 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
You are right.

Reordered Columns:
------------------
Nebula Grid didn't implement the additional methods we added in 3.4. I
filed a bug and added a patch which makes this work [1].

Scrolling Cell into View:
------------------------
This is a bug in GridViewerEditor easily fixable as [2] shows.

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231530
[2]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231532


Peter Pfeifer schrieb:
> Hello Tom.
>
> Many thanks, It seems that it's a bug of the Grid beacause I downloaded
> Exlipse 3.4M7 and tried what you suggested. But still it has the same
> behaviour. Neither the inline editing nor the scrolling works as
> supposed to. I've never filed a bug before. How does the procedure look
> like, or is there already a bug entry in bugzilla?
>
> Regards, Peter
>
> Tom Schindl schrieb:
>> Peter Pfeifer schrieb:
>>> Hello Tom.
>>>
>>> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7
>>> this should work out of the box?
>>
>> Yes.
>>
>>>
>>> There is one more thing I emcountered. When I do inline editing in a
>>> GridTableViewer with eg. 60 lines where only 10 are displayed at once
>>> in the GridTableViewer, the table does not scroll down to the line
>>> which is currently edited. If you scroll down by using the vertical
>>> scrollbar inline editing is still possible. Is it possible to scroll
>>> automatically to the position of the line, if this line isn't shown?
>>>
>>
>> This is also a fix in 3.4 stream. The bugfixes you are interested in are:
>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908
>>
>> Tom
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #52845 is a reply to message #52819] Mon, 12 May 2008 13:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mail.ppfeifer.net

Hello Tom.

Thank you very much. I added your changes and now both work like a
charm. But that leads me to another question :-) I don't know if I
should start a new thread, but first I'll try my luck within this one.

I want to use the grid/gridtableviewer for quick data entry. Therefore I
have a special requirement. When the active cell is the really last one
in the grid and the user presses the tab-key a new record/row should be
added to the grid. It's more or less the same as in MS Word/OO when the
user is editing the last cell of a table and pressing the tab-key
automatically adds one new row.

Is this also possible to be done with the grid/gridtableviewer?

Thank you very much.

Peter


Tom Schindl schrieb:
> You are right.
>
> Reordered Columns:
> ------------------
> Nebula Grid didn't implement the additional methods we added in 3.4. I
> filed a bug and added a patch which makes this work [1].
>
> Scrolling Cell into View:
> ------------------------
> This is a bug in GridViewerEditor easily fixable as [2] shows.
>
> Tom
>
> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231530
> [2]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231532
>
>
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Many thanks, It seems that it's a bug of the Grid beacause I
>> downloaded Exlipse 3.4M7 and tried what you suggested. But still it
>> has the same behaviour. Neither the inline editing nor the scrolling
>> works as supposed to. I've never filed a bug before. How does the
>> procedure look like, or is there already a bug entry in bugzilla?
>>
>> Regards, Peter
>>
>> Tom Schindl schrieb:
>>> Peter Pfeifer schrieb:
>>>> Hello Tom.
>>>>
>>>> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7
>>>> this should work out of the box?
>>>
>>> Yes.
>>>
>>>>
>>>> There is one more thing I emcountered. When I do inline editing in a
>>>> GridTableViewer with eg. 60 lines where only 10 are displayed at
>>>> once in the GridTableViewer, the table does not scroll down to the
>>>> line which is currently edited. If you scroll down by using the
>>>> vertical scrollbar inline editing is still possible. Is it possible
>>>> to scroll automatically to the position of the line, if this line
>>>> isn't shown?
>>>>
>>>
>>> This is also a fix in 3.4 stream. The bugfixes you are interested in
>>> are:
>>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
>>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908
>>>
>>> Tom
>>>
>
>
Re: Grid - Inline Editing [message #52872 is a reply to message #52845] Mon, 12 May 2008 14:16 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020202070508030301070905
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Peter Pfeifer schrieb:
> Hello Tom.
>
> Thank you very much. I added your changes and now both work like a
> charm. But that leads me to another question :-) I don't know if I
> should start a new thread, but first I'll try my luck within this one.
>
> I want to use the grid/gridtableviewer for quick data entry. Therefore I
> have a special requirement. When the active cell is the really last one
> in the grid and the user presses the tab-key a new record/row should be
> added to the grid. It's more or less the same as in MS Word/OO when the
> user is editing the last cell of a table and pressing the tab-key
> automatically adds one new row.
>
> Is this also possible to be done with the grid/gridtableviewer?
>

That's not an easy task but doable with some hacks. Because we are past
API-Freeze in JFace 3.4 it is to late to introduce such a feature at
JFace level and I don't think GridViewer should introduce an API itself.

Having said this you can solve "quite simply" your own and staying with
the current API but enhancing it (See the files attached). This is only
one solution you could also use Reflection for example.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------

--------------020202070508030301070905
Content-Type: text/plain;
name="GridViewerEditor.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="GridViewerEditor.java"

/*********************************************************** ********************
* Copyright (c) 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* rmcamara@us.ibm.com - initial API and implementation
* Tom Schindl <tom.schindl@bestsolution.at> - various significant contributions
* bug fix in: 191216
************************************************************ *******************/

package org.eclipse.nebula.snippets.gridviewer;

import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.ColumnViewerEditor;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrate gy;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.jface.viewers.ViewerRow;
import org.eclipse.jface.viewers.CellEditor.LayoutData;
import org.eclipse.nebula.jface.gridviewer.GridTableViewer;
import org.eclipse.nebula.jface.gridviewer.GridTreeViewer;
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.nebula.widgets.grid.GridEditor;
import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Item;

public class GridViewerEditor extends ColumnViewerEditor {
/** Editor support for tables. */
private GridEditor gridEditor;

private TabbingEndHandler handler;

/**
* This handler is called when tabbing to the next/previous element didn't succeeded
*/
public abstract static class TabbingEndHandler {
public abstract void handle(ViewerCell cell, TraverseEvent event);
}

GridViewerEditor(ColumnViewer viewer,
ColumnViewerEditorActivationStrategy editorActivationStrategy,
int feature) {
super(viewer, editorActivationStrategy, feature);
this.gridEditor = new GridEditor((Grid) viewer.getControl());
}

protected StructuredSelection createSelection(Object element) {
return new StructuredSelection(element);
}

protected void setEditor(Control w, Item item, int fColumnNumber) {
gridEditor.setEditor(w, (GridItem) item, fColumnNumber);
}

protected void setLayoutData(LayoutData layoutData) {
gridEditor.grabHorizontal = layoutData.grabHorizontal;
gridEditor.horizontalAlignment = layoutData.horizontalAlignment;
gridEditor.minimumWidth = layoutData.minimumWidth;
}

public void setTabbingEndHandler(TabbingEndHandler handler) {
this.handler = handler;
}

protected void processTraverseEvent(int columnIndex, ViewerRow row,
TraverseEvent event) {
if( handler != null ) {
ViewerCell previous = getFocusCell();
super.processTraverseEvent(columnIndex, row, event);
ViewerCell next = getFocusCell();

if( previous != null && previous.equals(next) ) {
handler.handle(next, event);
}
} else {
super.processTraverseEvent(columnIndex, row, event);
}
}

public ViewerCell getFocusCell() {
Grid grid = (Grid) getViewer().getControl();

if (grid.getCellSelectionEnabled()) {
Point p = grid.getFocusCell();

if (p.x >= 0 && p.y >= 0) {
GridItem item = grid.getItem(p.y);
if (item != null) {
ViewerRow row = getViewerRowFromItem(item);
return row.getCell(p.x);
}
}
}

return null;
}

private ViewerRow getViewerRowFromItem(GridItem item) {
if (getViewer() instanceof GridTableViewer) {
return ((MyGridTableViewer) getViewer()).getViewerRowFromItem(item);
} else {
return ((MyGridTreeViewer) getViewer()).getViewerRowFromItem(item);
}
}

protected void updateFocusCell(ViewerCell focusCell,
ColumnViewerEditorActivationEvent event) {
if (event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
|| event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL) {
Grid grid = ((Grid) getViewer().getControl());
grid.deselectAllCells();
grid.setFocusColumn(grid.getColumn(focusCell.getColumnIndex( )));
grid.setFocusItem((GridItem) focusCell.getItem());
grid.setCellSelection(new Point(focusCell.getColumnIndex(), grid
.indexOf((GridItem) focusCell.getItem())));

grid.showSelection();
}
}

public static void create(MyGridTableViewer viewer,
ColumnViewerEditorActivationStrategy editorActivationStrategy,
int feature) {
viewer.setColumnViewerEditor(new GridViewerEditor(viewer,
editorActivationStrategy, feature));
}

public static void create(MyGridTreeViewer viewer,
ColumnViewerEditorActivationStrategy editorActivationStrategy,
int feature) {
viewer.setColumnViewerEditor(new GridViewerEditor(viewer,
editorActivationStrategy, feature));
}
}

--------------020202070508030301070905
Content-Type: text/plain;
name="MyGridTableViewer.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="MyGridTableViewer.java"

package org.eclipse.nebula.snippets.gridviewer;

import org.eclipse.jface.viewers.ViewerRow;
import org.eclipse.nebula.jface.gridviewer.GridTableViewer;
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Widget;

public class MyGridTableViewer extends GridTableViewer {

public MyGridTableViewer(Grid grid) {
super(grid);
// TODO Auto-generated constructor stub
}

public MyGridTableViewer(Composite parent, int style) {
super(parent, style);
// TODO Auto-generated constructor stub
}

public MyGridTableViewer(Composite parent) {
super(parent);
// TODO Auto-generated constructor stub
}

@Override
protected ViewerRow getViewerRowFromItem(Widget item) {
// TODO Auto-generated method stub
return super.getViewerRowFromItem(item);
}

}

--------------020202070508030301070905
Content-Type: text/plain;
name="MyGridTreeViewer.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="MyGridTreeViewer.java"

package org.eclipse.nebula.snippets.gridviewer;

import org.eclipse.jface.viewers.ViewerRow;
import org.eclipse.nebula.jface.gridviewer.GridTreeViewer;
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Widget;

public class MyGridTreeViewer extends GridTreeViewer {

public MyGridTreeViewer(Grid grid) {
super(grid);
// TODO Auto-generated constructor stub
}


public MyGridTreeViewer(Composite parent, int style) {
super(parent, style);
// TODO Auto-generated constructor stub
}

public MyGridTreeViewer(Composite parent) {
super(parent);
// TODO Auto-generated constructor stub
}


@Override
protected ViewerRow getViewerRowFromItem(Widget item) {
// TODO Auto-generated method stub
return super.getViewerRowFromItem(item);
}


}

--------------020202070508030301070905--
Re: Grid - Inline Editing [message #52899 is a reply to message #52872] Mon, 12 May 2008 15:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mail.ppfeifer.net

Thank you very much. I'll give this a try tomorrow and let you know.
Besides that, would this be a valuable feature/enhancement for future
JFace releases?

Peter

Tom Schindl schrieb:
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Thank you very much. I added your changes and now both work like a
>> charm. But that leads me to another question :-) I don't know if I
>> should start a new thread, but first I'll try my luck within this one.
>>
>> I want to use the grid/gridtableviewer for quick data entry. Therefore
>> I have a special requirement. When the active cell is the really last
>> one in the grid and the user presses the tab-key a new record/row
>> should be added to the grid. It's more or less the same as in MS
>> Word/OO when the user is editing the last cell of a table and pressing
>> the tab-key automatically adds one new row.
>>
>> Is this also possible to be done with the grid/gridtableviewer?
>>
>
> That's not an easy task but doable with some hacks. Because we are past
> API-Freeze in JFace 3.4 it is to late to introduce such a feature at
> JFace level and I don't think GridViewer should introduce an API itself.
>
> Having said this you can solve "quite simply" your own and staying with
> the current API but enhancing it (See the files attached). This is only
> one solution you could also use Reflection for example.
>
> Tom
>
Re: Grid - Inline Editing [message #52926 is a reply to message #52899] Mon, 12 May 2008 15:24 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Yes. I think it could make sense at least we should think about how this
could be solved at the JFace level.

My code is not tested at all so there's the possibility that I missed
something.

Tom

Peter Pfeifer schrieb:
> Thank you very much. I'll give this a try tomorrow and let you know.
> Besides that, would this be a valuable feature/enhancement for future
> JFace releases?
>
> Peter
>
> Tom Schindl schrieb:
>> Peter Pfeifer schrieb:
>>> Hello Tom.
>>>
>>> Thank you very much. I added your changes and now both work like a
>>> charm. But that leads me to another question :-) I don't know if I
>>> should start a new thread, but first I'll try my luck within this one.
>>>
>>> I want to use the grid/gridtableviewer for quick data entry.
>>> Therefore I have a special requirement. When the active cell is the
>>> really last one in the grid and the user presses the tab-key a new
>>> record/row should be added to the grid. It's more or less the same as
>>> in MS Word/OO when the user is editing the last cell of a table and
>>> pressing the tab-key automatically adds one new row.
>>>
>>> Is this also possible to be done with the grid/gridtableviewer?
>>>
>>
>> That's not an easy task but doable with some hacks. Because we are
>> past API-Freeze in JFace 3.4 it is to late to introduce such a feature
>> at JFace level and I don't think GridViewer should introduce an API
>> itself.
>>
>> Having said this you can solve "quite simply" your own and staying
>> with the current API but enhancing it (See the files attached). This
>> is only one solution you could also use Reflection for example.
>>
>> Tom
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #52972 is a reply to message #52926] Tue, 13 May 2008 06:22 Go to previous messageGo to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Hello Tom.

Thank you very much, your patch works. Now I can handle "the last cell
in the table".

But there is another issue I encountered, when traversing through the
grid with horizontal scrollbar visible, due to to some columns aren't
visible because of the width of table. While forward traversing works
how it's supposed to (the grid scrolls to currently active cell)
backward traversing (Shift+Tab) doesn't scroll to the active cell.

Thnks.

Peter


Tom Schindl schrieb:
> Yes. I think it could make sense at least we should think about how this
> could be solved at the JFace level.
>
> My code is not tested at all so there's the possibility that I missed
> something.
>
> Tom
>
> Peter Pfeifer schrieb:
>> Thank you very much. I'll give this a try tomorrow and let you know.
>> Besides that, would this be a valuable feature/enhancement for future
>> JFace releases?
>>
>> Peter
>>
>> Tom Schindl schrieb:
>>> Peter Pfeifer schrieb:
>>>> Hello Tom.
>>>>
>>>> Thank you very much. I added your changes and now both work like a
>>>> charm. But that leads me to another question :-) I don't know if I
>>>> should start a new thread, but first I'll try my luck within this one.
>>>>
>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>> Therefore I have a special requirement. When the active cell is the
>>>> really last one in the grid and the user presses the tab-key a new
>>>> record/row should be added to the grid. It's more or less the same
>>>> as in MS Word/OO when the user is editing the last cell of a table
>>>> and pressing the tab-key automatically adds one new row.
>>>>
>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>
>>>
>>> That's not an easy task but doable with some hacks. Because we are
>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>> feature at JFace level and I don't think GridViewer should introduce
>>> an API itself.
>>>
>>> Having said this you can solve "quite simply" your own and staying
>>> with the current API but enhancing it (See the files attached). This
>>> is only one solution you could also use Reflection for example.
>>>
>>> Tom
>>>
>
>
Re: Grid - Inline Editing [message #52997 is a reply to message #52972] Tue, 13 May 2008 06:31 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Are you sure for me it worked in my small tests yesterday and because
I'm using the Grid-API I don't know what's wrong :-(.

Tom

Peter Pfeifer schrieb:
> Hello Tom.
>
> Thank you very much, your patch works. Now I can handle "the last cell
> in the table".
>
> But there is another issue I encountered, when traversing through the
> grid with horizontal scrollbar visible, due to to some columns aren't
> visible because of the width of table. While forward traversing works
> how it's supposed to (the grid scrolls to currently active cell)
> backward traversing (Shift+Tab) doesn't scroll to the active cell.
>
> Thnks.
>
> Peter
>
>
> Tom Schindl schrieb:
>> Yes. I think it could make sense at least we should think about how
>> this could be solved at the JFace level.
>>
>> My code is not tested at all so there's the possibility that I missed
>> something.
>>
>> Tom
>>
>> Peter Pfeifer schrieb:
>>> Thank you very much. I'll give this a try tomorrow and let you know.
>>> Besides that, would this be a valuable feature/enhancement for future
>>> JFace releases?
>>>
>>> Peter
>>>
>>> Tom Schindl schrieb:
>>>> Peter Pfeifer schrieb:
>>>>> Hello Tom.
>>>>>
>>>>> Thank you very much. I added your changes and now both work like a
>>>>> charm. But that leads me to another question :-) I don't know if I
>>>>> should start a new thread, but first I'll try my luck within this one.
>>>>>
>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>> Therefore I have a special requirement. When the active cell is the
>>>>> really last one in the grid and the user presses the tab-key a new
>>>>> record/row should be added to the grid. It's more or less the same
>>>>> as in MS Word/OO when the user is editing the last cell of a table
>>>>> and pressing the tab-key automatically adds one new row.
>>>>>
>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>
>>>>
>>>> That's not an easy task but doable with some hacks. Because we are
>>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>>> feature at JFace level and I don't think GridViewer should introduce
>>>> an API itself.
>>>>
>>>> Having said this you can solve "quite simply" your own and staying
>>>> with the current API but enhancing it (See the files attached). This
>>>> is only one solution you could also use Reflection for example.
>>>>
>>>> Tom
>>>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #53023 is a reply to message #52997] Tue, 13 May 2008 06:42 Go to previous messageGo to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Unfortunately I'm sure :-) The grid just doesn't scroll to the left,
when using Shift+Tab.

Should I provide you some code snippets?

Peter

Tom Schindl schrieb:
> Are you sure for me it worked in my small tests yesterday and because
> I'm using the Grid-API I don't know what's wrong :-(.
>
> Tom
>
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Thank you very much, your patch works. Now I can handle "the last cell
>> in the table".
>>
>> But there is another issue I encountered, when traversing through the
>> grid with horizontal scrollbar visible, due to to some columns aren't
>> visible because of the width of table. While forward traversing works
>> how it's supposed to (the grid scrolls to currently active cell)
>> backward traversing (Shift+Tab) doesn't scroll to the active cell.
>>
>> Thnks.
>>
>> Peter
>>
>>
>> Tom Schindl schrieb:
>>> Yes. I think it could make sense at least we should think about how
>>> this could be solved at the JFace level.
>>>
>>> My code is not tested at all so there's the possibility that I missed
>>> something.
>>>
>>> Tom
>>>
>>> Peter Pfeifer schrieb:
>>>> Thank you very much. I'll give this a try tomorrow and let you know.
>>>> Besides that, would this be a valuable feature/enhancement for
>>>> future JFace releases?
>>>>
>>>> Peter
>>>>
>>>> Tom Schindl schrieb:
>>>>> Peter Pfeifer schrieb:
>>>>>> Hello Tom.
>>>>>>
>>>>>> Thank you very much. I added your changes and now both work like a
>>>>>> charm. But that leads me to another question :-) I don't know if I
>>>>>> should start a new thread, but first I'll try my luck within this
>>>>>> one.
>>>>>>
>>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>>> Therefore I have a special requirement. When the active cell is
>>>>>> the really last one in the grid and the user presses the tab-key a
>>>>>> new record/row should be added to the grid. It's more or less the
>>>>>> same as in MS Word/OO when the user is editing the last cell of a
>>>>>> table and pressing the tab-key automatically adds one new row.
>>>>>>
>>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>>
>>>>>
>>>>> That's not an easy task but doable with some hacks. Because we are
>>>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>>>> feature at JFace level and I don't think GridViewer should
>>>>> introduce an API itself.
>>>>>
>>>>> Having said this you can solve "quite simply" your own and staying
>>>>> with the current API but enhancing it (See the files attached).
>>>>> This is only one solution you could also use Reflection for example.
>>>>>
>>>>> Tom
>>>>>
>>>
>>>
>
>
Re: Grid - Inline Editing [message #53050 is a reply to message #53023] Tue, 13 May 2008 06:48 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
If you have one (a completely runnable) this would make it easier to
track it down (if I can because I'm not so educated when it comes to
Grid's internals but I'll certainly take a look).

Tom

Peter Pfeifer schrieb:
> Unfortunately I'm sure :-) The grid just doesn't scroll to the left,
> when using Shift+Tab.
>
> Should I provide you some code snippets?
>
> Peter
>
> Tom Schindl schrieb:
>> Are you sure for me it worked in my small tests yesterday and because
>> I'm using the Grid-API I don't know what's wrong :-(.
>>
>> Tom
>>
>> Peter Pfeifer schrieb:
>>> Hello Tom.
>>>
>>> Thank you very much, your patch works. Now I can handle "the last
>>> cell in the table".
>>>
>>> But there is another issue I encountered, when traversing through the
>>> grid with horizontal scrollbar visible, due to to some columns aren't
>>> visible because of the width of table. While forward traversing works
>>> how it's supposed to (the grid scrolls to currently active cell)
>>> backward traversing (Shift+Tab) doesn't scroll to the active cell.
>>>
>>> Thnks.
>>>
>>> Peter
>>>
>>>
>>> Tom Schindl schrieb:
>>>> Yes. I think it could make sense at least we should think about how
>>>> this could be solved at the JFace level.
>>>>
>>>> My code is not tested at all so there's the possibility that I
>>>> missed something.
>>>>
>>>> Tom
>>>>
>>>> Peter Pfeifer schrieb:
>>>>> Thank you very much. I'll give this a try tomorrow and let you
>>>>> know. Besides that, would this be a valuable feature/enhancement
>>>>> for future JFace releases?
>>>>>
>>>>> Peter
>>>>>
>>>>> Tom Schindl schrieb:
>>>>>> Peter Pfeifer schrieb:
>>>>>>> Hello Tom.
>>>>>>>
>>>>>>> Thank you very much. I added your changes and now both work like
>>>>>>> a charm. But that leads me to another question :-) I don't know
>>>>>>> if I should start a new thread, but first I'll try my luck within
>>>>>>> this one.
>>>>>>>
>>>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>>>> Therefore I have a special requirement. When the active cell is
>>>>>>> the really last one in the grid and the user presses the tab-key
>>>>>>> a new record/row should be added to the grid. It's more or less
>>>>>>> the same as in MS Word/OO when the user is editing the last cell
>>>>>>> of a table and pressing the tab-key automatically adds one new row.
>>>>>>>
>>>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>>>
>>>>>>
>>>>>> That's not an easy task but doable with some hacks. Because we are
>>>>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>>>>> feature at JFace level and I don't think GridViewer should
>>>>>> introduce an API itself.
>>>>>>
>>>>>> Having said this you can solve "quite simply" your own and staying
>>>>>> with the current API but enhancing it (See the files attached).
>>>>>> This is only one solution you could also use Reflection for example.
>>>>>>
>>>>>> Tom
>>>>>>
>>>>
>>>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #53073 is a reply to message #53050] Wed, 14 May 2008 10:54 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Hello Tom.

I tried it with your snippets and it worked. I'll have a look at my
code, seems that I'm missing something.

Thanks,

Peter


Tom Schindl schrieb:
> If you have one (a completely runnable) this would make it easier to
> track it down (if I can because I'm not so educated when it comes to
> Grid's internals but I'll certainly take a look).
>
> Tom
>
> Peter Pfeifer schrieb:
>> Unfortunately I'm sure :-) The grid just doesn't scroll to the left,
>> when using Shift+Tab.
>>
>> Should I provide you some code snippets?
>>
>> Peter
>>
>> Tom Schindl schrieb:
>>> Are you sure for me it worked in my small tests yesterday and because
>>> I'm using the Grid-API I don't know what's wrong :-(.
>>>
>>> Tom
>>>
>>> Peter Pfeifer schrieb:
>>>> Hello Tom.
>>>>
>>>> Thank you very much, your patch works. Now I can handle "the last
>>>> cell in the table".
>>>>
>>>> But there is another issue I encountered, when traversing through
>>>> the grid with horizontal scrollbar visible, due to to some columns
>>>> aren't visible because of the width of table. While forward
>>>> traversing works how it's supposed to (the grid scrolls to currently
>>>> active cell) backward traversing (Shift+Tab) doesn't scroll to the
>>>> active cell.
>>>>
>>>> Thnks.
>>>>
>>>> Peter
>>>>
>>>>
>>>> Tom Schindl schrieb:
>>>>> Yes. I think it could make sense at least we should think about how
>>>>> this could be solved at the JFace level.
>>>>>
>>>>> My code is not tested at all so there's the possibility that I
>>>>> missed something.
>>>>>
>>>>> Tom
>>>>>
>>>>> Peter Pfeifer schrieb:
>>>>>> Thank you very much. I'll give this a try tomorrow and let you
>>>>>> know. Besides that, would this be a valuable feature/enhancement
>>>>>> for future JFace releases?
>>>>>>
>>>>>> Peter
>>>>>>
>>>>>> Tom Schindl schrieb:
>>>>>>> Peter Pfeifer schrieb:
>>>>>>>> Hello Tom.
>>>>>>>>
>>>>>>>> Thank you very much. I added your changes and now both work like
>>>>>>>> a charm. But that leads me to another question :-) I don't know
>>>>>>>> if I should start a new thread, but first I'll try my luck
>>>>>>>> within this one.
>>>>>>>>
>>>>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>>>>> Therefore I have a special requirement. When the active cell is
>>>>>>>> the really last one in the grid and the user presses the tab-key
>>>>>>>> a new record/row should be added to the grid. It's more or less
>>>>>>>> the same as in MS Word/OO when the user is editing the last cell
>>>>>>>> of a table and pressing the tab-key automatically adds one new row.
>>>>>>>>
>>>>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>>>>
>>>>>>>
>>>>>>> That's not an easy task but doable with some hacks. Because we
>>>>>>> are past API-Freeze in JFace 3.4 it is to late to introduce such
>>>>>>> a feature at JFace level and I don't think GridViewer should
>>>>>>> introduce an API itself.
>>>>>>>
>>>>>>> Having said this you can solve "quite simply" your own and
>>>>>>> staying with the current API but enhancing it (See the files
>>>>>>> attached). This is only one solution you could also use
>>>>>>> Reflection for example.
>>>>>>>
>>>>>>> Tom
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: Grid - Inline Editing [message #589719 is a reply to message #52659] Sun, 11 May 2008 15:08 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
I don't think this is possible with JFace 3.3 codebase (reordering was
not included in the 3.3 codestream). We (JFace) fixed this in 3.4 and if
Grid behaves like SWT-Table (which it should else I'd consider this a
Grid-bug) this should work out of the box with JFace from 3.4M7 (which
is in a fairly complete state because we are working towards 3.4RC1).

Tom

Peter Pfeifer schrieb:
> Hello.
>
> I'm using the GridTableViewer with inline editing support and moveable
> columns. Inline editing works as it's supposed to, but when I move some
> gridcolumns the inline editing tab order is still the same, as it was
> after creation. Lets say I have got 4 columns (col1, col2, col3, col4)
> and I move col3 to the second postion (col1, col3, col2, col4). Then
> inline editing is still moving from col1 to col2 to col3 to col4. Is
> there a way to tell the inline editing, to take the new column order
> into account?
>
> Thanks in adavance.
>
> Peter


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #589733 is a reply to message #52687] Sun, 11 May 2008 16:22 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Hello Tom.

Thanks for your answer. This means, if I change to Eclipse >= 3.4M7 this
should work out of the box?

There is one more thing I emcountered. When I do inline editing in a
GridTableViewer with eg. 60 lines where only 10 are displayed at once in
the GridTableViewer, the table does not scroll down to the line which is
currently edited. If you scroll down by using the vertical scrollbar
inline editing is still possible. Is it possible to scroll automatically
to the position of the line, if this line isn't shown?

Thanks Peter


Tom Schindl schrieb:
> I don't think this is possible with JFace 3.3 codebase (reordering was
> not included in the 3.3 codestream). We (JFace) fixed this in 3.4 and if
> Grid behaves like SWT-Table (which it should else I'd consider this a
> Grid-bug) this should work out of the box with JFace from 3.4M7 (which
> is in a fairly complete state because we are working towards 3.4RC1).
>
> Tom
>
> Peter Pfeifer schrieb:
>> Hello.
>>
>> I'm using the GridTableViewer with inline editing support and moveable
>> columns. Inline editing works as it's supposed to, but when I move
>> some gridcolumns the inline editing tab order is still the same, as it
>> was after creation. Lets say I have got 4 columns (col1, col2, col3,
>> col4) and I move col3 to the second postion (col1, col3, col2, col4).
>> Then inline editing is still moving from col1 to col2 to col3 to col4.
>> Is there a way to tell the inline editing, to take the new column
>> order into account?
>>
>> Thanks in adavance.
>>
>> Peter
>
>
Re: Grid - Inline Editing [message #589742 is a reply to message #52712] Sun, 11 May 2008 18:44 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Peter Pfeifer schrieb:
> Hello Tom.
>
> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7 this
> should work out of the box?

Yes.

>
> There is one more thing I emcountered. When I do inline editing in a
> GridTableViewer with eg. 60 lines where only 10 are displayed at once in
> the GridTableViewer, the table does not scroll down to the line which is
> currently edited. If you scroll down by using the vertical scrollbar
> inline editing is still possible. Is it possible to scroll automatically
> to the position of the line, if this line isn't shown?
>

This is also a fix in 3.4 stream. The bugfixes you are interested in are:
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #589752 is a reply to message #52739] Mon, 12 May 2008 10:31 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Hello Tom.

Many thanks, It seems that it's a bug of the Grid beacause I downloaded
Exlipse 3.4M7 and tried what you suggested. But still it has the same
behaviour. Neither the inline editing nor the scrolling works as
supposed to. I've never filed a bug before. How does the procedure look
like, or is there already a bug entry in bugzilla?

Regards, Peter

Tom Schindl schrieb:
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7
>> this should work out of the box?
>
> Yes.
>
>>
>> There is one more thing I emcountered. When I do inline editing in a
>> GridTableViewer with eg. 60 lines where only 10 are displayed at once
>> in the GridTableViewer, the table does not scroll down to the line
>> which is currently edited. If you scroll down by using the vertical
>> scrollbar inline editing is still possible. Is it possible to scroll
>> automatically to the position of the line, if this line isn't shown?
>>
>
> This is also a fix in 3.4 stream. The bugfixes you are interested in are:
> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908
>
> Tom
>
Re: Grid - Inline Editing [message #589772 is a reply to message #52766] Mon, 12 May 2008 12:40 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
You are right.

Reordered Columns:
------------------
Nebula Grid didn't implement the additional methods we added in 3.4. I
filed a bug and added a patch which makes this work [1].

Scrolling Cell into View:
------------------------
This is a bug in GridViewerEditor easily fixable as [2] shows.

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231530
[2]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231532


Peter Pfeifer schrieb:
> Hello Tom.
>
> Many thanks, It seems that it's a bug of the Grid beacause I downloaded
> Exlipse 3.4M7 and tried what you suggested. But still it has the same
> behaviour. Neither the inline editing nor the scrolling works as
> supposed to. I've never filed a bug before. How does the procedure look
> like, or is there already a bug entry in bugzilla?
>
> Regards, Peter
>
> Tom Schindl schrieb:
>> Peter Pfeifer schrieb:
>>> Hello Tom.
>>>
>>> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7
>>> this should work out of the box?
>>
>> Yes.
>>
>>>
>>> There is one more thing I emcountered. When I do inline editing in a
>>> GridTableViewer with eg. 60 lines where only 10 are displayed at once
>>> in the GridTableViewer, the table does not scroll down to the line
>>> which is currently edited. If you scroll down by using the vertical
>>> scrollbar inline editing is still possible. Is it possible to scroll
>>> automatically to the position of the line, if this line isn't shown?
>>>
>>
>> This is also a fix in 3.4 stream. The bugfixes you are interested in are:
>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908
>>
>> Tom
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #589783 is a reply to message #52819] Mon, 12 May 2008 13:17 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Hello Tom.

Thank you very much. I added your changes and now both work like a
charm. But that leads me to another question :-) I don't know if I
should start a new thread, but first I'll try my luck within this one.

I want to use the grid/gridtableviewer for quick data entry. Therefore I
have a special requirement. When the active cell is the really last one
in the grid and the user presses the tab-key a new record/row should be
added to the grid. It's more or less the same as in MS Word/OO when the
user is editing the last cell of a table and pressing the tab-key
automatically adds one new row.

Is this also possible to be done with the grid/gridtableviewer?

Thank you very much.

Peter


Tom Schindl schrieb:
> You are right.
>
> Reordered Columns:
> ------------------
> Nebula Grid didn't implement the additional methods we added in 3.4. I
> filed a bug and added a patch which makes this work [1].
>
> Scrolling Cell into View:
> ------------------------
> This is a bug in GridViewerEditor easily fixable as [2] shows.
>
> Tom
>
> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231530
> [2]https://bugs.eclipse.org/bugs/show_bug.cgi?id=231532
>
>
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Many thanks, It seems that it's a bug of the Grid beacause I
>> downloaded Exlipse 3.4M7 and tried what you suggested. But still it
>> has the same behaviour. Neither the inline editing nor the scrolling
>> works as supposed to. I've never filed a bug before. How does the
>> procedure look like, or is there already a bug entry in bugzilla?
>>
>> Regards, Peter
>>
>> Tom Schindl schrieb:
>>> Peter Pfeifer schrieb:
>>>> Hello Tom.
>>>>
>>>> Thanks for your answer. This means, if I change to Eclipse >= 3.4M7
>>>> this should work out of the box?
>>>
>>> Yes.
>>>
>>>>
>>>> There is one more thing I emcountered. When I do inline editing in a
>>>> GridTableViewer with eg. 60 lines where only 10 are displayed at
>>>> once in the GridTableViewer, the table does not scroll down to the
>>>> line which is currently edited. If you scroll down by using the
>>>> vertical scrollbar inline editing is still possible. Is it possible
>>>> to scroll automatically to the position of the line, if this line
>>>> isn't shown?
>>>>
>>>
>>> This is also a fix in 3.4 stream. The bugfixes you are interested in
>>> are:
>>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201910
>>> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=195908
>>>
>>> Tom
>>>
>
>
Re: Grid - Inline Editing [message #589794 is a reply to message #52845] Mon, 12 May 2008 14:16 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020202070508030301070905
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Peter Pfeifer schrieb:
> Hello Tom.
>
> Thank you very much. I added your changes and now both work like a
> charm. But that leads me to another question :-) I don't know if I
> should start a new thread, but first I'll try my luck within this one.
>
> I want to use the grid/gridtableviewer for quick data entry. Therefore I
> have a special requirement. When the active cell is the really last one
> in the grid and the user presses the tab-key a new record/row should be
> added to the grid. It's more or less the same as in MS Word/OO when the
> user is editing the last cell of a table and pressing the tab-key
> automatically adds one new row.
>
> Is this also possible to be done with the grid/gridtableviewer?
>

That's not an easy task but doable with some hacks. Because we are past
API-Freeze in JFace 3.4 it is to late to introduce such a feature at
JFace level and I don't think GridViewer should introduce an API itself.

Having said this you can solve "quite simply" your own and staying with
the current API but enhancing it (See the files attached). This is only
one solution you could also use Reflection for example.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------

--------------020202070508030301070905
Content-Type: text/plain;
name="GridViewerEditor.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="GridViewerEditor.java"

/*********************************************************** ********************
* Copyright (c) 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* rmcamara@us.ibm.com - initial API and implementation
* Tom Schindl <tom.schindl@bestsolution.at> - various significant contributions
* bug fix in: 191216
************************************************************ *******************/

package org.eclipse.nebula.snippets.gridviewer;

import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.ColumnViewerEditor;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrate gy;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.jface.viewers.ViewerRow;
import org.eclipse.jface.viewers.CellEditor.LayoutData;
import org.eclipse.nebula.jface.gridviewer.GridTableViewer;
import org.eclipse.nebula.jface.gridviewer.GridTreeViewer;
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.nebula.widgets.grid.GridEditor;
import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Item;

public class GridViewerEditor extends ColumnViewerEditor {
/** Editor support for tables. */
private GridEditor gridEditor;

private TabbingEndHandler handler;

/**
* This handler is called when tabbing to the next/previous element didn't succeeded
*/
public abstract static class TabbingEndHandler {
public abstract void handle(ViewerCell cell, TraverseEvent event);
}

GridViewerEditor(ColumnViewer viewer,
ColumnViewerEditorActivationStrategy editorActivationStrategy,
int feature) {
super(viewer, editorActivationStrategy, feature);
this.gridEditor = new GridEditor((Grid) viewer.getControl());
}

protected StructuredSelection createSelection(Object element) {
return new StructuredSelection(element);
}

protected void setEditor(Control w, Item item, int fColumnNumber) {
gridEditor.setEditor(w, (GridItem) item, fColumnNumber);
}

protected void setLayoutData(LayoutData layoutData) {
gridEditor.grabHorizontal = layoutData.grabHorizontal;
gridEditor.horizontalAlignment = layoutData.horizontalAlignment;
gridEditor.minimumWidth = layoutData.minimumWidth;
}

public void setTabbingEndHandler(TabbingEndHandler handler) {
this.handler = handler;
}

protected void processTraverseEvent(int columnIndex, ViewerRow row,
TraverseEvent event) {
if( handler != null ) {
ViewerCell previous = getFocusCell();
super.processTraverseEvent(columnIndex, row, event);
ViewerCell next = getFocusCell();

if( previous != null && previous.equals(next) ) {
handler.handle(next, event);
}
} else {
super.processTraverseEvent(columnIndex, row, event);
}
}

public ViewerCell getFocusCell() {
Grid grid = (Grid) getViewer().getControl();

if (grid.getCellSelectionEnabled()) {
Point p = grid.getFocusCell();

if (p.x >= 0 && p.y >= 0) {
GridItem item = grid.getItem(p.y);
if (item != null) {
ViewerRow row = getViewerRowFromItem(item);
return row.getCell(p.x);
}
}
}

return null;
}

private ViewerRow getViewerRowFromItem(GridItem item) {
if (getViewer() instanceof GridTableViewer) {
return ((MyGridTableViewer) getViewer()).getViewerRowFromItem(item);
} else {
return ((MyGridTreeViewer) getViewer()).getViewerRowFromItem(item);
}
}

protected void updateFocusCell(ViewerCell focusCell,
ColumnViewerEditorActivationEvent event) {
if (event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
|| event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL) {
Grid grid = ((Grid) getViewer().getControl());
grid.deselectAllCells();
grid.setFocusColumn(grid.getColumn(focusCell.getColumnIndex( )));
grid.setFocusItem((GridItem) focusCell.getItem());
grid.setCellSelection(new Point(focusCell.getColumnIndex(), grid
.indexOf((GridItem) focusCell.getItem())));

grid.showSelection();
}
}

public static void create(MyGridTableViewer viewer,
ColumnViewerEditorActivationStrategy editorActivationStrategy,
int feature) {
viewer.setColumnViewerEditor(new GridViewerEditor(viewer,
editorActivationStrategy, feature));
}

public static void create(MyGridTreeViewer viewer,
ColumnViewerEditorActivationStrategy editorActivationStrategy,
int feature) {
viewer.setColumnViewerEditor(new GridViewerEditor(viewer,
editorActivationStrategy, feature));
}
}

--------------020202070508030301070905
Content-Type: text/plain;
name="MyGridTableViewer.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="MyGridTableViewer.java"

package org.eclipse.nebula.snippets.gridviewer;

import org.eclipse.jface.viewers.ViewerRow;
import org.eclipse.nebula.jface.gridviewer.GridTableViewer;
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Widget;

public class MyGridTableViewer extends GridTableViewer {

public MyGridTableViewer(Grid grid) {
super(grid);
// TODO Auto-generated constructor stub
}

public MyGridTableViewer(Composite parent, int style) {
super(parent, style);
// TODO Auto-generated constructor stub
}

public MyGridTableViewer(Composite parent) {
super(parent);
// TODO Auto-generated constructor stub
}

@Override
protected ViewerRow getViewerRowFromItem(Widget item) {
// TODO Auto-generated method stub
return super.getViewerRowFromItem(item);
}

}

--------------020202070508030301070905
Content-Type: text/plain;
name="MyGridTreeViewer.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="MyGridTreeViewer.java"

package org.eclipse.nebula.snippets.gridviewer;

import org.eclipse.jface.viewers.ViewerRow;
import org.eclipse.nebula.jface.gridviewer.GridTreeViewer;
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Widget;

public class MyGridTreeViewer extends GridTreeViewer {

public MyGridTreeViewer(Grid grid) {
super(grid);
// TODO Auto-generated constructor stub
}


public MyGridTreeViewer(Composite parent, int style) {
super(parent, style);
// TODO Auto-generated constructor stub
}

public MyGridTreeViewer(Composite parent) {
super(parent);
// TODO Auto-generated constructor stub
}


@Override
protected ViewerRow getViewerRowFromItem(Widget item) {
// TODO Auto-generated method stub
return super.getViewerRowFromItem(item);
}


}

--------------020202070508030301070905--
Re: Grid - Inline Editing [message #589806 is a reply to message #52872] Mon, 12 May 2008 15:15 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Thank you very much. I'll give this a try tomorrow and let you know.
Besides that, would this be a valuable feature/enhancement for future
JFace releases?

Peter

Tom Schindl schrieb:
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Thank you very much. I added your changes and now both work like a
>> charm. But that leads me to another question :-) I don't know if I
>> should start a new thread, but first I'll try my luck within this one.
>>
>> I want to use the grid/gridtableviewer for quick data entry. Therefore
>> I have a special requirement. When the active cell is the really last
>> one in the grid and the user presses the tab-key a new record/row
>> should be added to the grid. It's more or less the same as in MS
>> Word/OO when the user is editing the last cell of a table and pressing
>> the tab-key automatically adds one new row.
>>
>> Is this also possible to be done with the grid/gridtableviewer?
>>
>
> That's not an easy task but doable with some hacks. Because we are past
> API-Freeze in JFace 3.4 it is to late to introduce such a feature at
> JFace level and I don't think GridViewer should introduce an API itself.
>
> Having said this you can solve "quite simply" your own and staying with
> the current API but enhancing it (See the files attached). This is only
> one solution you could also use Reflection for example.
>
> Tom
>
Re: Grid - Inline Editing [message #589814 is a reply to message #52899] Mon, 12 May 2008 15:24 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Yes. I think it could make sense at least we should think about how this
could be solved at the JFace level.

My code is not tested at all so there's the possibility that I missed
something.

Tom

Peter Pfeifer schrieb:
> Thank you very much. I'll give this a try tomorrow and let you know.
> Besides that, would this be a valuable feature/enhancement for future
> JFace releases?
>
> Peter
>
> Tom Schindl schrieb:
>> Peter Pfeifer schrieb:
>>> Hello Tom.
>>>
>>> Thank you very much. I added your changes and now both work like a
>>> charm. But that leads me to another question :-) I don't know if I
>>> should start a new thread, but first I'll try my luck within this one.
>>>
>>> I want to use the grid/gridtableviewer for quick data entry.
>>> Therefore I have a special requirement. When the active cell is the
>>> really last one in the grid and the user presses the tab-key a new
>>> record/row should be added to the grid. It's more or less the same as
>>> in MS Word/OO when the user is editing the last cell of a table and
>>> pressing the tab-key automatically adds one new row.
>>>
>>> Is this also possible to be done with the grid/gridtableviewer?
>>>
>>
>> That's not an easy task but doable with some hacks. Because we are
>> past API-Freeze in JFace 3.4 it is to late to introduce such a feature
>> at JFace level and I don't think GridViewer should introduce an API
>> itself.
>>
>> Having said this you can solve "quite simply" your own and staying
>> with the current API but enhancing it (See the files attached). This
>> is only one solution you could also use Reflection for example.
>>
>> Tom
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #589834 is a reply to message #52926] Tue, 13 May 2008 06:22 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Hello Tom.

Thank you very much, your patch works. Now I can handle "the last cell
in the table".

But there is another issue I encountered, when traversing through the
grid with horizontal scrollbar visible, due to to some columns aren't
visible because of the width of table. While forward traversing works
how it's supposed to (the grid scrolls to currently active cell)
backward traversing (Shift+Tab) doesn't scroll to the active cell.

Thnks.

Peter


Tom Schindl schrieb:
> Yes. I think it could make sense at least we should think about how this
> could be solved at the JFace level.
>
> My code is not tested at all so there's the possibility that I missed
> something.
>
> Tom
>
> Peter Pfeifer schrieb:
>> Thank you very much. I'll give this a try tomorrow and let you know.
>> Besides that, would this be a valuable feature/enhancement for future
>> JFace releases?
>>
>> Peter
>>
>> Tom Schindl schrieb:
>>> Peter Pfeifer schrieb:
>>>> Hello Tom.
>>>>
>>>> Thank you very much. I added your changes and now both work like a
>>>> charm. But that leads me to another question :-) I don't know if I
>>>> should start a new thread, but first I'll try my luck within this one.
>>>>
>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>> Therefore I have a special requirement. When the active cell is the
>>>> really last one in the grid and the user presses the tab-key a new
>>>> record/row should be added to the grid. It's more or less the same
>>>> as in MS Word/OO when the user is editing the last cell of a table
>>>> and pressing the tab-key automatically adds one new row.
>>>>
>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>
>>>
>>> That's not an easy task but doable with some hacks. Because we are
>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>> feature at JFace level and I don't think GridViewer should introduce
>>> an API itself.
>>>
>>> Having said this you can solve "quite simply" your own and staying
>>> with the current API but enhancing it (See the files attached). This
>>> is only one solution you could also use Reflection for example.
>>>
>>> Tom
>>>
>
>
Re: Grid - Inline Editing [message #589841 is a reply to message #52972] Tue, 13 May 2008 06:31 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Are you sure for me it worked in my small tests yesterday and because
I'm using the Grid-API I don't know what's wrong :-(.

Tom

Peter Pfeifer schrieb:
> Hello Tom.
>
> Thank you very much, your patch works. Now I can handle "the last cell
> in the table".
>
> But there is another issue I encountered, when traversing through the
> grid with horizontal scrollbar visible, due to to some columns aren't
> visible because of the width of table. While forward traversing works
> how it's supposed to (the grid scrolls to currently active cell)
> backward traversing (Shift+Tab) doesn't scroll to the active cell.
>
> Thnks.
>
> Peter
>
>
> Tom Schindl schrieb:
>> Yes. I think it could make sense at least we should think about how
>> this could be solved at the JFace level.
>>
>> My code is not tested at all so there's the possibility that I missed
>> something.
>>
>> Tom
>>
>> Peter Pfeifer schrieb:
>>> Thank you very much. I'll give this a try tomorrow and let you know.
>>> Besides that, would this be a valuable feature/enhancement for future
>>> JFace releases?
>>>
>>> Peter
>>>
>>> Tom Schindl schrieb:
>>>> Peter Pfeifer schrieb:
>>>>> Hello Tom.
>>>>>
>>>>> Thank you very much. I added your changes and now both work like a
>>>>> charm. But that leads me to another question :-) I don't know if I
>>>>> should start a new thread, but first I'll try my luck within this one.
>>>>>
>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>> Therefore I have a special requirement. When the active cell is the
>>>>> really last one in the grid and the user presses the tab-key a new
>>>>> record/row should be added to the grid. It's more or less the same
>>>>> as in MS Word/OO when the user is editing the last cell of a table
>>>>> and pressing the tab-key automatically adds one new row.
>>>>>
>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>
>>>>
>>>> That's not an easy task but doable with some hacks. Because we are
>>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>>> feature at JFace level and I don't think GridViewer should introduce
>>>> an API itself.
>>>>
>>>> Having said this you can solve "quite simply" your own and staying
>>>> with the current API but enhancing it (See the files attached). This
>>>> is only one solution you could also use Reflection for example.
>>>>
>>>> Tom
>>>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #589851 is a reply to message #52997] Tue, 13 May 2008 06:42 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Unfortunately I'm sure :-) The grid just doesn't scroll to the left,
when using Shift+Tab.

Should I provide you some code snippets?

Peter

Tom Schindl schrieb:
> Are you sure for me it worked in my small tests yesterday and because
> I'm using the Grid-API I don't know what's wrong :-(.
>
> Tom
>
> Peter Pfeifer schrieb:
>> Hello Tom.
>>
>> Thank you very much, your patch works. Now I can handle "the last cell
>> in the table".
>>
>> But there is another issue I encountered, when traversing through the
>> grid with horizontal scrollbar visible, due to to some columns aren't
>> visible because of the width of table. While forward traversing works
>> how it's supposed to (the grid scrolls to currently active cell)
>> backward traversing (Shift+Tab) doesn't scroll to the active cell.
>>
>> Thnks.
>>
>> Peter
>>
>>
>> Tom Schindl schrieb:
>>> Yes. I think it could make sense at least we should think about how
>>> this could be solved at the JFace level.
>>>
>>> My code is not tested at all so there's the possibility that I missed
>>> something.
>>>
>>> Tom
>>>
>>> Peter Pfeifer schrieb:
>>>> Thank you very much. I'll give this a try tomorrow and let you know.
>>>> Besides that, would this be a valuable feature/enhancement for
>>>> future JFace releases?
>>>>
>>>> Peter
>>>>
>>>> Tom Schindl schrieb:
>>>>> Peter Pfeifer schrieb:
>>>>>> Hello Tom.
>>>>>>
>>>>>> Thank you very much. I added your changes and now both work like a
>>>>>> charm. But that leads me to another question :-) I don't know if I
>>>>>> should start a new thread, but first I'll try my luck within this
>>>>>> one.
>>>>>>
>>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>>> Therefore I have a special requirement. When the active cell is
>>>>>> the really last one in the grid and the user presses the tab-key a
>>>>>> new record/row should be added to the grid. It's more or less the
>>>>>> same as in MS Word/OO when the user is editing the last cell of a
>>>>>> table and pressing the tab-key automatically adds one new row.
>>>>>>
>>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>>
>>>>>
>>>>> That's not an easy task but doable with some hacks. Because we are
>>>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>>>> feature at JFace level and I don't think GridViewer should
>>>>> introduce an API itself.
>>>>>
>>>>> Having said this you can solve "quite simply" your own and staying
>>>>> with the current API but enhancing it (See the files attached).
>>>>> This is only one solution you could also use Reflection for example.
>>>>>
>>>>> Tom
>>>>>
>>>
>>>
>
>
Re: Grid - Inline Editing [message #589856 is a reply to message #53023] Tue, 13 May 2008 06:48 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
If you have one (a completely runnable) this would make it easier to
track it down (if I can because I'm not so educated when it comes to
Grid's internals but I'll certainly take a look).

Tom

Peter Pfeifer schrieb:
> Unfortunately I'm sure :-) The grid just doesn't scroll to the left,
> when using Shift+Tab.
>
> Should I provide you some code snippets?
>
> Peter
>
> Tom Schindl schrieb:
>> Are you sure for me it worked in my small tests yesterday and because
>> I'm using the Grid-API I don't know what's wrong :-(.
>>
>> Tom
>>
>> Peter Pfeifer schrieb:
>>> Hello Tom.
>>>
>>> Thank you very much, your patch works. Now I can handle "the last
>>> cell in the table".
>>>
>>> But there is another issue I encountered, when traversing through the
>>> grid with horizontal scrollbar visible, due to to some columns aren't
>>> visible because of the width of table. While forward traversing works
>>> how it's supposed to (the grid scrolls to currently active cell)
>>> backward traversing (Shift+Tab) doesn't scroll to the active cell.
>>>
>>> Thnks.
>>>
>>> Peter
>>>
>>>
>>> Tom Schindl schrieb:
>>>> Yes. I think it could make sense at least we should think about how
>>>> this could be solved at the JFace level.
>>>>
>>>> My code is not tested at all so there's the possibility that I
>>>> missed something.
>>>>
>>>> Tom
>>>>
>>>> Peter Pfeifer schrieb:
>>>>> Thank you very much. I'll give this a try tomorrow and let you
>>>>> know. Besides that, would this be a valuable feature/enhancement
>>>>> for future JFace releases?
>>>>>
>>>>> Peter
>>>>>
>>>>> Tom Schindl schrieb:
>>>>>> Peter Pfeifer schrieb:
>>>>>>> Hello Tom.
>>>>>>>
>>>>>>> Thank you very much. I added your changes and now both work like
>>>>>>> a charm. But that leads me to another question :-) I don't know
>>>>>>> if I should start a new thread, but first I'll try my luck within
>>>>>>> this one.
>>>>>>>
>>>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>>>> Therefore I have a special requirement. When the active cell is
>>>>>>> the really last one in the grid and the user presses the tab-key
>>>>>>> a new record/row should be added to the grid. It's more or less
>>>>>>> the same as in MS Word/OO when the user is editing the last cell
>>>>>>> of a table and pressing the tab-key automatically adds one new row.
>>>>>>>
>>>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>>>
>>>>>>
>>>>>> That's not an easy task but doable with some hacks. Because we are
>>>>>> past API-Freeze in JFace 3.4 it is to late to introduce such a
>>>>>> feature at JFace level and I don't think GridViewer should
>>>>>> introduce an API itself.
>>>>>>
>>>>>> Having said this you can solve "quite simply" your own and staying
>>>>>> with the current API but enhancing it (See the files attached).
>>>>>> This is only one solution you could also use Reflection for example.
>>>>>>
>>>>>> Tom
>>>>>>
>>>>
>>>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - Inline Editing [message #589864 is a reply to message #53050] Wed, 14 May 2008 10:54 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 98
Registered: July 2009
Member
Hello Tom.

I tried it with your snippets and it worked. I'll have a look at my
code, seems that I'm missing something.

Thanks,

Peter


Tom Schindl schrieb:
> If you have one (a completely runnable) this would make it easier to
> track it down (if I can because I'm not so educated when it comes to
> Grid's internals but I'll certainly take a look).
>
> Tom
>
> Peter Pfeifer schrieb:
>> Unfortunately I'm sure :-) The grid just doesn't scroll to the left,
>> when using Shift+Tab.
>>
>> Should I provide you some code snippets?
>>
>> Peter
>>
>> Tom Schindl schrieb:
>>> Are you sure for me it worked in my small tests yesterday and because
>>> I'm using the Grid-API I don't know what's wrong :-(.
>>>
>>> Tom
>>>
>>> Peter Pfeifer schrieb:
>>>> Hello Tom.
>>>>
>>>> Thank you very much, your patch works. Now I can handle "the last
>>>> cell in the table".
>>>>
>>>> But there is another issue I encountered, when traversing through
>>>> the grid with horizontal scrollbar visible, due to to some columns
>>>> aren't visible because of the width of table. While forward
>>>> traversing works how it's supposed to (the grid scrolls to currently
>>>> active cell) backward traversing (Shift+Tab) doesn't scroll to the
>>>> active cell.
>>>>
>>>> Thnks.
>>>>
>>>> Peter
>>>>
>>>>
>>>> Tom Schindl schrieb:
>>>>> Yes. I think it could make sense at least we should think about how
>>>>> this could be solved at the JFace level.
>>>>>
>>>>> My code is not tested at all so there's the possibility that I
>>>>> missed something.
>>>>>
>>>>> Tom
>>>>>
>>>>> Peter Pfeifer schrieb:
>>>>>> Thank you very much. I'll give this a try tomorrow and let you
>>>>>> know. Besides that, would this be a valuable feature/enhancement
>>>>>> for future JFace releases?
>>>>>>
>>>>>> Peter
>>>>>>
>>>>>> Tom Schindl schrieb:
>>>>>>> Peter Pfeifer schrieb:
>>>>>>>> Hello Tom.
>>>>>>>>
>>>>>>>> Thank you very much. I added your changes and now both work like
>>>>>>>> a charm. But that leads me to another question :-) I don't know
>>>>>>>> if I should start a new thread, but first I'll try my luck
>>>>>>>> within this one.
>>>>>>>>
>>>>>>>> I want to use the grid/gridtableviewer for quick data entry.
>>>>>>>> Therefore I have a special requirement. When the active cell is
>>>>>>>> the really last one in the grid and the user presses the tab-key
>>>>>>>> a new record/row should be added to the grid. It's more or less
>>>>>>>> the same as in MS Word/OO when the user is editing the last cell
>>>>>>>> of a table and pressing the tab-key automatically adds one new row.
>>>>>>>>
>>>>>>>> Is this also possible to be done with the grid/gridtableviewer?
>>>>>>>>
>>>>>>>
>>>>>>> That's not an easy task but doable with some hacks. Because we
>>>>>>> are past API-Freeze in JFace 3.4 it is to late to introduce such
>>>>>>> a feature at JFace level and I don't think GridViewer should
>>>>>>> introduce an API itself.
>>>>>>>
>>>>>>> Having said this you can solve "quite simply" your own and
>>>>>>> staying with the current API but enhancing it (See the files
>>>>>>> attached). This is only one solution you could also use
>>>>>>> Reflection for example.
>>>>>>>
>>>>>>> Tom
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Previous Topic:Grid tooltips persistence
Next Topic:Grid - Columnheader / JFace Tableviewer Columnheader
Goto Forum:
  


Current Time: Mon Dec 22 07:04:16 GMT 2014

Powered by FUDForum. Page generated in 0.05985 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software