
org.minimalj.frontend.impl.json.JsonSearchPanel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minimalj Show documentation
Show all versions of minimalj Show documentation
A java framework aiming for a minimal programming style. Includes GUI and persistence layer.
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