Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » [NEON] Drag & Drop
[NEON] Drag & Drop [message #1721707] Fri, 29 January 2016 10:30 Go to next message
Silvio Kohler is currently offline Silvio KohlerFriend
Messages: 31
Registered: October 2015
Member
Hi

Drag & Drop seems to be implemented in the new HTML UI, as it was in previous versions of Scout.
Unfortunately, I couldn't make it work.

Here's my test case:
A form with to TableFields (From, To).
The FromTableField implements execDrag, the ToTableField implements execDrop. See the code below.

When I start the application and try drag a row with the mouse, "nothing happens".
- There is no visual feedback that "the mouse pointer is dragging/holding the row".
- By debugging, I couldn't see any event from the UI. "execDrag" was not called. Also, there was no TableEvent.TYPE_ROWS_DRAG_REQUEST catched by the TableListener that is attached to the table in AbstractTable.initConfig(). I guess this is the place where the UI event should be catched and delegated to execDrag.

Is something wrong with my code? Or is this feature not yet fully implemented for the new UI?

Code:
public class HeaderBox extends AbstractGroupBox {

			@Order(1000.0)
			public class FromTableField extends AbstractTableField<FromTableField.Table> {
				
				public class Table extends AbstractTable {
					
					public NameColumn getNameColumn() {
						return getColumnSet().getColumnByClass(NameColumn.class);
					}

					@Override
					protected int getConfiguredDragType() {
						return IDNDSupport.TYPE_JAVA_ELEMENT_TRANSFER;
					}
					
					
					@Override
					protected TransferObject execDrag(List<ITableRow> rows) {
						List<String> values = getNameColumn().getValues(rows);
						return new JavaTransferObject(values);
					}

					@Order(1000.0)
					public class NameColumn extends AbstractStringColumn {
						@Override
						protected String getConfiguredHeaderText() {
							return TEXTS.get("Name");
						}

						@Override
						protected int getConfiguredWidth() {
							return 100;
						}
					}
					
					
				}

				@Override
				protected String getConfiguredLabel() {
					return TEXTS.get("from");
				}
				
				@Override
				protected int getConfiguredGridH() {
					return 6;
				}
			}

			@Order(2000.0)
			public class ToTableField extends AbstractTableField<ToTableField.Table> {
				public class Table extends AbstractTable {
					
					public NameColumn getNameColumn() {
						return getColumnSet().getColumnByClass(NameColumn.class);
					}

					@Override
					protected int getConfiguredDropType() {
						return IDNDSupport.TYPE_JAVA_ELEMENT_TRANSFER;
					}

					@Order(1000.0)
					public class NameColumn extends AbstractStringColumn {
						@Override
						protected String getConfiguredHeaderText() {
							return TEXTS.get("Name");
						}

						@Override
						protected int getConfiguredWidth() {
							return 100;
						}
					}
					
					@Override
					protected void execDrop(ITableRow row, TransferObject t) {
						if (t instanceof JavaTransferObject) {
							JavaTransferObject jt = (JavaTransferObject)t;
							List<String> localObjectAsList = jt.getLocalObjectAsList(String.class);
							for (String string : localObjectAsList) {
								addRowByArray(new String[]{string});
							}
						}
					}
				}

				@Override
				protected String getConfiguredLabel() {
					return TEXTS.get("to");
				}

				@Override
				protected int getConfiguredGridH() {
					return 6;
				}
			}
			
		}
Re: [NEON] Drag & Drop [message #1722175 is a reply to message #1721707] Wed, 03 February 2016 08:58 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 169
Registered: March 2010
Senior Member
Hi Silvio

The current version only supports Drag & Drop for file upload. That means you can drag a file from your desktop and drop it on a table, tree, image or filechooser field.
Drag and Drop inside the application (like from one table to another) has not been implemented yet.
Re: [NEON] Drag & Drop [message #1724491 is a reply to message #1722175] Wed, 24 February 2016 08:53 Go to previous messageGo to next message
Silvio Kohler is currently offline Silvio KohlerFriend
Messages: 31
Registered: October 2015
Member
Do you already know when application-internal D&D will be implemented?

It is not urgent for us, but it's important to know IF and WHEN it will be available.

Thanks
Re: [NEON] Drag & Drop [message #1780951 is a reply to message #1724491] Tue, 30 January 2018 10:23 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 25
Registered: July 2014
Junior Member
I am interested in this as well. Has it been implemented yet?
Re: [NEON] Drag & Drop [message #1782220 is a reply to message #1780951] Tue, 20 February 2018 14:57 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 169
Registered: March 2010
Senior Member
Hi

I am sorry to say that this feature is still not implemented yet and it is not planned to implement it in the near future.

Could you describe your use case? Do you need D&D for a table or another widget? Do you want to reorder table rows or drag a row from one table to another?

Kind regards
Claudio
Re: [NEON] Drag & Drop [message #1782274 is a reply to message #1782220] Wed, 21 February 2018 08:07 Go to previous message
A N is currently offline A NFriend
Messages: 25
Registered: July 2014
Junior Member
Claudio Guglielmo wrote on Tue, 20 February 2018 14:57
Hi

I am sorry to say that this feature is still not implemented yet and it is not planned to implement it in the near future.

Could you describe your use case? Do you need D&D for a table or another widget? Do you want to reorder table rows or drag a row from one table to another?

Kind regards
Claudio


Thanks for the response.

In our use case it would be beneficial for the usability of the application if the user could D&D a row from one table to another. Its just more intuitive to work with.

[Updated on: Wed, 21 February 2018 08:09]

Report message to a moderator

Previous Topic:org.eclipse.equinox.launcher
Next Topic:NodePage - DetailForm - Veto Form desactivation
Goto Forum:
  


Current Time: Sat Sep 22 17:49:11 GMT 2018

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

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

Back to the top