Example usage for com.google.gwt.gdata.client.finance TransactionEntry getSelfLink

List of usage examples for com.google.gwt.gdata.client.finance TransactionEntry getSelfLink

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.finance TransactionEntry getSelfLink.

Prototype

public final native com.google.gwt.gdata.client.Link getSelfLink() ;

Source Link

Document

Returns the link that provides the URI of the feed or entry.

Usage

From source file:com.google.gwt.gdata.sample.hellogdata.client.FinanceDeleteTransactionDemo.java

License:Apache License

/**
 * Retrieves the transaction entry corresponding to the given URI.
 * On failure display a status message. On success call
 * deleteTransaction to delete the transaction. Alternatively,
 * we could also have used result.deleteEntry, but the effect
 * is the same./*from   ww w.  ja  v  a  2  s  .co  m*/
 * 
 * @param transactionEntryUri The transaction entry uri
 */
private void getTransaction(String transactionEntryUri) {
    showStatus("Retrieving transaction...", false);
    service.getTransactionEntry(transactionEntryUri, new TransactionEntryCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving a transaction: " + caught.getMessage(), true);
        }

        public void onSuccess(TransactionEntry result) {
            if (result == null) {
                showStatus("No transaction found.", false);
            } else {
                String transactionEntryUri = result.getSelfLink().getHref();
                deleteTransaction(transactionEntryUri);
            }
        }
    });
}