List of usage examples for com.google.gwt.xml.client Element setAttribute
void setAttribute(String name, String value);
name to value. From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
static Element appendChildNode(Document doc, Node parent) { Element elem = doc.createElement(Constant.XML_TAG_PREFERENCES); parent.appendChild(elem);//from w w w. ja va 2 s.c o m elem.setAttribute("stock_sell_spread", String.valueOf(sellSpread)); elem.setAttribute("stock_broker_fee", String.valueOf(brokerFeeCents)); elem.setAttribute("stock_tax_exemption_limit", String.valueOf(stockTaxExemptionCents)); elem.setAttribute("stock_tax_fee", String.valueOf(stockTaxFee)); elem.setAttribute("stock_daytrade_tax_fee", String.valueOf(stockDayTradeTaxFee)); elem.setAttribute("stock_daytrade_affect_exemption_limit", String.valueOf(stockDayTradeAffectExemptionLimit.getValue())); elem.setAttribute("stock_exempt_gains_reduce_carried_loss", String.valueOf(stockExemptGainsReduceCarriedLoss.getValue())); elem.setAttribute("stock_tax_ratio_over_pretax_earnings", String.valueOf(stockTaxRatioOverPretaxEarnings.getValue())); /* Carteira curr = CarteiraInveste.carteiraAtual; String strCarryLoss = curr.startTaxCarryLoss.getText(); if (strCarryLoss == null) strCarryLoss = CurrencyUtil.format(0); String strDayTradeCarryLoss = curr.startTaxDayTradeCarryLoss.getText(); if (strDayTradeCarryLoss == null) strDayTradeCarryLoss = CurrencyUtil.format(0); */ elem.setAttribute("stock_tax_start_carry_loss", startTaxCarryLoss.getText()); elem.setAttribute("stock_tax_daytrade_start_carry_loss", startTaxDayTradeCarryLoss.getText()); return elem; }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = doc.createElement(Constant.XML_TAG_QUOTE);
parent.appendChild(elem);/*from w w w . ja v a 2 s . c o m*/
elem.setAttribute("date", Preference.dateFormat.format(quoteDate));
elem.setAttribute("asset_name", quoteAssetName);
elem.setAttribute("asset_amount", String.valueOf(quoteAssetAmount));
elem.setAttribute("value", String.valueOf(quoteValue));
return elem;
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "yield");
elem.setAttribute("yield_type", yieldTypeLabel[yieldType]);
elem.setAttribute("date", Preference.dateFormat.format(yieldDate));
//elem.setAttribute("tax_year", String.valueOf(yieldTaxYear));
elem.setAttribute("asset_name", yieldAsset);
elem.setAttribute("asset_amount", String.valueOf(yieldAssetAmount));
elem.setAttribute("gross_value", String.valueOf(yieldGrossCents));
elem.setAttribute("net_value", String.valueOf(yieldNetCents));
elem.setAttribute("account", yieldAccount);
return elem;/*from w w w. j av a2 s .com*/
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "split");
elem.setAttribute("date", Preference.dateFormat.format(splitDate));
elem.setAttribute("asset_name", splitAsset);
elem.setAttribute("from", String.valueOf(splitFrom));
elem.setAttribute("to", String.valueOf(splitTo));
return elem;// ww w . java 2 s. co m
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "buy");
elem.setAttribute("date", Preference.dateFormat.format(buyDate));
elem.setAttribute("asset_type", Asset.assetTypeLabel[buyAssetType]);
elem.setAttribute("asset_name", buyAssetName);
elem.setAttribute("amount", String.valueOf(buyAmount));
elem.setAttribute("cost", String.valueOf(buyCostCents));
elem.setAttribute("expense", String.valueOf(buyExpenseCents));
if (buyAccount != null)
elem.setAttribute("account", buyAccount);
return elem;/*from w w w . j a v a 2s . c om*/
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "sell");
elem.setAttribute("date", Preference.dateFormat.format(sellDate));
elem.setAttribute("asset_type", Asset.assetTypeLabel[sellAssetType]);
elem.setAttribute("asset_name", sellAssetName);
elem.setAttribute("amount", String.valueOf(sellAmount));
elem.setAttribute("gross", String.valueOf(sellGrossValueCents));
elem.setAttribute("revenue", String.valueOf(sellNetRevenueCents));
elem.setAttribute("retained_tax", String.valueOf(sellRetainedTaxCents));
if (sellAccount != null)
elem.setAttribute("account", sellAccount);
return elem;/* w ww . j a va 2 s .com*/
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "daytrade");
elem.setAttribute("date", Preference.dateFormat.format(dtDate));
elem.setAttribute("asset_name", getAsset());
elem.setAttribute("amount", String.valueOf(dtAmount));
elem.setAttribute("buy_gross", String.valueOf(dtBuyGrossValueCents));
elem.setAttribute("sell_gross", String.valueOf(dtSellGrossValueCents));
elem.setAttribute("sell_net", String.valueOf(dtSellNetValueCents));
elem.setAttribute("retained_tax", String.valueOf(dtRetainedTaxCents));
if (dtAccount != null)
elem.setAttribute("account", dtAccount);
return elem;// w w w. j ava2 s .c o m
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "deposit");
elem.setAttribute("date", Preference.dateFormat.format(depDate));
elem.setAttribute("account", depAccount);
elem.setAttribute("value", String.valueOf(depValueCents));
elem.setAttribute("expense", String.valueOf(depExpenseCents));
return elem;//from w w w .j a va 2 s . co m
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "withdraw");
elem.setAttribute("date", Preference.dateFormat.format(wdrawDate));
elem.setAttribute("account", wdrawAccount);
elem.setAttribute("value", String.valueOf(wdrawValueCents));
return elem;/*from w w w. ja va2s .c om*/
}
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Element appendChildNode(Document doc, Node parent) {
Element elem = super.appendChildNode(doc, parent);
elem.setAttribute("type", "transfer");
elem.setAttribute("date", Preference.dateFormat.format(transferDate));
elem.setAttribute("account_from", transferAccountFrom);
elem.setAttribute("account_to", transferAccountTo);
elem.setAttribute("value", String.valueOf(transferValueCents));
return elem;/*from w ww . j a v a 2 s . c o m*/
}