private int getProjectItemIndex() { EzeeProjectItem item = projectItemGrid.getSelected(); if (item != null) { return projectItemGrid.getIndex(item); } return MINUS_ONE; }
private void replaceItem() { int index = getProjectItemIndex(); EzeeProjectItem item = projectItemGrid.getSelected(); if (index != MINUS_ONE && item != null) { projectItemGrid.getModel().getHandler().getList().remove(index); projectItemGrid.getModel().getHandler().getList().add(index, item); projectItemGrid.getGrid().redraw(); } }
private void initGrids() { projectItemGrid = new EzeeProjectItemGrid(this); projectItems.add(projectItemGrid); projectItemDetailGrid = new EzeeProjectItemDetailGrid(this); projectItemDetails.add(projectItemDetailGrid); projectItemGrid.addListener(projectItemDetailGrid); projectPaymentGrid = new EzeeProjectPaymentGrid(this); projectPayments.add(projectPaymentGrid); projectItemGrid.addListener(projectPaymentGrid); if (!MGWT.getFormFactor().isDesktop()) { hideTotals(); } else { updateTotals(); } }
public void newProjectPayment() { EzeeProjectItem item = projectItemGrid.getSelected(); if (item != null) { new EzeeCreateUpdateDeleteProjectItemPayment( cache, projectPaymentHandler, PROJECT_PAYMENT_CRUD_HEADERS) .show(); } }
public void newProjectItemDetail() { EzeeProjectItem item = projectItemGrid.getSelected(); if (item != null) { new EzeeCreateUpdateDeleteProjectItemDetail( cache, projectItemDetailHandler, PROJECT_ITEM_DETAIL_CRUD_HEADERS) .show(); } }
public void deleteProjectItem() { EzeeProjectItem item = projectItemGrid.getSelected(); if (item != null) { new EzeeCreateUpdateDeleteProjectItem( cache, projectItemHandler, item, delete, PROJECT_ITEM_CRUD_HEADERS) .show(); } }
private void reloadUi() { int itemIndex = projectItemGrid.getIndex(projectItemGrid.getSelected()); int detailIndex = projectItemDetailGrid.getIndex(projectItemDetailGrid.getSelected()); int paymentIndex = projectPaymentGrid.getIndex(projectPaymentGrid.getSelected()); projectItemGrid.reloadEntities(); projectItemGrid.setSelected(itemIndex); projectItemDetailGrid.itemSelected(projectItemGrid.getSelected(), detailIndex); projectPaymentGrid.itemSelected(projectItemGrid.getSelected(), paymentIndex); }