[NEON] Drag & Drop [message #1721707] |
Fri, 29 January 2016 05:30  |
Eclipse User |
|
|
|
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 #1847303 is a reply to message #1782274] |
Fri, 22 October 2021 05:45  |
Eclipse User |
|
|
|
Hello,
I am working on the Eclipse scout 11 version and D&D from table to table is not implemented, I wished that this functionality was implemented becuase .
Hope for next release.
Kind Regards
|
|
|
Powered by
FUDForum. Page generated in 0.04060 seconds