Directory

← Back

CodeCatcher

A "characters delimited code interceptor" widget for Vaadin

Author

Rating

Popularity

<100

I am developing a program where I have to "capture" of barcodes read by a barcode-scanner that acts like a keyboard and write each code preceded by a character ("~" for example) and an end character. This addon allows you to capture the code preventing it from being written on the page and passes it to a handler.

Sample code

package com.lelmarir.codeCatcher;

import com.vaadin.Application;
import com.vaadin.ui.*;

public class TestvaadinApplication extends Application {
	@Override
	public void init() {
		Window mainWindow = new Window("Testvaadin Application");
		
		final Label label = new Label("Hello Vaadin user");
		mainWindow.addComponent(label);
		
		TextField txt = new TextField();
		mainWindow.addComponent(txt);
		
		CodeCatcher c = new CodeCatcher();
		c.setCodeStartKeyCode('~');
		c.setCodeEndKeyCode('~');
		c.addEventListener(new CodeReadedHandler() {			
			public void codeReaded(String code) {
				label.setValue(code);
			}
		});
		mainWindow.addComponent(c);
		setMainWindow(mainWindow);
	}

}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

initila release

Released
2012-02-11
Maturity
BETA
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.7+
Browser
Browser Independent

CodeCatcher - Vaadin Add-on Directory

A "characters delimited code interceptor" widget for Vaadin CodeCatcher - Vaadin Add-on Directory
I am developing a program where I have to "capture" of barcodes read by a barcode-scanner that acts like a keyboard and write each code preceded by a character ("~" for example) and an end character. This addon allows you to capture the code preventing it from being written on the page and passes it to a handler.
Online