public void buttonClick(ClickEvent event) { try { if (event.getButton().equals(saveBtn)) { save(); close(); } else if (event.getButton().equals(addBtn)) { LightProcessDefinition lpd = (LightProcessDefinition) processesComboBox.getValue(); addTableRow(lpd); processesComboBox.removeItem(lpd); } else if (event.getButton().equals(deleteBtn)) { delete(); close(); } else if (event.getButton() instanceof TableLinkButton) { LightProcessDefinition lpd = (LightProcessDefinition) ((TableLinkButton) event.getButton()).getTableValue(); table.removeItem(lpd); processesComboBox.addItem(lpd); processesComboBox.setItemCaption( lpd, lpd.getLabel() + " (version " + lpd.getVersion() + ")"); } else { close(); } } catch (Exception ex) { ex.printStackTrace(); showError(ex.getMessage()); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton().getData().equals(BUTTON_UP)) { setSelectedItem(nextOptionAbove.getInputPrompt()); } else if (event.getButton().getData().equals(BUTTON_DOWN)) { setSelectedItem(nextOptionBelow.getInputPrompt()); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton() == bf) { getCurWindow().bringToFront(); } else if (event.getButton() == toggleModality) { getCurWindow().setModal(!getCurWindow().isModal()); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton() == buttonCancel) { listener.cancelClick(ReportType.EXPIRED_GOODS); } if (event.getButton() == buttonShow) { listener.showClick(ReportType.EXPIRED_GOODS, getReportData()); } }
private void addPinClickListener(final ClickEvent event) { eventBus.publish(this, DragEvent.HIDE_DROP_HINT); checkifAlreadyPinned(event.getButton()); if (isDistPinned) { pinDitribution(event.getButton()); } else { unPinDistribution(event.getButton()); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton().equals(getUi().getBtnNew())) { handleNewButtonClicked(); } else if (event.getButton().equals(getUi().getBtnDelete())) { handleDeleteButtonClicked(); } else if (event.getButton().equals(getUi().getBtnSave())) { handleSaveButtonClicked(); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton() == this.btn_eliminar) { ConfirmDialog.show(getUI(), "", Messages.CONFIRM_DELETE_MESSAGE, "SI", "NO", this); } if (event.getButton() == this.btn_limpiar) { this.frm_organismo.update(); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton().equals(btnCrearUsuario)) { Usuario object = new Usuario(); object.setUsuario(txtUsuario.getValue().toString()); object.setNombres(txtNombres.getValue().toString()); object.setApePat(txtApellidoPaterno.getValue().toString()); object.setApeMat(txtApellidoMaterno.getValue().toString()); object.setRol((Rol) cmbRol.getValue()); object.setCargo( txtCargo.getValue() != null ? txtCargo.getValue().toString() : StringUtils.EMPTY); object.setDescCargo( txtCargoDescripcion.getValue() != null ? txtCargoDescripcion.getValue().toString() : StringUtils.EMPTY); object.setOficina((Dependencia) cmbOficina.getValue()); object.setPolicia((Policia) cmbPolicia.getValue()); if (flagNuevoUsuario) { String randomPassword = RandomUtil.createWord(8); object.setClave(randomPassword); usuarioService.crear(object); } else { object.setClave(clave); Item item = tblUsuarios.getItem(tblUsuarios.getValue()); object.setId((Long) item.getItemProperty("id").getValue()); usuarioService.actualizar(object); } refrescar(); } else if (event.getButton().equals(btnEliminarUsuario)) { ConfirmDialog.show( getApplication().getMainWindow(), "¿Seguro de Eliminar el Registro?", new ConfirmDialog.Listener() { private static final long serialVersionUID = 1L; public void onClose(ConfirmDialog dialog) { if (dialog.isConfirmed()) { Item item = tblUsuarios.getItem(tblUsuarios.getValue()); usuarioService.eliminarXId((Long) item.getItemProperty("id").getValue()); refrescar(); } } }); } else if (event.getButton().equals(btnAgregarPolicia)) { cargarWindowRegistroPolicia(); } }
public void buttonClick(ClickEvent event) { Button source = event.getButton(); if (source.equals(reloadButton)) { Enrollment enrollmentSelected = editSanctionActsSubWindow.getLoadSanctionActList().getEnrollmentSelected(); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton().equals(btnGuardar)) { Notificacion notificacion = new Notificacion(); notificacion.setInforme(informe); notificacion.setUnidad((Dependencia) cmbUnidadProcuraduria.getValue()); notificacion.setTipoNotificacion(cmbTipoNotificacion.getValor()); notificacion.setFechaRecepcion((Date) dtFechaRecepcion.getValue()); notificacion.setFechaVencimiento((Date) dtFechaVencimiento.getValue()); notificacion.setFechaPlazo((Date) dtFechaPlazo.getValue()); notificacion.setEstado(cmbEstadoNotificacion.getValor()); AlertDialog alertDialog = null; if (notificacion.esNuevo()) { notificacionService.crear(notificacion); alertDialog = new AlertDialog( "Registro de Notificación", "Se ha registrado la notificación correctamente", "Aceptar", "400"); } else { notificacionService.actualizar(notificacion); alertDialog = new AlertDialog( "Registro de Notificación", "Se ha actualizado la notificación correctamente", "Aceptar", "400"); } getApplication().getMainWindow().addWindow(alertDialog); limpiar(); cargarDatos(); } }
@Override public void buttonClick(ClickEvent event) { Button b = event.getButton(); if (b == saveButton) { if (isValid()) { if (!(newEmail.getValue().equals(""))) { if (!GeneralController.checkUserEmail(userName, String.valueOf(newEmail))) { GeneralController.setNewEmail(userName, String.valueOf(newEmail)); getWindow() .showNotification( "Изменение электронной почты юзера завершено успешно! ", Window.Notification.TYPE_TRAY_NOTIFICATION); refrachTextField(); refreshLable(); } else { getWindow() .showNotification( "У Вас уже такой email - " + newEmail.toString().trim() + ". " + "Введите пожалуйста другой.", Window.Notification.TYPE_TRAY_NOTIFICATION); } } else { getWindow() .showNotification( "Введите имейл для изменения", Window.Notification.TYPE_TRAY_NOTIFICATION); } } } else if (b == resetUserPasswordButton) { resetUserPasswordWindow = new ResetUserPasswordWindow(this, userName); getWindow().addWindow(resetUserPasswordWindow); } }
@Override public void step1() { txt = content.getValue().toString(); txt = txt.trim(); if (txt.length() < 5) { Notification.show( "Card not played.", "Your message is too short to be useful.", Notification.Type.ERROR_MESSAGE); doNotAdvanceSteps(); // come into step1 again next time return; } if (txt.length() > 140) { Notification.show( "Card not played.", "Only 140 characters please.", Notification.Type.ERROR_MESSAGE); doNotAdvanceSteps(); // come into step1 again next time return; } // Admins get to add cards under other names author = Mmowgli2UI.getGlobals().getUserTL(); if (author.isAdministrator()) adminSwitchAuthorsTL(event.getButton(), this); else run(); // does not need to suspend, so "continues" and executes step2 // in the same clicklistener thread }
@Override public void buttonClick(ClickEvent event) { Button b = event.getButton(); if (b == addButton) { select(getNullSelectionItemId()); addNewRow(); } }
private void resizeWindow(final ClickEvent event) { if (FontAwesome.EXPAND.equals(event.getButton().getIcon())) { event.getButton().setIcon(FontAwesome.COMPRESS); setWindowMode(WindowMode.MAXIMIZED); resetColumnWidth(); grid.getColumn(STATUS).setExpandRatio(0); grid.getColumn(PROGRESS).setExpandRatio(1); grid.getColumn(FILE_NAME).setExpandRatio(2); grid.getColumn(REASON).setExpandRatio(3); grid.getColumn(SPUILabelDefinitions.NAME_VERSION).setExpandRatio(4); mainLayout.setSizeFull(); } else { event.getButton().setIcon(FontAwesome.EXPAND); setWindowMode(WindowMode.NORMAL); setColumnWidth(); setPopupSizeInMinMode(); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton() == this.btn_agregar) { if (this.frm_unidad.validate()) { this.unidad_impl.add(this.frm_unidad.getData()); grid_unidad.update(); this.frm_unidad.update(); this.frm_unidad.updateId(); Notification.show(Messages.SUCCESS_MESSAGE); } else { Notification.show(Messages.NOT_SUCCESS_MESSAGE, Type.ERROR_MESSAGE); } buildMessages(this.frm_unidad.getMensajes()); this.frm_unidad.clearMessages(); } if (event.getButton() == this.btn_limpiar) { this.frm_unidad.update(); this.frm_unidad.updateId(); } }
public void buttonClick(ClickEvent event) { Button source = event.getButton(); dirty = false; if (source == buttonAdd) { if (this.documentsForm.isModified()) { if (!this.documentsForm.isValid()) { getWindow() .showNotification( FactoryI18nManager.getI18nManager().getMessage(Messages.DIALOG_INCORRECT_DATA), Notification.TYPE_ERROR_MESSAGE); return; } if (!isValid()) { getWindow() .showNotification( FactoryI18nManager.getI18nManager() .getMessage(Messages.DIALOG_VALIDATOR_DOCUMENT_EMPTY), Notification.TYPE_ERROR_MESSAGE); return; } dirty = true; this.documentsForm.commit(); } close(); } else if (source == buttonCancel) { dirty = true; cancel(); close(); } else if (source == buttonNew) { DocumentObject d = DocumentObjectFactory.getInstance(); BeanItem<DocumentObject> newBeanItem = new BeanItem<DocumentObject>(d); isNewItem = true; openForm(newBeanItem, readonly, true, context); } else if (source == buttonDelete) { deleteItem(); } else if (source == buttonModify) { if (currentFile != null) { BeanItem<DocumentObject> newBeanItem = new BeanItem<DocumentObject>(currentFile); isNewItem = false; openForm(newBeanItem, readonly, false, context); } } else if (source == buttonLookUp) { if (currentFile != null) { BeanItem<DocumentObject> newBeanItem = new BeanItem<DocumentObject>(currentFile); isNewItem = false; openForm(newBeanItem, true, false, context); // readonly puede ser true o false } } else if (source == buttonDownload) { download(); } }
@Override public void buttonClick(ClickEvent event) { /* This method in class should be public * private boolean isViewBeanNameValidForCurrentUI(String beanName) * * workaround * * This should be implemented in custom Navigator class. */ if (springViewProvider.getView((String) event.getButton().getData()) == null) { /* * For this demo, notify user that has no access. * Easily, this can be modified to hide adminLink */ // notify user Notification.show("Access is alowed only for admin users.", Type.ERROR_MESSAGE); } else { UI.getCurrent().getNavigator().navigateTo((String) event.getButton().getData()); } }
@Override public void buttonClick(ClickEvent event) { btFirst.setEnabled(true); btLast.setEnabled(true); btNext.setEnabled(true); btPrevious.setEnabled(true); if (event.getButton() == btFirst) { currentPage = 1; } else if (event.getButton() == btLast) { currentPage = getMaxPage(); } else if (event.getButton() == btNext) { currentPage++; } else if (event.getButton() == btPrevious) { currentPage--; } // sanitize currentPage = sanitizePage(currentPage); update(true); }
@Override public void buttonClick(ClickEvent event) { switch ((Integer) event.getButton().getData()) { case ADD_NEW_CATEGORY: try { catFrm.commit(); if (catFrm.isValid()) { accSvc.addNewPaymentCategory( (String) catFrm.getField(ADD_CATG_FLD_NAME).getValue(), ((CheckBox) catFrm.getField(ADD_CATG_CREDIT_BOOL)).booleanValue(), balSheet); } } catch (InvalidValueException e) { // Ignoring InvalidValueException as // an appropriate msg is displayed in UI } catch (AccountsSheetException e) { close(); Messenger.genericMessage( MessageSeverity.ERROR, STRINGS.getString(AccountsMessages.MSGR_UNRECOVERABLE_ERROR), "Failed trying to add Payment Categories for Balance Sheet", e); } break; case ADD_NEW_TYPE: try { typeFrm.commit(); if (typeFrm.isValid()) { accSvc.addNewPaymentType( (String) typeFrm.getField(ADD_TYPE_FLD_NAME).getValue(), categories.get(typeFrm.getField(ADD_TYPE_FLD_CAT).getValue())); } } catch (InvalidValueException e) { // Ignoring InvalidValueException as // an appropriate msg is displayed in UI } catch (AccountsSheetException e) { close(); Messenger.genericMessage( MessageSeverity.ERROR, STRINGS.getString(AccountsMessages.MSGR_UNRECOVERABLE_ERROR), "Failed trying to add Payment Types for Balance Sheet", e); } break; } populatePaymentCategories(); populatePaymentTypes(categories.get(paymentCategories.getValue())); accordion.setSelectedTab(current); }
private void onCloseEvent(final ClickEvent clickEvent) { if (!clickEvent.getButton().equals(saveButton)) { close(); return; } if (!closeListener.canWindowSaveOrUpdate()) { return; } closeListener.saveOrUpdate(); if (closeListener.canWindowClose()) { close(); } }
public void buttonClick(ClickEvent event) { Button btn = event.getButton(); if (btn.equals(buttonSave)) { Collection<Enrollment> stC = (Collection<Enrollment>) lstStudentSelecteds.getItemIds(); widget.setStudentsSelecteds(new ArrayList(stC)); widget.removeSelectableStudent(); widget.sortTable(); } else if (btn.equals(buttonCancel)) { widget.removeSelectableStudent(); } else if (btn.equals(btnAddAll)) { moveLeftRight(); } else if (btn.equals(btnRemoveAll)) { moveRightLeft(); } else if (btn.equals(btnSearch)) { search((String) txtSearch.getValue()); } }
@Override public void buttonClick(ClickEvent event) { // Get a reference to the button that received the click Button button = event.getButton(); // Get the requested operation from the button caption char requestedOperation = button.getCaption().charAt(0); // Calculate the new value double newValue = calculate(requestedOperation); // Update the result label with the new value display.setReadOnly(false); display.setValue("" + newValue); display.setReadOnly(true); }
@Override public void buttonClick(ClickEvent event) { Button btn = event.getButton(); ShotcutItem item = (ShotcutItem) btn.getData(); String action = item.getAction(); if (SystemProperty.PAGE_TYPE.equals(item.getType())) { PageChangeEvent pageChangeEvent = new PageChangeEvent(action); eventBus.post(pageChangeEvent); } else { ContentChangeEvent changeEvent = new ContentChangeEvent(); changeEvent.setPresenterName(action); eventBus.post(changeEvent); } // change the head menu to home page. changeToHomeMenuStyle(); // change shotcut menu style. changeShotCutStyle(action); }
public void buttonClick(ClickEvent event) { Button source = event.getButton(); if (source == newHealthCoverageButton) { health_coveragealSubWindow.newHealth_coverage(); } else if (source == removeHealthCoverageButton) { health_coveragealSubWindow.removeHealthCoverage(); } else if (source == minimizeSearchButton) { this.health_coveragealSubWindow.minimizeSearchForm(); minimizeSearchButton.setVisible(false); maximizeSearchButton.setVisible(true); } else if (source == minimizeListButton) { this.health_coveragealSubWindow.minimizeListForm(); } else if (source == maximizeSearchButton) { minimizeSearchButton.setVisible(true); maximizeSearchButton.setVisible(false); this.health_coveragealSubWindow.maximizeSearchForm(); } else if (source == searchButton) { this.health_coveragealSubWindow.search(); } }
public void buttonClick(ClickEvent event) { Button source = event.getButton(); if (source == newBloodFactorButton) { bloodFactoralSubWindow.newBloodFactor(); } else if (source == removeBloodFactorButton) { bloodFactoralSubWindow.removeBloodFactor(); } else if (source == minimizeSearchButton) { this.bloodFactoralSubWindow.minimizeSearchForm(); minimizeSearchButton.setVisible(false); maximizeSearchButton.setVisible(true); } else if (source == minimizeListButton) { this.bloodFactoralSubWindow.minimizeListForm(); } else if (source == maximizeSearchButton) { minimizeSearchButton.setVisible(true); maximizeSearchButton.setVisible(false); this.bloodFactoralSubWindow.maximizeSearchForm(); } else if (source == searchButton) { this.bloodFactoralSubWindow.search(); } }
public void buttonClick(ClickEvent event) { Button source = event.getButton(); if (source == newClassroomTypeButton) { classroomTypealSubWindow.newClassroomType(); } else if (source == removeClassroomTypeButton) { classroomTypealSubWindow.removeClassroomType(); } else if (source == minimizeSearchButton) { this.classroomTypealSubWindow.minimizeSearchForm(); minimizeSearchButton.setVisible(false); maximizeSearchButton.setVisible(true); } else if (source == minimizeListButton) { this.classroomTypealSubWindow.minimizeListForm(); } else if (source == maximizeSearchButton) { minimizeSearchButton.setVisible(true); maximizeSearchButton.setVisible(false); this.classroomTypealSubWindow.maximizeSearchForm(); } else if (source == searchButton) { this.classroomTypealSubWindow.search(); } }
@Override public void buttonClick(ClickEvent event) { this.mensajes.clear(); if (event.getButton() == this.btn_agregar) { this.frm_pin.updatePin(); PinModel pin = new PinModel(); pin.setCi(session.getCi()); pin.setDependencia_id(session.getId_dependecia()); pin.setFecha_generacion(new java.sql.Date(new Date().getTime())); pin.setFecha_registro(new java.sql.Date(new Date().getTime())); pin.setPin(frm_pin.getCode()); pin.setUnidad_organizacional_id(session.getId_unidad_organizacional()); pin.setUsuario_id(session.getId()); if (pinimpl.addPIN(pin)) { this.mensajes.add(new BarMessage("Fomulario", Messages.SUCCESS_MESSAGE, "success")); } else { this.mensajes.add(new BarMessage("Fomulario", Messages.NOT_SUCCESS_MESSAGE)); } buildMessages(this.mensajes); } }
@Override public void buttonClick(ClickEvent event) { if (event.getButton() == buttonActivation) { listener.activationClick(); } else if (event.getButton() == buttonCancel) { listener.cancelClick(); } else if (event.getButton() == buttonReset) { listener.resetClick(); } else if (event.getButton() == buttonResetPassword) { listener.resetPasswordClick(); } else if (event.getButton() == buttonSaveEdit) { listener.updateClick(); System.out.println("Button save edit tekan"); } else if (event.getButton() == buttonSubmit) { listener.saveClick(); System.out.println("Button submit tekan"); } }
@Override public void buttonClick(ClickEvent event) { String msg = "saved"; String update = "insert"; if (event.getButton() == save) { try { // Commit the fields from UI to DAO formFieldBindings.commit(); // go to the database and get the ID of the contact selected ContactService c = ContactService.createDemoService(); ArrayList<Contact> contacts = (ArrayList<Contact>) c.findAll(null); for (int i = 0; i < contacts.size(); i++) { if (contacts.get(i).getFirstName().equals(this.contact.getFirstName()) && contacts.get(i).getLastName().equals(this.contact.getLastName()) && (!contacts.get(i).getPhone().equals(this.contact.getPhone()) || !contacts.get(i).getEmail().equals(this.contact.getEmail()) || !contacts.get(i).getBirthDate().equals(this.contact.getBirthDate()))) { this.contact.setId(contacts.get(i).getId()); update = "update"; break; } else if (contacts.get(i).getFirstName().equals(this.contact.getFirstName()) && contacts.get(i).getLastName().equals(this.contact.getLastName()) && contacts.get(i).getPhone().equals(this.contact.getPhone()) && contacts.get(i).getEmail().equals(this.contact.getEmail())) { update = "duplicate"; break; } else if (!contacts.get(i).getFirstName().equals(this.contact.getFirstName()) && !contacts.get(i).getLastName().equals(this.contact.getLastName())) { update = "insert"; } } // Save DAO to backend with direct synchronous service API int status = getUI().service.save(this.contact, update); if (status == 1 || status == 0) { msg = String.format("Saved '%s %s'.", contact.getFirstName(), contact.getLastName()); } else msg = String.format( "Cannot Save Duplicate '%s %s'.", contact.getFirstName(), contact.getLastName()); Notification.show(msg, Type.TRAY_NOTIFICATION); getUI().refreshContacts(); } catch (FieldGroup.CommitException e) { // Validation exceptions could be shown here } } else if (event.getButton() == cancel) { // Place to call business logic. Notification.show("Cancelled", Type.TRAY_NOTIFICATION); getUI().contactList.select(null); } getUI().contactList.select(null); }
@Override public void buttonClick(ClickEvent event) { // TODO Auto-generated method stub // Antisipasi if (model.getOperationStatus() == null) model.setOperationStatus(EnumOperationStatus.OPEN.getStrCode()); if (model.getOperationStatus().equals("")) model.setOperationStatus(EnumOperationStatus.OPEN.getStrCode()); if (event.getButton() == view.getBtnNewForm()) { addItem(); view.showWindowForm(); } else if (event.getButton() == view.getBtnEditForm()) { view.showWindowForm(); } else if (event.getButton() == view.getBtnDeleteForm()) { deleteForm(); } else if (event.getButton() == view.getBtnSaveForm()) { ConfirmDialog commitDialog = ConfirmDialog.show( view.getUI(), "Konfirmasi Simpan", "Simpan Data?", "Save", "No", new ConfirmDialog.Listener() { public void onClose(ConfirmDialog dialog) { if (dialog.isConfirmed()) { // Confirmed to continue try { if (model .getOperationStatus() .equals(EnumOperationStatus.ADDING.getStrCode())) { if (insertAndValidateForm() == 0) { view.getTable().focus(); view.closeWindowForm(); } else { view.focustIdOrDesc(); } } else if (model .getOperationStatus() .equals(EnumOperationStatus.EDITING.getStrCode())) { if (updateAndValidateForm() == 0) { view.getTable().focus(); view.closeWindowForm(); } else { view.focustIdOrDesc(); } } } catch (Exception ex) { Notification.show("Terjadi Kesalahan Simpan"); } } else { view.focustIdOrDesc(); } } }); commitDialog.setStyleName("dialog"); commitDialog.getOkButton().setStyleName("small"); commitDialog.getCancelButton().setStyleName("small"); // Jangan lupa commitDialog.focus(); } else if (event.getButton() == view.getBtnCancelForm()) { if (model.getOperationStatus().equals(EnumOperationStatus.ADDING.getStrCode())) { discardForm(); } else if (model.getOperationStatus().equals(EnumOperationStatus.ADDING.getStrCode()) || model.getOperationStatus().equals(EnumOperationStatus.EDITING.getStrCode())) { if (view.getFormLayout().isVisible()) { discardForm(); } } else { view.getTable().focus(); } // discardForm(operationStatus); } else if (event.getButton() == view.getBtnSearch()) { searchForm(); } else if (event.getButton() == view.getBtnPrint()) { printForm(); } else if (event.getButton() == view.getBtnHelp()) { helpForm(); } else if (event.getButton() == view.getBtnUtility()) { view.showWindowUtility(); } // Tidak semua akan di refresh container nya >> Jadi refresh container tidak bisa di taruh // disini }