Esempio n. 1
0
 /**
  * Confirms that the user wants to post the act.
  *
  * @param act the act to post
  * @param callback the callback to handle the posting, if the user confirms it
  */
 @Override
 protected void confirmPost(Act act, Runnable callback) {
   if (TypeHelper.isA(act, CustomerAccountArchetypes.INVOICE)) {
     UndispensedOrderChecker checker = new UndispensedOrderChecker(act);
     if (checker.hasUndispensedItems()) {
       checker.confirm(getHelpContext(), callback);
     } else {
       super.confirmPost(act, callback);
     }
   } else {
     super.confirmPost(act, callback);
   }
 }
Esempio n. 2
0
 /**
  * Lays out the buttons.
  *
  * @param buttons the button row
  */
 @Override
 protected void layoutButtons(ButtonSet buttons) {
   super.layoutButtons(buttons);
   buttons.add(createPostButton());
   buttons.add(createPreviewButton());
 }
Esempio n. 3
0
 /**
  * Sets the object.
  *
  * @param object the object. May be {@code null}
  */
 @Override
 public void setObject(FinancialAct object) {
   super.setObject(object);
   updateContext(CustomerAccountArchetypes.INVOICE, object);
 }
Esempio n. 4
0
 /**
  * Enables/disables the buttons that require an object to be selected.
  *
  * @param buttons the button set
  * @param enable determines if buttons should be enabled
  */
 @Override
 protected void enableButtons(ButtonSet buttons, boolean enable) {
   super.enableButtons(buttons, enable);
   buttons.setEnabled(POST_ID, enable);
   buttons.setEnabled(PREVIEW_ID, enable);
 }