Drag & Drop issue ? [message #1058829] |
Wed, 15 May 2013 06:07  |
Eclipse User |
|
|
|
Hi,
actually I was trying to create a fairly simple drag & drop support for my app. However, didn't get the handlers firing, so I have set up an empty app, only a table with fix data and even there, for RCP & RAP targets, the listeners are not fired. All working for Swing.
Environment:
Scout SDK 3.8.2.201302111336
Eclipse Version: Juno Service Release 2 Build id: 20130225-0426
Below is the most primitive sample code but it is anyway pretty much according the the Scout howTo description of adding drag&drop support.
According to this sample code, I'd have expected to see a "fire drag" in the sysout ; that is true for Swing but not for SWT/RAP targets.
Did I miss something or could this be a bug ?
package outline.client.ui.desktop.outlines.pages;
import org.eclipse.scout.commons.annotations.ConfigProperty;
import org.eclipse.scout.commons.annotations.ConfigPropertyValue;
import org.eclipse.scout.commons.annotations.Order;
import org.eclipse.scout.commons.dnd.TransferObject;
import org.eclipse.scout.commons.exception.ProcessingException;
import org.eclipse.scout.rt.client.ui.basic.table.AbstractTable;
import org.eclipse.scout.rt.client.ui.basic.table.ITableRow;
import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumn;
import org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithTable;
import org.eclipse.scout.rt.shared.TEXTS;
import org.eclipse.scout.rt.shared.services.common.jdbc.SearchFilter;
import org.eclipse.scout.service.SERVICES;
import outline.shared.services.outline.IStandardOutlineService;
public class PersonsTablePage extends AbstractPageWithTable<PersonsTablePage.Table> {
@Override
protected String getConfiguredTitle() {
return TEXTS.get("Persons");
}
@Override
protected Object[][] execLoadTableData(SearchFilter filter) throws ProcessingException {
return SERVICES.getService(IStandardOutlineService.class).getPersons();
}
@Order(10.0)
public class Table extends AbstractTable {
@Override
@ConfigProperty("DRAG_AND_DROP_TYPE")
@Order(190.0)
@ConfigPropertyValue("0")
protected int getConfiguredDropType() {
return TYPE_TEXT_TRANSFER | TYPE_FILE_TRANSFER | TYPE_IMAGE_TRANSFER | TYPE_JAVA_ELEMENT_TRANSFER;
}
@Override
protected int getConfiguredDragType() {
return TYPE_TEXT_TRANSFER;
}
public SurNameColumn getSurNameColumn() {
return getColumnSet().getColumnByClass(SurNameColumn.class);
}
@Override
protected TransferObject execCopy(ITableRow[] rows) throws ProcessingException {
System.out.println("fired copy");
return null;
}
@Override
protected TransferObject execDrag(ITableRow[] rows) throws ProcessingException {
System.out.println("fired drag");
return null;
}
@Override
protected void execDrop(ITableRow row, TransferObject t) throws ProcessingException {
System.out.println("fired drop");
}
public FirstnameColumn getFirstnameColumn() {
return getColumnSet().getColumnByClass(FirstnameColumn.class);
}
@Order(10.0)
public class FirstnameColumn extends AbstractStringColumn {
@Override
protected String getConfiguredHeaderText() {
return TEXTS.get("Firstname");
}
}
@Order(20.0)
public class SurNameColumn extends AbstractStringColumn {
@Override
protected String getConfiguredHeaderText() {
return TEXTS.get("SurName");
}
}
}
}
thanx guys
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02972 seconds