/** get view */ public View getView(int position, View convertView, ViewGroup parent) { // ListItemView listItemView = null; // final int selectID = position; if (appInfos == null) { return null; } // if(convertView == null){ AppView appView = new AppView(mContext); appView.updateView(appInfos.get(position)); convertView = appView; // convertView = layoutInflater.inflate(R.layout.item,null); // listItemView.detail = (Button)convertView.findViewById(R.id.button3); // listItemView.image = (ImageView)convertView.findViewById(R.id.images_id); // listItemView.detail.setOnClickListener(new View.OnClickListener() { // @Override // public void onClick(View v) { // // } // }); // listItemView.image.setOnClickListener(new View.OnClickListener() { // @Override // public void onClick(View v) { // showDetailInfo(position); // } // }); // }else{ // ((AppView)convertView).updateView(appInfos.get(position)); // } return convertView; }
@Override public void init(AppView app) throws BeanFactoryException { m_App = app; m_dlSystem = (DataLogicSystem) m_App.getBean("com.openbravo.pos.forms.DataLogicSystem"); m_TTP = new TicketParser(m_App.getDeviceTicket(), m_dlSystem); m_jTicketTable.setDefaultRenderer( Object.class, new TableRendererBasic(new Formats[] {new FormatsPayment(), Formats.CURRENCY})); m_jTicketTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); m_jScrollTableTicket.getVerticalScrollBar().setPreferredSize(new Dimension(25, 25)); m_jTicketTable.getTableHeader().setReorderingAllowed(false); m_jTicketTable.setRowHeight(25); m_jTicketTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); m_jsalestable.setDefaultRenderer( Object.class, new TableRendererBasic( new Formats[] {Formats.STRING, Formats.CURRENCY, Formats.CURRENCY, Formats.CURRENCY})); m_jsalestable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); m_jScrollSales.getVerticalScrollBar().setPreferredSize(new Dimension(25, 25)); m_jsalestable.getTableHeader().setReorderingAllowed(false); m_jsalestable.setRowHeight(25); m_jsalestable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); }
@Override public View newView(Context context, Cursor cursor, ViewGroup parent) { App app = new App( cursor.getString(AppTable.APP_COL_NAME), cursor.getString(AppTable.APP_COL_INSTALLURI), cursor.getFloat(AppTable.APP_COL_RATING), cursor.getLong(AppTable.APP_COL_ID), cursor.getInt(AppTable.APP_COL_INSTALLED) > 0); AppView av = new AppView(context, app); av.setOnAppChangeListener(this.m_listener); return av; }
@Override public void bindView(View view, Context context, Cursor cursor) { App app = new App( cursor.getString(AppTable.APP_COL_NAME), cursor.getString(AppTable.APP_COL_INSTALLURI), cursor.getFloat(AppTable.APP_COL_RATING), cursor.getLong(AppTable.APP_COL_ID), cursor.getInt(AppTable.APP_COL_INSTALLED) > 0); ((AppView) view).setOnAppChangeListener(null); ((AppView) view).setApp(app); ((AppView) view).setOnAppChangeListener(this.m_listener); }
/** Refresh the view */ public void refresh() { // Refresh parents super.refresh(); // Reflect the new entity positions updateSystemEditorView(); }
@Override public void initUI() { AnchorPane anchorPane = new AnchorPane(); anchorPane.setPrefHeight(90.0); anchorPane.setPrefWidth(384.0); Label label = new Label(getApplication().getMessageSource().getMessage("name.label")); TextField input = new TextField(); input.setPrefWidth(200.0); Button button = new Button(); button.setPrefWidth(200.0); JavaFXUtils.configure( button, (JavaFXAction) actionFor(controller, "sayHello").getToolkitAction()); Label output = new Label(); label.setPrefWidth(360.0); model.inputProperty().bindBidirectional(input.textProperty()); model.outputProperty().bindBidirectional(output.textProperty()); anchorPane.getChildren().addAll(label, input, button, output); setLeftAnchor(label, 14.0); setTopAnchor(label, 14.0); setLeftAnchor(input, 172.0); setTopAnchor(input, 11.0); setLeftAnchor(button, 172.0); setTopAnchor(button, 45.0); setLeftAnchor(output, 14.0); setTopAnchor(output, 80.0); Tab tab = new Tab("Java"); tab.setGraphic(new FontAwesomeIcon(FontAwesome.FA_COFFEE)); tab.setClosable(false); tab.setContent(anchorPane); parentView.getTabPane().getTabs().add(tab); }
/** Creates new form JTicketsBag */ public JTicketsBag(AppView oApp, TicketsEditor panelticket) { m_App = oApp; m_panelticket = panelticket; m_dlSales = (DataLogicSales) m_App.getBean("com.openbravo.pos.forms.DataLogicSales"); }
private void m_jCloseCashActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_m_jCloseCashActionPerformed // TODO add your handling code here: int res = JOptionPane.showConfirmDialog( this, AppLocal.getIntString("message.wannaclosecash"), AppLocal.getIntString("message.title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (res == JOptionPane.YES_OPTION) { Date dNow = new Date(); try { // Cerramos la caja si esta pendiente de cerrar. if (m_App.getActiveCashDateEnd() == null) { new StaticSentence( m_App.getSession(), "UPDATE CLOSEDCASH SET DATEEND = ? WHERE HOST = ? AND MONEY = ?", new SerializerWriteBasic( new Datas[] {Datas.TIMESTAMP, Datas.STRING, Datas.STRING})) .exec( new Object[] {dNow, m_App.getProperties().getHost(), m_App.getActiveCashIndex()}); } } catch (BasicException e) { MessageInf msg = new MessageInf( MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotclosecash"), e); msg.show(this); } try { // Creamos una nueva caja m_App.setActiveCash( UUID.randomUUID().toString(), m_App.getActiveCashSequence() + 1, dNow, null); // creamos la caja activa m_dlSystem.execInsertCash( new Object[] { m_App.getActiveCashIndex(), m_App.getProperties().getHost(), m_App.getActiveCashSequence(), m_App.getActiveCashDateStart(), m_App.getActiveCashDateEnd() }); // ponemos la fecha de fin m_PaymentsToClose.setDateEnd(dNow); // print report printPayments("Printer.CloseCash"); // Mostramos el mensaje JOptionPane.showMessageDialog( this, AppLocal.getIntString("message.closecashok"), AppLocal.getIntString("message.title"), JOptionPane.INFORMATION_MESSAGE); } catch (BasicException e) { MessageInf msg = new MessageInf( MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotclosecash"), e); msg.show(this); } try { loadData(); } catch (BasicException e) { MessageInf msg = new MessageInf( MessageInf.SGN_NOTICE, AppLocal.getIntString("label.noticketstoclose"), e); msg.show(this); } } } // GEN-LAST:event_m_jCloseCashActionPerformed