本文整理汇总了Java中org.apache.wicket.util.string.StringValue.toInteger方法的典型用法代码示例。如果您正苦于以下问题:Java StringValue.toInteger方法的具体用法?Java StringValue.toInteger怎么用?Java StringValue.toInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.util.string.StringValue
的用法示例。
在下文中一共展示了StringValue.toInteger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: respond
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
@Override
protected void respond(final AjaxRequestTarget target) {
Chart chart = (Chart) getComponent();
Options options = chart.getOptions();
InteractionEvent event = new InteractionEvent();
event.setJavascriptChartName(chart.getJavaScriptVarName());
StringValue selectedPointValue = getVariableValue(SELECTED_POINT);
if (selectedPointValue != null && !"".equals(selectedPointValue.toString())) {
Integer selectedPoint = selectedPointValue.toInteger();
Point point = OptionsUtil.getPointWithWickedChartsId(options, selectedPoint);
event.setSelectedPoint(point);
}
StringValue selectedSeriesValue = getVariableValue(SELECTED_SERIES);
if (selectedSeriesValue != null && !"".equals(selectedSeriesValue.toString())) {
Integer selectedSeries = selectedSeriesValue.toInteger();
Series<?> series = OptionsUtil.getSeriesWithWickedChartsId(options, selectedSeries);
event.setSelectedSeries(series);
}
event.setSelectedChart(options);
onEvent(event, target);
}
示例2: getIntegerParameter
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public static Integer getIntegerParameter(PageParameters params, String key) {
if (params == null || params.get(key) == null) {
return null;
}
StringValue value = params.get(key);
if (!StringUtils.isNumeric(value.toString())) {
return null;
}
return value.toInteger();
}
示例3: getAsInteger
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public static Integer getAsInteger(final PageParameters parameters, final String name)
{
final StringValue sval = parameters.get(name);
if (sval == null || sval.isNull() == true) {
return null;
} else {
return sval.toInteger();
}
}
示例4: AddressCampaignValueEditPage
import org.apache.wicket.util.string.StringValue; //导入方法依赖的package包/类
public AddressCampaignValueEditPage(final PageParameters parameters)
{
super(parameters, "plugins.marketing.addressCampaign");
StringValue sval = parameters.get(AbstractEditPage.PARAMETER_KEY_ID);
final Integer id = sval.isEmpty() == true ? null : sval.toInteger();
if (id == null) {
// Create new entry.
sval = parameters.get(PARAMETER_ADDRESS_ID);
final Integer addressId = sval.isEmpty() ? null : sval.toInteger();
sval = parameters.get(PARAMETER_ADDRESS_CAMPAIGN_ID);
final Integer addressCampaignId = sval.isEmpty() || "null".equals(sval.toString()) ? null : sval.toInteger();
if (addressId == null || addressCampaignId == null) {
throw new UserException("plugins.marketing.addressCampaignValue.error.addressOrCampaignNotGiven");
}
final AddressDO address = addressDao.getById(addressId);
final AddressCampaignDO addressCampaign = addressCampaignDao.getById(addressCampaignId);
if (address == null || addressCampaign == null) {
throw new UserException("plugins.marketing.addressCampaignValue.error.addressOrCampaignNotGiven");
}
AddressCampaignValueDO data = addressCampaignValueDao.get(addressId, addressCampaignId);
if (data == null) {
data = new AddressCampaignValueDO();
data.setAddress(address);
data.setAddressCampaign(addressCampaign);
}
init(data);
} else {
init();
}
}