package com.akjava.gwt.html5.client.extra;

import com.akjava.gwt.html5.client.HTML5InputRange;
import com.akjava.gwt.html5.client.HTML5InputRange.HTML5InputRangeListener;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.user.client.ui.Label;

public class HTML5Builder {
	public static Label createRangeLabel(final String text,final HTML5InputRange range){
		final Label label=new Label();
		label.setText(text+""+range.getValue());
		label.setStylePrimaryName("title");
		range.addListener(new HTML5InputRangeListener() {
			@Override
			public void changed(int newValue) {
				label.setText(text+""+newValue);
			}
		});
		
		/*
		range.addChangeHandler(new ChangeHandler() {
			
			@Override
			public void onChange(ChangeEvent event) {
				label.setText(text+":"+range.getValue());
				
			}
		});*/
		/*
		range.addMouseUpHandler(new MouseUpHandler() {
			
			@Override
			public void onMouseUp(MouseUpEvent event) {
				label.setText(text+":"+range.getValue());
			}
		});
		*/
		
		return label;
	}
}

@@ -1120,11 +1120,451 @@
 l;%0D%0A%09%7D%0D%0A
+%09%0D%0A%09public static Label createRangeLabel(final String text,final HTML5InputRange range,final int divided)%7B%0D%0A%09%09final Label label=new Label();%0D%0A%09%09label.setText(text+%22%22+((double)range.getValue()/divided));%0D%0A%09%09label.setStylePrimaryName(%22title%22);%0D%0A%09%09range.addListener(new HTML5InputRangeListener() %7B%0D%0A%09%09%09@Override%0D%0A%09%09%09public void changed(int newValue) %7B%0D%0A%09%09%09%09label.setText(text+%22%22+((double)newValue/divided));%0D%0A%09%09%09%7D%0D%0A%09%09%7D);%0D%0A%09%09return label;%0D%0A%09%7D%0D%0A
 %7D%0D%0A

add html5builder