Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Drag & Drop issue ?(Question about drag & drop support, especially for RAP/RCP targets)
Drag & Drop issue ? [message #1058829] Wed, 15 May 2013 06:07 Go to next message
Marco Persi is currently offline Marco Persi
Messages: 1
Registered: May 2013
Junior Member
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
Re: Drag & Drop issue ? [message #1059167 is a reply to message #1058829] Fri, 17 May 2013 02:13 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 657
Registered: October 2011
Senior Member
Hi,

We execpect the different renderer (Swing, SWT, RAP) to behave similarly. I will try your code... It can be a bug/limitation.

I will try to look into it.
icon3.gif  Re: Drag & Drop issue ? [message #1234093 is a reply to message #1059167] Tue, 21 January 2014 03:18 Go to previous messageGo to next message
marco giudici is currently offline marco giudici
Messages: 121
Registered: February 2013
Senior Member
Hi all,
I try to implement drag-drop function on AbstractTableField, for this reason I follow this tutorial : http://wiki.eclipse.org/Scout/HowTo/3.9/Drag_and_drop_support

This implementation works fine, now I need to understand how to get the position of the drop to insert the moved item, because my goal is to move to a specific line in a new position in the table (see image below).

index.php/fa/17296/0/

Is it possible do somethings of this? And how?

Thanks a lot for any help
  • Attachment: Table.jpg
    (Size: 11.72KB, Downloaded 92 times)
Re: Drag & Drop issue ? [message #1234101 is a reply to message #1234093] Tue, 21 January 2014 03:39 Go to previous messageGo to next message
Matthias Nick is currently offline Matthias Nick
Messages: 163
Registered: August 2013
Senior Member
Hi marco,

correct me if I am wrong: What you want to know is on which position the dragged item currently is (is it over element "The Administrator", is it over element "The Manager"), correct?
If so, there is a Bug related to this: Bug 416818. Once this bug is resolved you will be able to get exactly this information.

Best regards,
Matthias

[Updated on: Tue, 21 January 2014 03:40]

Report message to a moderator

Re: Drag & Drop issue ? [message #1234104 is a reply to message #1234101] Tue, 21 January 2014 03:42 Go to previous message
marco giudici is currently offline marco giudici
Messages: 121
Registered: February 2013
Senior Member
Yes correct, is what I want to know.
Previous Topic:Is it possible to export just the server product
Next Topic:SWT product ignoring initial size and save and restore
Goto Forum:
  


Current Time: Thu Aug 21 10:16:22 EDT 2014

Powered by FUDForum. Page generated in 0.02139 seconds