private void formaTienda(final Form fmLiber) {
final Form fmTienda = new Form(new BorderLayout());
fmTienda.getToolbar().setBackCommand("", e -> fmLiber.showBack());
fmTienda.getToolbar().getStyle().setAlignment(Label.LEFT);
fmTienda.setTitle(idioma.getTiendas());
TextField txNombreTienda = new TextField();
txNombreTienda.setHint(idioma.getTienda());
Container cnTiendas = new Container(BoxLayout.y());
cnTiendas.setScrollableY(true);
txNombreTienda.addDataChangeListener((int type, int index) -> {
String t = txNombreTienda.getText();
if (t.length() == 0) {
return;
}
char[] p = t.toCharArray();
if (p.length == 0) {
return;
} else {
if (p[p.length - 1] != ' ') {
return;
}
}
ArrayList l = new ArrayList();
l = dT.leeArrayListDatos(t, TIENDA_LEE_NOMBRE);
if (l == null || l.isEmpty()) {
return;
}
if (l.size() < LIMITE_DATOS) {
cnTiendas.removeAll();
for (int i = 0; i < l.size(); i++) {
Tienda tDa = registroTienda((Map<String, String>) l.get(i));
Container cnItemTienda = creaItemTienda(fmTienda, tDa);
cnTiendas.add(cnItemTienda);
}
} else {
Dialog.show(idioma.getInformacion(), idioma.getMensaje21(), idioma.getContinuar(), null);
}
cnTiendas.animateLayout(250);
});
Style s = UIManager.getInstance().getComponentStyle("Title");
FontImage iInformacion = FontImage.createMaterial(FontImage.MATERIAL_INFO, s);
fmTienda.getToolbar().addCommandToRightBar(new Command("", iInformacion) {
@Override
public void actionPerformed(ActionEvent evt) {
formaInformacion(fmTienda, idioma.getTiendas(), idioma.getMensaje68() + idioma.getMensaje32());
}
});
FloatingActionButton btNuevo = FloatingActionButton.createFAB(FontImage.MATERIAL_ADD);
btNuevo.bindFabToContainer(fmTienda.getContentPane(), Component.RIGHT, Component.BOTTOM);
btNuevo.addActionListener((e) -> {
Tienda tDa = new Tienda();
mantenimientoTienda(fmTienda, tDa, ADICIONAR);
});
fmTienda.add(BorderLayout.NORTH, txNombreTienda);
fmTienda.add(BorderLayout.CENTER, cnTiendas);
fmTienda.setTransitionOutAnimator(CommonTransitions.createSlide(
CommonTransitions.SLIDE_VERTICAL, true, 500));
fmTienda.show();
}