CopyPaste option in GridViewer [message #38914] |
Thu, 23 August 2007 11:21 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
Hello,
I need the copy paste functionality in NebulaGridViewer like MSExcel.
As cell selection is possible in GridViewer i need to copy some selected
cell and then paste it in the same table like MSexcel.
I had a look into clipboard functionality in eclipse where we can do
copypaste but copying the multiple cell and pasting in the same table I am
not getting how to proceed.Also how to enable contextmenu after selecting
multiple cell.
Or Nebula is providing any feature for copypaste?
can anybody help me in this regard?
Thanks in advance
Debasis
|
|
|
Re: CopyPaste option in GridViewer [message #39147 is a reply to message #38914] |
Tue, 28 August 2007 16:52 |
Peter Centgraf Messages: 52 Registered: July 2009 |
Member |
|
|
I haven't worked with Grid, but I have worked with Table and the
clipboard. Someone else will have to correct me if Grid has special
support I don't know about.
A widget like Grid typically does not interact with the clipboard on
your behalf. Your application must provide the appropriate actions to
trigger the clipboard operations, and it must also respond to those
actions by manipulating the clipboard and/or the widget.
In your case, you would need to define and respond to a Copy action.
Your code should loop over the selection within the Grid, copy the
appropriate data into a data structure, and push that data structure
onto the clipboard. You must define exactly what the "appropriate data"
is and what the "data structure" will be. If you only need to move data
within your running application, simple Java object references might be
sufficient. If you want to move data between applications, you will
need to serialize a full representation of the objects. If you want to
exchange data with Excel, you'll have to represent the data in a
clipboard format Excel can understand.
.... Then you must do the reverse, so you can respond to the Paste action.
Currently, the org.eclipse.swt.dnd package includes support for Text,
URL, RTF, HTML, and File Transfers. JFace adds a LocalSelectionTransfer
for moving an ISelection inside an application. The RCP UI adds an
EditorInputTransfer. There is a Windows-specific Transfer subclass for
the standard Win32 clipboard image format. Anything else you might like
to move must be rendered down to a byte array in a custom subclass of
ByteArrayTransfer.
--
Peter
|
|
|
Re: CopyPaste option in GridViewer [message #39301 is a reply to message #39147] |
Tue, 04 September 2007 06:02 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
hello Mr Peter Centgraf,
Thanks for ur reply.
But i need some more clarification.Do I really need to create my own
context menu?can't i get the System menu like what it is coming in the
eclipse problem view.
Also in a GridTableViewer i am creating a combo in a particular column.and
also i need to create in a particular column some textbox and some combo.
but as far as i am concerned we can create one widget type in one column.
either combo or button or simple text.but i need the combination of combo
and text in one column.
If it is a combo my labelprovider is returning a single string i,e
getColumnText.But i need arrays of String which will update my combo
through label provider.
Thanks in advance
Debasis
|
|
|
|
Re: CopyPaste option in GridViewer [message #39394 is a reply to message #39363] |
Wed, 05 September 2007 06:14 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
Hello Mr Tom,
Thanks a lot.I implemented ur suggestion.Now i am populating my combo
through cellmodifier not through labelprovider.
I am also trying to create my combo/text/button in my modifier class.but
it is not creating.because the creation is done only at gridcreation.
This is my code snippet below
editors[3]= new ComboCellEditor(confGridViewer.getGrid());it is creating
the combo.
but is it feasible to create the combo/text in a particular column in my
modifier class.but if i will set the cellEditors as ComboCellEditor during
grid creation then i am wondering how it will create text/button for that
particular column in the modifier class?
but eclipse properties view is having the feature of creating the
combo/text/button in a single column on demand.
Thanks in advance
Debasis
|
|
|
|
Re: CopyPaste option in GridViewer [message #39455 is a reply to message #39425] |
Wed, 05 September 2007 11:02 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
Hello Mr Tom,
Thanks a lot for the link.Thanks a lot for the very quick reply.
I tried out all the snippet.It is simple in eclipse 3.3 by using
EditingSupport.currently i am also using eclipse europa and
NebulaGridTableViewer.I will implement this in my project.
one more clarification i need that- is NebulaGridTableViewer providing
any option for CopyPaste?.Actually i need to copy some selected cell and i
need to paste it in different cell(means my domain object i need to copy
what i am displaying in the table.)
Can I enable the context menu(i,e global context menu for
copy,paste,delete,select all,properties).I will not create my own context
menu.is there any way to get the context menu from workbench.mean to say
is there any contribution form eclipse?
Thanks in advance
Debasis
|
|
|
Re: CopyPaste option in GridViewer [message #39486 is a reply to message #39455] |
Wed, 05 September 2007 14:48 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
Hello Mr Tom,
I am trying to get the context menu in my tableviewer through
MenuManager.but not getting that.
The code snippet is given below
MenuManager mgr = new MenuManager();
mgr.add(
new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)
); // needed for later contributions
problemViewer.getTable().setMenu(mgr.createContextMenu(probl emViewer.getTable()));
Could u please tell me if am missing something any where.?
Thanks in advance
Debasis
|
|
|
|
Re: CopyPaste option in GridViewer [message #584299 is a reply to message #38914] |
Tue, 28 August 2007 16:52 |
Peter Centgraf Messages: 52 Registered: July 2009 |
Member |
|
|
I haven't worked with Grid, but I have worked with Table and the
clipboard. Someone else will have to correct me if Grid has special
support I don't know about.
A widget like Grid typically does not interact with the clipboard on
your behalf. Your application must provide the appropriate actions to
trigger the clipboard operations, and it must also respond to those
actions by manipulating the clipboard and/or the widget.
In your case, you would need to define and respond to a Copy action.
Your code should loop over the selection within the Grid, copy the
appropriate data into a data structure, and push that data structure
onto the clipboard. You must define exactly what the "appropriate data"
is and what the "data structure" will be. If you only need to move data
within your running application, simple Java object references might be
sufficient. If you want to move data between applications, you will
need to serialize a full representation of the objects. If you want to
exchange data with Excel, you'll have to represent the data in a
clipboard format Excel can understand.
.... Then you must do the reverse, so you can respond to the Paste action.
Currently, the org.eclipse.swt.dnd package includes support for Text,
URL, RTF, HTML, and File Transfers. JFace adds a LocalSelectionTransfer
for moving an ISelection inside an application. The RCP UI adds an
EditorInputTransfer. There is a Windows-specific Transfer subclass for
the standard Win32 clipboard image format. Anything else you might like
to move must be rendered down to a byte array in a custom subclass of
ByteArrayTransfer.
--
Peter
|
|
|
Re: CopyPaste option in GridViewer [message #584374 is a reply to message #39147] |
Tue, 04 September 2007 06:02 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
hello Mr Peter Centgraf,
Thanks for ur reply.
But i need some more clarification.Do I really need to create my own
context menu?can't i get the System menu like what it is coming in the
eclipse problem view.
Also in a GridTableViewer i am creating a combo in a particular column.and
also i need to create in a particular column some textbox and some combo.
but as far as i am concerned we can create one widget type in one column.
either combo or button or simple text.but i need the combination of combo
and text in one column.
If it is a combo my labelprovider is returning a single string i,e
getColumnText.But i need arrays of String which will update my combo
through label provider.
Thanks in advance
Debasis
|
|
|
|
Re: CopyPaste option in GridViewer [message #584425 is a reply to message #39363] |
Wed, 05 September 2007 06:14 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
Hello Mr Tom,
Thanks a lot.I implemented ur suggestion.Now i am populating my combo
through cellmodifier not through labelprovider.
I am also trying to create my combo/text/button in my modifier class.but
it is not creating.because the creation is done only at gridcreation.
This is my code snippet below
editors[3]= new ComboCellEditor(confGridViewer.getGrid());it is creating
the combo.
but is it feasible to create the combo/text in a particular column in my
modifier class.but if i will set the cellEditors as ComboCellEditor during
grid creation then i am wondering how it will create text/button for that
particular column in the modifier class?
but eclipse properties view is having the feature of creating the
combo/text/button in a single column on demand.
Thanks in advance
Debasis
|
|
|
|
Re: CopyPaste option in GridViewer [message #584447 is a reply to message #39425] |
Wed, 05 September 2007 11:02 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
Hello Mr Tom,
Thanks a lot for the link.Thanks a lot for the very quick reply.
I tried out all the snippet.It is simple in eclipse 3.3 by using
EditingSupport.currently i am also using eclipse europa and
NebulaGridTableViewer.I will implement this in my project.
one more clarification i need that- is NebulaGridTableViewer providing
any option for CopyPaste?.Actually i need to copy some selected cell and i
need to paste it in different cell(means my domain object i need to copy
what i am displaying in the table.)
Can I enable the context menu(i,e global context menu for
copy,paste,delete,select all,properties).I will not create my own context
menu.is there any way to get the context menu from workbench.mean to say
is there any contribution form eclipse?
Thanks in advance
Debasis
|
|
|
Re: CopyPaste option in GridViewer [message #584461 is a reply to message #39455] |
Wed, 05 September 2007 14:48 |
Eclipse User |
|
|
|
Originally posted by: Debasis.Mishra.in.bosch.com
Hello Mr Tom,
I am trying to get the context menu in my tableviewer through
MenuManager.but not getting that.
The code snippet is given below
MenuManager mgr = new MenuManager();
mgr.add(
new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)
); // needed for later contributions
problemViewer.getTable().setMenu(mgr.createContextMenu(probl emViewer.getTable()));
Could u please tell me if am missing something any where.?
Thanks in advance
Debasis
|
|
|
|
Powered by
FUDForum. Page generated in 0.06121 seconds