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

org.minimalj.frontend.impl.json.JsonSearchPanel Maven / Gradle / Ivy

Go to download

A java framework aiming for a minimal programming style. Includes GUI and persistence layer.

There is a newer version: 2.5.0.0
Show newest version
package org.minimalj.frontend.impl.json;

import org.minimalj.frontend.Frontend.IComponent;
import org.minimalj.frontend.Frontend.InputComponentListener;
import org.minimalj.frontend.Frontend.Search;
import org.minimalj.frontend.Frontend.TableActionListener;

public class JsonSearchPanel extends JsonList {

	private final Search search;
	private final JsonTable table;
	
	public JsonSearchPanel(Search search, Object[] keys, TableActionListener listener) {
		super();
		this.search = search;
		addComponent(new JsonTextField("SearchTextField", new JsonSearchInputListener()));
		table = new JsonTable(keys, listener);
		addComponent(table);
	}

	private class JsonSearchInputListener implements InputComponentListener {

		@Override
		public void changed(IComponent source) {
			JsonTextField textField = (JsonTextField) source;
			String query = textField.getValue();
			table.setObjects(search.search(query));
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy