All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.future.earth.gwt.client.ui.button.BaseEditableTouchButton Maven / Gradle / Ivy

The newest version!
package eu.future.earth.gwt.client.ui.button;

import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Image;

public abstract class BaseEditableTouchButton extends TouchButton {

	public BaseEditableTouchButton(String newText) {
		this(newText, null, UiType.Touch);
	}

	public BaseEditableTouchButton(String newText, Image newImage) {
		this(newText, newImage, UiType.Touch);
	}

	public BaseEditableTouchButton(String newText, UiType forTouch) {
		this(newText, null, forTouch);
	}

	public BaseEditableTouchButton(String newText, Image newImage, UiType forTouch) {
		super(newText, newImage, forTouch);
		inittWidget();
	}

	private void inittWidget() {
		super.addStyleNameToMain("ftr-toggle");
		super.addStyleNameToMain("ftr-dropdown");
		super.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				addStyleNameToMain("ftr-active");
				showPopup();
			}

		});

		main.addBlurHandler(new BlurHandler() {

			@Override
			public void onBlur(BlurEvent event) {
				removeStyleNameToMain("ftr-active");
			}
		});
	}

	public abstract void showPopup();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy