tomivirkki / carousel Goto Github PK
View Code? Open in Web Editor NEWCarousel component for Vaadin 7. Source code in Xtend.
Carousel component for Vaadin 7. Source code in Xtend.
Carousel.getComponentCount() is not returning the correct number of components.
I have 1 component (A vertical layout) in the carousel but it is turning 0 for getComponentCount method.
At least in the demo after I scroll from one component to another - an empty TD is left in the DOM structure. After a while - there's an enormous amount of those elements and the component becomes sluggish.
Hi,
I get the following errors when I compile Widgetset, I use Vaadin 7.5.5:
Added 3999 units to cache since last cleanup.
Tracing compile failure path for type 'org.eclipse.xtext.xbase.lib.IteratorExtensions'
Errors in 'jar:file:/C:/Users/Guillaume/.ivy2/cache/org.eclipse.xtext/org.eclipse.xtext.xbase.lib.gwt/jars/org.eclipse.xtext.xbase.lib.gwt-2.4.0.jar!/org/eclipse/xtext/xbase/lib/IteratorExtensions.java'
Line 308: The method filter(Iterator, Predicate) in the type Iterators is not applicable for the arguments (Iterator, Class)
Tracing compile failure path for type 'com.google.common.collect.ImmutableSortedMap'
Errors in 'jar:file:/C:/Users/Guillaume/.ivy2/cache/com.google.guava/guava-gwt/jars/guava-gwt-10.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java'
Line 122: Name clash: The method copyOf(Map) of type ImmutableSortedMap has the same erasure as copyOf(Map) of type ImmutableMap but does not hide it
Errors in 'jar:file:/C:/Users/Guillaume/.ivy2/cache/com.google.guava/guava-gwt/jars/guava-gwt-10.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java'
Line 139: Name clash: The method copyOf(Collection) of type ImmutableSortedSet has the same erasure as copyOf(Collection) of type ImmutableSet but does not hide it
Line 144: Name clash: The method copyOf(Iterable) of type ImmutableSortedSet has the same erasure as copyOf(Iterable) of type ImmutableSet but does not hide it
Line 149: Name clash: The method copyOf(Iterator) of type ImmutableSortedSet has the same erasure as copyOf(Iterator) of type ImmutableSet but does not hide it
Tracing compile failure path for type 'org.eclipse.xtext.xbase.lib.util.ToStringHelper'
Errors in 'jar:file:/C:/Users/Guillaume/.ivy2/cache/org.eclipse.xtext/org.eclipse.xtext.xbase.lib.gwt/jars/org.eclipse.xtext.xbase.lib.gwt-2.4.0.jar!/org/eclipse/xtext/xbase/lib/util/ToStringHelper.java'
Line 156: The method isAnonymousClass() is undefined for the type Class
Line 207: The method getDeclaredFields() is undefined for the type Class
Tracing compile failure path for type 'com.google.common.collect.ImmutableSortedSet'
Errors in 'jar:file:/C:/Users/Guillaume/.ivy2/cache/com.google.guava/guava-gwt/jars/guava-gwt-10.0.1.jar!/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java'
Line 139: Name clash: The method copyOf(Collection) of type ImmutableSortedSet has the same erasure as copyOf(Collection) of type ImmutableSet but does not hide it
Line 144: Name clash: The method copyOf(Iterable) of type ImmutableSortedSet has the same erasure as copyOf(Iterable) of type ImmutableSet but does not hide it
Line 149: Name clash: The method copyOf(Iterator) of type ImmutableSortedSet has the same erasure as copyOf(Iterator) of type ImmutableSet but does not hide it
Tracing compile failure path for type 'org.eclipse.xtext.xbase.lib.util.ReflectExtensions'
Errors in 'jar:file:/C:/Users/Guillaume/.ivy2/cache/org.eclipse.xtext/org.eclipse.xtext.xbase.lib.gwt/jars/org.eclipse.xtext.xbase.lib.gwt-2.4.0.jar!/org/eclipse/xtext/xbase/lib/util/ReflectExtensions.java'
Line 145: The method isInstance(Object) is undefined for the type Class
Line 131: The method getMethod(String, Class[]) is undefined for the type Class
Line 78: The method getDeclaredField(String) is undefined for the type Class
Line 113: The method getDeclaredMethods() is undefined for the type Class<capture#13-of ? extends Object>
Removing invalidated units
Thank for your help
Willy
Hi. First of all: Nice work.
Is there a way to set more than one component on on page? e.g. I have 50 pics and I want to have 10 on one page and if I scroll, the next 10 apear.
It would be nice if you could implement such an feature.
Regards,
Christoph
Hi Tomi! Thanks for you nice addon. I cant compile your addon here. Im using Vaadin 7.0.4 (Maven based project).
I've alread excluded GWT Unit Cache files, but I got this problem in widgetset compilation:
[INFO] --- vaadin-maven-plugin:7.0.4:compile (default) @ controleatividades ---
[INFO] auto discovered modules [br.com.h4.controleatividades.AppWidgetSet]
[INFO] Compiling module br.com.h4.controleatividades.AppWidgetSet
[INFO] Validating units:
[INFO] [ERROR] Errors in 'jar:file:/home/eduardo/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib.gwt/2.4.0/org.eclipse.xtext.xbase.lib.gwt-2.4.0.jar!/org/eclipse/xtext/xbase/lib/IteratorExtensions.java'
[INFO] [ERROR] Line 308: The method filter(Iterator, Predicate) in the type Iterators is not applicable for the arguments (Iterator, Class)
[INFO] [ERROR] Errors in 'jar:file:/home/eduardo/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib.gwt/2.4.0/org.eclipse.xtext.xbase.lib.gwt-2.4.0.jar!/org/eclipse/xtext/xbase/lib/util/ReflectExtensions.java'
[INFO] [ERROR] Line 39: No source code is available for type java.lang.SecurityException; did you forget to inherit a required module?
[INFO] [ERROR] Line 39: No source code is available for type java.lang.NoSuchFieldException; did you forget to inherit a required module?
[INFO] [ERROR] Line 39: No source code is available for type java.lang.IllegalAccessException; did you forget to inherit a required module?
[INFO] [ERROR] Line 43: No source code is available for type java.lang.reflect.Field; did you forget to inherit a required module?
[INFO] [ERROR] Line 78: The method getDeclaredField(String) is undefined for the type Class<capture#8-of ?>
[INFO] [ERROR] Line 105: No source code is available for type java.lang.reflect.InvocationTargetException; did you forget to inherit a required module?
[INFO] [ERROR] Line 111: No source code is available for type java.lang.reflect.Method; did you forget to inherit a required module?
[INFO] [ERROR] Line 113: The method getDeclaredMethods() is undefined for the type Class<capture#13-of ? extends Object>
[INFO] [ERROR] Line 131: The method getMethod(String, Class[]) is undefined for the type Class
[INFO] [ERROR] Line 145: The method isInstance(Object) is undefined for the type Class
[INFO] [ERROR] Errors in 'jar:file:/home/eduardo/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib.gwt/2.4.0/org.eclipse.xtext.xbase.lib.gwt-2.4.0.jar!/org/eclipse/xtext/xbase/lib/util/ToStringHelper.java'
[INFO] [ERROR] Line 72: No source code is available for type java.lang.ThreadLocal; did you forget to inherit a required module?
[INFO] [ERROR] Line 106: No source code is available for type java.lang.reflect.Field; did you forget to inherit a required module?
[INFO] [ERROR] Line 108: The method getSimpleName() is undefined for the type Class<capture#3-of ? extends Object>
[INFO] [ERROR] Line 124: The method getSimpleName() is undefined for the type Class<capture#4-of ? extends Object>
[INFO] [ERROR] Line 134: No source code is available for type java.lang.reflect.Modifier; did you forget to inherit a required module?
[INFO] [ERROR] Line 141: The method getSimpleName() is undefined for the type Class<capture#5-of ? extends Exception>
[INFO] [ERROR] Line 156: The method isAnonymousClass() is undefined for the type Class<capture#7-of ? extends Object>
[INFO] [ERROR] Line 156: The method getSimpleName() is undefined for the type Class<capture#8-of ? extends Object>
[INFO] [ERROR] Line 207: The method getDeclaredFields() is undefined for the type Class<capture#14-of ?>
[INFO] [ERROR] Aborting compile due to errors in some input files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.627s
[INFO] Finished at: Mon Apr 22 14:36:32 BRT 2013
[INFO] Final Memory: 26M/399M
[INFO] ------------------------------------------------------------------------
...
Steps to reproduce:
Create a new Vaadin Project with Maven:
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.0.4 -DgroupId=your.company -DartifactId=project-name -Dversion=1.0 -Dpackaging=war
Addon the plugin depedency on pom:
org.vaadin.virkki
carousel
0.5.2
Is somethind that I'm doint wrong? I only added the plugin dependency on my POM.XML
Thanks!
The animation skips the first half of the range, and starts at about half-way. Sometimes the whole animation skipped. Only encounteres on firefox (tested on version 21). Deactivate your firebug while testing, because somehow it change the result.
My snippet:
private int depth=1; protected void init(final VaadinRequest request) { final HorizontalCarousel c = new HorizontalCarousel(); c.setSizeFull(); c.addComponent(buildPanel()); c.setTransitionDuration(200); c.setLoadMode(CarouselLoadMode.EAGER); final Button b = new Button("push", new Button.ClickListener() { @Override public void buttonClick(final Button.ClickEvent event) { final Panel p = buildPanel(); c.addComponent(p); c.scroll(1); c.requestWidgets(depth++); } }); VerticalLayout vl = new VerticalLayout(c, b); vl.setSizeFull(); setContent(vl); vl.setExpandRatio(c, 1.0f); } private Panel buildPanel() { Panel p = new Panel(depth+"n"); VerticalLayout layout = new VerticalLayout(); p.setContent(layout); layout.setSizeFull(); p.setSizeFull(); layout.addComponent(new Button("" + new Date())); layout.addComponent(new Label("Lorem ipsum Lorem ipsum")); return p; }
Scheduling the setChildPanelPosition call in AnimatedCarouselWidget::scrollToPanelIndex solved the problem.
if (!animationFallback) { Scheduler::get().scheduleDeferred([ | setChildPanelPosition(animTargetPosition) ]) }
Hello,
i encountered a wird offset issue when the component is used on a scrollable container when scrolled. The same issue occurs when it is used on a UI with the style ValoTheme.UI_WITH_MENU like it is used in the Vaadin Quick Tickets Demo. Please consider the following example:
`
@theme("mytheme")
public class MyUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
Panel p = new Panel("Test");
p.setSizeFull();
VerticalLayout vl = new VerticalLayout();
vl.setWidth(100, Unit.PERCENTAGE);
vl.setMargin(true);
vl.setSpacing(true);
Label l = new Label();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 200; i++)
sb.append("Some pretty long text here... ");
l.setValue(sb.toString());
l.setWidth(100, Unit.PERCENTAGE);
vl.addComponent(l);
AbstractCarousel carousel = new VerticalCarousel();
carousel.setWidth(100, Unit.PERCENTAGE);
for (int i = 0; i < 10; i++)
carousel.addComponent(new Button("B" + i));
vl.addComponent(carousel);
p.setContent(vl);
setContent(p);
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}
`
If the carousel is scrolled in view, the offset (matching the scrollbars distance from the top or from the left in case of a HorizontalCarousel / Horizontal scrollbar) occurs. The offset can be "varied" by shortening, lengthen the string
Can something be done to circumvent this issue?
Thanks
Thomas
It would be nice to have the possibility to have several components visible at the same time so that (for example) if three components are visible like:
A B C
a scroll to the left shows
B C D
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.