BrightSide Workbench Full Report + Source Code
org.turro.financials.handshake.HandshakeDocControl Class Reference
Inheritance diagram for org.turro.financials.handshake.HandshakeDocControl:
Collaboration diagram for org.turro.financials.handshake.HandshakeDocControl:

Public Member Functions

void setDocument (Document document)
 
void afterCompose ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 38 of file HandshakeDocControl.java.

Member Function Documentation

◆ afterCompose()

void org.turro.financials.handshake.HandshakeDocControl.afterCompose ( )

Definition at line 48 of file HandshakeDocControl.java.

48  {
49  if(document == null || document.getDocumentDefinition() == null) {
50  setVisible(false);
51  return;
52  }
53  if(document.getDocumentDefinition().getId() == 1) {
54  setImage(Images.getImage("handshake"));
55  if(onClick == null) {
56  onClick = new EventListener() {
57  @Override
58  public void onEvent(Event event) throws Exception {
59  ContractHandshake handshake = document.getContract().getContractHandshake();
60  if(handshake != null) {
61  ElephantResponse er = HandshakeUtil.sendDocument(document);
62  if(ElephantResponse.isCorrect(er)) {
63  HandshakeStatus status = HandshakeStatus.getStatus(er);
64  Clients.showNotification(er.message + ": " + er.code);
65  updateImage(status);
66  SystemLogger.getInstance().doLog(SystemLogType.LOG_INFO, document, "sent", "Handshake");
67  } else {
68  Clients.showNotification("Handshake server not found");
69  }
70  }
71  Events.postEvent(new Event(Events.ON_CHANGE, HandshakeDocControl.this));
72  }
73  };
74  addEventListener(Events.ON_CLICK, onClick);
75  }
76  } else {
77  setVisible(false);
78  }
79  }
ContractHandshake getContractHandshake()
Definition: Contract.java:328
DocumentDefinition getDocumentDefinition()
Definition: Document.java:167
Here is the call graph for this function:

◆ setDocument()

void org.turro.financials.handshake.HandshakeDocControl.setDocument ( Document  document)

Definition at line 43 of file HandshakeDocControl.java.

43  {
44  this.document = document;
45  }

The documentation for this class was generated from the following file: