Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Layouts should have Position Change Notification support #2

Open
johndevs opened this issue Aug 9, 2013 · 1 comment

Comments

@johndevs
Copy link
Contributor

johndevs commented Aug 9, 2013

Reported by michael.vorburger, Aug 20, 2012

First of all, thank you so much for dragdroplayouts - it's really great!

One thing I feel is missing (this is an Improvement request/suggestion, not a bug report) is some kind of support for Position Change Event Notification...

Today, if one uses dragdroplayouts to write some sort of UI designer toolkit along the lines of what I've been experimenting with on http://blog2.vorburger.ch/2012/08/vaadin-emf-eclipse-data-binding.html, you have to us a DropHandler to know when things get moved. - In an ideal world, I'd like to be able to register a Listener that gets called on a position change event -- I'm sure you know what I mean?

I've be playing quite a bit with this myself this past week-end, and wanted to let you know about it - in case you're interested in picking this up for integration into dragdroplayouts?

https://github.com/vorburger/MUI/blob/master/ch.vorburger.vaadin.designer/src/ch/vorburger/vaadin/beans/dragdroplayouts/DDAbsoluteLayoutWithBeanPositionChange.java is the solution I ultimately went for & am using. Basically, as you'll see in the code, I've created a small new dedicated ComponentPosition... wrapper class for left/top pos, which one passes to a new addComponent() variant. My ComponentPosition... is a JavaBean with change notification support. I realize this is not exactly "the Vaadin way".

https://github.com/vorburger/MUI/blob/master/ch.vorburger.vaadin.designer/src/ch/vorburger/vaadin/beans/dragdroplayouts/DDAbsoluteLayoutWithBeanPositionChangeImpossibleImplementation.java was an earlier attempt the design is quite similar to above, but here the ComponentPositionWithPropertyChangeNotifier extends ComponentPosition. However due to Vaadin Core limitation of not having been designed with ComponentPosition subclassing in mind, I don't think this approach is feasible without modifiying Vaadin Core.

https://github.com/vorburger/MUI/blob/master/ch.vorburger.vaadin.designer/src/ch/vorburger/vaadin/dragdroplayouts/event/DDAbsoluteLayoutWithPositionChange.java was again an alternative / first attempt, using Vaadin-style instead of JavaBean-style Event notification (on the Layout instead of new Position class), futile for similar reason as above.

(Issue moved from https://code.google.com/p/dragdroplayouts/issues/detail?id=11)

@vorburger
Copy link

Hi John! Thanks for having moved this old issue. FYI, I've since moved on to more pure-JS experiments.. see e.g. http://blog2.vorburger.ch/2013/07/catching-up-on-javascript-toying-with.html & http://blog2.vorburger.ch/2013/07/mui-v001-dynamic-form-builder-based-on.html ... (just FYI, not really related to this issue at all). Best, Michael.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants