Hi Gilad,
to my understanding, we already use _HTML5_ Drag'n'Drop support
(exposed by GWT API since 2.4) in "Setup Host Networks" dialog.
To utilize HTML5 Drag'n'Drop support in GWT widget, just extend
FocusPanel and mark your widget's DOM element as "draggable".
For example, in UnassignedNetworksPanel constructor:
getElement().setDraggable( ... );
addBitlessDomHandler(new DragEnterHandler() { ... });
addBitlessDomHandler(new DragOverHandler() { ... });
addBitlessDomHandler(new DragLeaveHandler() { ... });
addBitlessDomHandler(new DropHandler() { ... });
In other words, GWT already exposes API for working with HTML5
Drag'n'Drop spec, so you don't need any 3rd party libraries.
The downside is that HTML5 Drag'n'Drop spec is supported only
in recent browsers (but this isn't an issue for us, AFAIK):
http://caniuse.com/#feat=dragndrop
So in general we have two alternatives:
1, use standard HTML5 Drag'n'Drop spec
pros:
+ no need for 3rd party library
+ compliant with existing code, i.e. "Setup Host Networks"
cons (not too relevant IMHO):
- requires browser support of HTML5 Drag'n'Drop spec
- HTML5 Drag'n'Drop spec deals with dragging data, not widgets
themselves (no HTML DOM re-parenting after drag finish)
2, use 3rd party gwt-dnd library
pros (which I don't think we really need):
+ emulate Drag'n'Drop support in older browsers
+ more advanced functionality, i.e. allows dragging widgets
so that HTML DOM is dynamically updated
cons:
- dependency on 3rd party library
- this would mean we need to revisit existing code
(we should do Drag'n'Drop in one consistent way)
It's possible that I might be missing something, but I'd
suggest to try using HTML5 Drag'n'Drop via GWT API as the
first approach.
If we find out that HTML5 Drag'n'Drop doesn't work for us
in given browser(s) or if we need extra functionality, we
can always add gwt-dnd dependency.
Few more comments inline, let me know what you think.
Regards,
Vojtech
----- Original Message -----
From: "Alexander Wels" <awels(a)redhat.com>
To: "Gilad Chaplik" <gchaplik(a)redhat.com>
Cc: ecohen(a)redhat.com, "Vojtech Szocs" <vszocs(a)redhat.com>,
dfediuck(a)redhat.com, engine-devel(a)ovirt.org, "chegu
vinod" <chegu_vinod(a)hp.com>, lvernia(a)redhat.com
Sent: Tuesday, April 1, 2014 7:24:12 PM
Subject: Re: NUMA Support - GUI Technical Session
On Tuesday, April 01, 2014 11:34:43 AM Gilad Chaplik wrote:
> Hi all,
>
> Here are the resolutions from the meeting:
>
> * option 1
> 1) Use gwt-dnd lib for oVirt's dnd (drag and drop) infrastructure.
> 2) Come up with a very simple POC that covers all of NUMA-support UX
> requirements. 3) Either do a POC, or get UX maintainers approval, that
> moving already existing dnd features to new infrastructure (setup-networks
> and scheduling policy dialogs) is feasible and possible.
>
+1 for option 1. None of the drag and drop in the application now looks
terribly hard. The gwt-dnd library simply makes things easier to control and
maintain.
Yeah, but the downside is adding 3rd party dependency which predates GWT's
support for (API exposure of) HTML5 Drag'n'Drop spec.
> * option 2
> Extract setup network dnd capabilities to a common general infrastructure
> and use that as an infrastructure. NOTE that setup-networks will not use it
> in oVirt-3.5.
GWT's HTML5 Drag'n'Drop API works directly on DOM element level, it's
just
a thin API overlay on top of HTML5Drag'n'Drop spec.
Do we really need custom DnD infra on top of that? Can't we just use GWT
APIs like Element.setDraggable, Drag*Handler, Drop*Handler?
>
> I will start with option 1, just need UX team approval that [1] will be
> added to ovirt-3.5, and be used for dnd for now on. In case I fail to
> deliver option 1 (with the help and guidance of the UX team) in a quick
> cycle (a week or so), I will peruse option 2, which is trivial.
>
> Moving forward, all new dnd enabled features will use the new
> infrastructure, and the motivation is to migrate existing ones as well.
I agree, there should be one consistent way to do DnD in oVirt UI.
I'm just saying we should consider existing GWT HTML5 Drag'n'Drop API
before jumping into gwt-dnd 3rd party dependency. If it turns out that
GWT DnD API is too basic (lacks functionality) or has issues with some
browser(s) - we can add gwt-dnd dependency anytime.
>
> Thanks,
> Gilad.
>
> [1]
http://code.google.com/p/gwt-dnd/
>
> ----- Original Message -----
>
> > From: "Gilad Chaplik" <gchaplik(a)redhat.com>
> > To: "Einav Cohen" <ecohen(a)redhat.com>, "Alexander
Wels"
> > <awels(a)redhat.com>, "Eyal Edri" <eedri(a)redhat.com>,
"Steve Gordon"
> > <sgordon(a)redhat.com>, "Eli Mesika" <emesika(a)redhat.com>,
"Otavio Luiz
> > Ferranti" <otavio.ferranti(a)eldorado.org.br>, "Sandro
Bonazzola"
> > <sbonazzo(a)redhat.com>, "Greg Sheremeta"
<gshereme(a)redhat.com>, "Doron
> > Fediuck" <dfediuck(a)redhat.com>, "Lior Vernia"
<lvernia(a)redhat.com>,
> > "engine-devel" <engine-devel(a)ovirt.org>, "Martin
Sivak"
> > <msivak(a)redhat.com>, "chuan liao" <chuan.liao(a)hp.com>,
"xiao-lei shi"
> > <xiao-lei.shi(a)hp.com>, "chegu vinod"
<chegu_vinod(a)hp.com>, "da-huai tang"
> > <da-huai.tang(a)hp.com>
> > Sent: Sunday, March 30, 2014 2:06:59 AM
> > Subject: NUMA Support - GUI Technical Session
> >
> > The following meeting has been modified:
> >
> > Subject: NUMA Support - GUI Technical Session [MODIFIED]
> > Organizer: "Gilad Chaplik" <gchaplik(a)redhat.com>
> >
> > Time: Tuesday, April 1, 2014, 5:00:00 PM - 6:00:00 PM GMT +02:00
> > Jerusalem
> > [MODIFIED]
> >
> > Required: ecohen(a)redhat.com; awels(a)redhat.com; eedri(a)redhat.com;
> > sgordon(a)redhat.com; emesika(a)redhat.com; otavio.ferranti(a)eldorado.org.br;
> > sbonazzo(a)redhat.com; gshereme(a)redhat.com
> > Optional: dfediuck(a)redhat.com; lvernia(a)redhat.com;
> > engine-devel(a)ovirt.org;
> > msivak(a)redhat.com; chuan.liao(a)hp.com; xiao-lei.shi(a)hp.com;
> > chegu_vinod(a)hp.com; da-huai.tang(a)hp.com
> >
> > *~*~*~*~*~*~*~*~*~*
> >
> > We will discuss on how to implement NUMA support GUI in oVirt for version
> > 3.5 (see attached sketches).
> >
> > Agenda:
> > 1) Brainstorming
> > 2) Resolution
> > 3) Split work/tasks among volunteers :)
> >
> > GUI maintainers please join-in.
> >
> > Bluejeans (video conference) session to follow [maybe], currently dial
> > in:
> >
> >
https://www.intercallonline.com/listNumbersByCode.action?confCode=71288674
> > 05
> >
> > conf id: 712 886 7405#