當前位置: 首頁>>代碼示例>>Java>>正文


Java DateRange類代碼示例

本文整理匯總了Java中net.sf.jasperreports.types.date.DateRange的典型用法代碼示例。如果您正苦於以下問題:Java DateRange類的具體用法?Java DateRange怎麽用?Java DateRange使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DateRange類屬於net.sf.jasperreports.types.date包,在下文中一共展示了DateRange類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createInput

import net.sf.jasperreports.types.date.DateRange; //導入依賴的package包/類
@Override
public void createInput(Composite parent, final IParameter param, final Map<String, Object> params) {
	super.createInput(parent, param, params);
	Class<?> valueClass = param.getValueClass();
	if (java.sql.Date.class.isAssignableFrom(valueClass)) {
		createDate(parent, param, params);
	} else if (java.sql.Time.class.isAssignableFrom(valueClass)) {
		createTime(parent, param, params);
	} else if (java.sql.Timestamp.class.isAssignableFrom(valueClass)
			|| java.util.Date.class.isAssignableFrom(valueClass)) {
		createTimestamp(parent, param, params);
	} else if (TimestampRange.class.isAssignableFrom(valueClass))
		createTimestampRange(parent, param, params);
	else if (DateRange.class.isAssignableFrom(valueClass))
		createDateRange(parent, param, params);
	date.setToolTipText(VParameters.createToolTip(param));
	date.addFocusListener(focusListener);
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:19,代碼來源:DateInput.java

示例2: createInput

import net.sf.jasperreports.types.date.DateRange; //導入依賴的package包/類
@Override
public void createInput(Composite parent, IParameter param, Map<String, Object> params) {
	if (param instanceof PResourceDescriptor) {
		PResourceDescriptor p = (PResourceDescriptor) param;
		ServerProfile sp = WSClientHelper.getServerProfile(p.getWsClient());
		if (sp != null)
			setSupportDateRange(sp.isSupportsDateRanges());
		isNumeric = !p.getWsClient().isSupported(Feature.SEARCHREPOSITORY);
	}
	this.params = params;
	this.param = param;
	Class<?> valueClass = param.getValueClass();
	if (java.sql.Date.class.isAssignableFrom(valueClass)) {
		if (supportDateRange)
			createDateRange(parent, param, params);
		else
			createDate(parent, param, params);
	} else if (java.sql.Time.class.isAssignableFrom(valueClass)) {
		createTime(parent, param, params);
	} else if (java.sql.Timestamp.class.isAssignableFrom(valueClass) || java.util.Date.class.isAssignableFrom(valueClass)) {
		if (supportDateRange)
			createTimestampRange(parent, param, params);
		else
			createTimestamp(parent, param, params);
	} else if (TimestampRange.class.isAssignableFrom(valueClass))
		createTimestampRange(parent, param, params);
	else if (DateRange.class.isAssignableFrom(valueClass))
		createDateRange(parent, param, params);
	date.setToolTipText(VParameters.createToolTip(param));
	date.addFocusListener(focusListener);
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:32,代碼來源:DateInput.java

示例3: updateInput

import net.sf.jasperreports.types.date.DateRange; //導入依賴的package包/類
public void updateInput() {
	Object d = params.get(param.getName());
	if (d != null) {
		if (d instanceof String) {
			try {
				SimpleDateFormat sdf = new SimpleDateFormat(date.getPattern());
				sdf.parse((String) d);
			} catch (ParseException e) {
				e.printStackTrace();
			}
		}
		if (d instanceof Date) {
			date.setSelection((Date) d);
		} else if (d instanceof Long) {
			date.setSelection(new Date((Long) d));
			isNumeric = true;
		} else if (d instanceof DateRange) {
			DateRange dr = (DateRange) d;
			if (dr instanceof DateRangeExpression) {
				String expr = ((DateRangeExpression) dr).getExpression();
				if (expr != null) {
					((DRDateTime) date).setText(expr);
					return;
				}
			}
			date.setSelection(dr.getStart());
		}
	} else {
		date.setSelection(null);
	}
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:32,代碼來源:DateInput.java

示例4: publish

import net.sf.jasperreports.types.date.DateRange; //導入依賴的package包/類
public void publish(MReportUnit mrunit, IProgressMonitor monitor, JasperDesign jasper, JasperReportsConfiguration jrConfig) throws Exception {
	ResourceDescriptor runit = mrunit.getValue();
	for (JRParameter p : jasper.getParametersList()) {
		if (p.isSystemDefined() || !p.isForPrompting())
			continue;

		ResourceDescriptor rd = MInputControl.createDescriptor(mrunit);
		rd.setName(p.getName());
		rd.setLabel(p.getName());
		rd.setDescription(p.getDescription());
		rd.setVisible(true);
		rd.setReadOnly(false);
		rd.setMandatory(false);
		rd.setResourceProperty(ResourceDescriptor.PROP_INPUTCONTROL_TYPE, ResourceDescriptor.IC_TYPE_SINGLE_VALUE);
		rd.setParentFolder(runit.getUriString() + "_files");
		rd.setUriString(runit.getUriString() + "_files/" + rd.getName());

		MInputControl mres = (MInputControl) ResourceFactory.getResource(mrunit, rd, -1);

		if (Boolean.class.isAssignableFrom(p.getValueClass())) {
			rd.setControlType(ResourceDescriptor.IC_TYPE_BOOLEAN);
		} else if (String.class.isAssignableFrom(p.getValueClass())) {
			addType(rd, mres, ResourceDescriptor.DT_TYPE_TEXT);
		} else if (Timestamp.class.isAssignableFrom(p.getValueClass())) {
			addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE_TIME);
		} else if (Date.class.isAssignableFrom(p.getValueClass())) {
			addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE);
		} else if (TimestampRange.class.isAssignableFrom(p.getValueClass())) {
			addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE_TIME);
		} else if (DateRange.class.isAssignableFrom(p.getValueClass())) {
			addType(rd, mres, ResourceDescriptor.DT_TYPE_DATE);
		} else if (Number.class.isAssignableFrom(p.getValueClass())) {
			addType(rd, mres, ResourceDescriptor.DT_TYPE_NUMBER);
		} else if (Collection.class.isAssignableFrom(p.getValueClass())) {
			rd.setControlType(ResourceDescriptor.IC_TYPE_MULTI_SELECT_LIST_OF_VALUES);

			ResourceDescriptor dt = new ResourceDescriptor();
			dt.setWsType(ResourceDescriptor.TYPE_LOV);
			dt.setName("lov_" + rd.getName());
			dt.setLabel("lov_" + rd.getName());
			dt.setIsNew(true);
			dt.setParentFolder(rd.getUriString() + "_files");
			dt.setUriString(dt.getParentFolder() + "/" + rd.getName());
			List<ListItem> values = new ArrayList<ListItem>();

			dt.setListOfValues(values);
			rd.getChildren().add(dt);
		} else {
			mrunit.removeChild(mres);
			continue;
		}

		mres.setPublishOptions(new PublishOptions());

		PublishUtil.getResources(mrunit, monitor, jrConfig).add(mres);
	}
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:58,代碼來源:ImpInputControls.java

示例5: isForType

import net.sf.jasperreports.types.date.DateRange; //導入依賴的package包/類
public boolean isForType(Class<?> valueClass) {
	return Date.class.isAssignableFrom(valueClass) || DateRange.class.isAssignableFrom(valueClass);
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:4,代碼來源:DateInput.java


注:本文中的net.sf.jasperreports.types.date.DateRange類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。