本文整理汇总了Java中com.openbravo.data.gui.ComboBoxValModel.setSelectedKey方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBoxValModel.setSelectedKey方法的具体用法?Java ComboBoxValModel.setSelectedKey怎么用?Java ComboBoxValModel.setSelectedKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.openbravo.data.gui.ComboBoxValModel
的用法示例。
在下文中一共展示了ComboBoxValModel.setSelectedKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import com.openbravo.data.gui.ComboBoxValModel; //导入方法依赖的package包/类
public void activate() throws BasicException {
paymentdialogreceipt = JPaymentSelectReceipt.getDialog(this);
paymentdialogreceipt.init(m_App);
paymentdialogrefund = JPaymentSelectRefund.getDialog(this);
paymentdialogrefund.init(m_App);
// impuestos incluidos seleccionado ?
m_jaddtax.setSelected("true".equals(m_jbtnconfig.getProperty("taxesincluded")));
// Inicializamos el combo de los impuestos.
java.util.List<TaxInfo> taxlist = senttax.list();
taxcollection = new ListKeyed<TaxInfo>(taxlist);
java.util.List<TaxCategoryInfo> taxcategorieslist = senttaxcategories.list();
taxcategoriescollection = new ListKeyed<TaxCategoryInfo>(taxcategorieslist);
taxcategoriesmodel = new ComboBoxValModel(taxcategorieslist);
m_jTax.setModel(taxcategoriesmodel);
String taxesid = m_jbtnconfig.getProperty("taxcategoryid");
if (taxesid == null) {
if (m_jTax.getItemCount() > 0) {
m_jTax.setSelectedIndex(0);
}
} else {
taxcategoriesmodel.setSelectedKey(taxesid);
}
taxeslogic = new TaxesLogic(taxlist);
// Show taxes options
if (m_App.getAppUserView().getUser().hasPermission("sales.ChangeTaxOptions")) {
m_jTax.setVisible(true);
m_jaddtax.setVisible(true);
} else {
m_jTax.setVisible(false);
m_jaddtax.setVisible(false);
}
// Authorization for buttons
btnSplit.setEnabled(m_App.getAppUserView().getUser().hasPermission("sales.Total"));
m_jDelete.setEnabled(m_App.getAppUserView().getUser().hasPermission("sales.EditLines"));
m_jNumberKeys.setMinusEnabled(m_App.getAppUserView().getUser().hasPermission("sales.EditLines"));
m_jNumberKeys.setEqualsEnabled(m_App.getAppUserView().getUser().hasPermission("sales.Total"));
m_jbtnconfig.setPermissions(m_App.getAppUserView().getUser());
m_ticketsbag.activate();
}
示例2: activate
import com.openbravo.data.gui.ComboBoxValModel; //导入方法依赖的package包/类
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
// added by JDL 26.04.13
// lets look at adding a timer event fot auto logoff if required
Action logout = new logout();
String autoLogoff = (m_App.getProperties().getProperty("till.autoLogoff"));
if (autoLogoff != null){
if (autoLogoff.equals("true")){
try{
delay = Integer.parseInt(m_App.getProperties().getProperty("till.autotimer"));
// JG 19 Feb 14 - }catch (Exception e){
}catch (NumberFormatException e){
delay=0;
}
delay *= 1000;
}}
// if the delay period is not zero create a inactivitylistener instance
if (delay != 0){
listener = new InactivityListener(logout,delay);
listener.start();
}
paymentdialogreceipt = JPaymentSelectReceipt.getDialog(this);
paymentdialogreceipt.init(m_App);
paymentdialogrefund = JPaymentSelectRefund.getDialog(this);
paymentdialogrefund.init(m_App);
// impuestos incluidos seleccionado ?
m_jaddtax.setSelected("true".equals(m_jbtnconfig.getProperty("taxesincluded")));
// JG May 2013 use Diamond inference
java.util.List<TaxInfo> taxlist = senttax.list();
taxcollection = new ListKeyed<>(taxlist);
java.util.List<TaxCategoryInfo> taxcategorieslist = senttaxcategories.list();
taxcategoriescollection = new ListKeyed<>(taxcategorieslist);
taxcategoriesmodel = new ComboBoxValModel(taxcategorieslist);
m_jTax.setModel(taxcategoriesmodel);
String taxesid = m_jbtnconfig.getProperty("taxcategoryid");
if (taxesid == null) {
if (m_jTax.getItemCount() > 0) {
m_jTax.setSelectedIndex(0);
}
} else {
taxcategoriesmodel.setSelectedKey(taxesid);
}
taxeslogic = new TaxesLogic(taxlist);
// Added JDL change the startup state of addtax button
// JG 19 Feb 14 unnecessary parse - m_jaddtax.setSelected((Boolean.valueOf(m_App.getProperties().getProperty("till.taxincluded")).booleanValue()));
m_jaddtax.setSelected((Boolean.parseBoolean(m_App.getProperties().getProperty("till.taxincluded"))));
// Show taxes options
if (m_App.getAppUserView().getUser().hasPermission("sales.ChangeTaxOptions")) {
m_jTax.setVisible(true);
m_jaddtax.setVisible(true);
} else {
m_jTax.setVisible(false);
m_jaddtax.setVisible(false);
}
// Authorization for buttons
btnSplit.setEnabled(m_App.getAppUserView().getUser().hasPermission("sales.Total"));
m_jDelete.setEnabled(m_App.getAppUserView().getUser().hasPermission("sales.EditLines"));
m_jNumberKeys.setMinusEnabled(m_App.getAppUserView().getUser().hasPermission("sales.EditLines"));
m_jNumberKeys.setEqualsEnabled(m_App.getAppUserView().getUser().hasPermission("sales.Total"));
m_jbtnconfig.setPermissions(m_App.getAppUserView().getUser());
m_ticketsbag.activate();
}