• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JRDesignExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignExpression的典型用法代码示例。如果您正苦于以下问题:Java JRDesignExpression类的具体用法?Java JRDesignExpression怎么用?Java JRDesignExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JRDesignExpression类属于net.sf.jasperreports.engine.design包,在下文中一共展示了JRDesignExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createObject

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JRDesignExpression expression = new JRDesignExpression();

	String className = atts.getValue(JRXmlConstants.ATTRIBUTE_class);
	if (className == null)
	{
		expression.setValueClass(java.lang.String.class);
	}
	else
	{
		expression.setValueClassName(className);
	}

	return expression;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:JRStringExpressionFactory.java


示例2: createObject

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JRDesignExpression expression = new JRDesignExpression();

	String value = atts.getValue(JRXmlConstants.ATTRIBUTE_class);
	
	if (value != null)
	{
		// being backward compatible
		if(value.equals("dori.jasper.engine.JasperReport"))
		{
			value = JasperReport.class.getName();
		}
		expression.setValueClassName(value);
	}
	else
	{
		expression.setValueClass(java.lang.String.class);
	}

	return expression;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:JRSubreportExpressionFactory.java


示例3: createObject

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JRDesignVariable variable = (JRDesignVariable)digester.peek();

	JRDesignExpression expression = new JRDesignExpression();
	if (
		variable.getCalculationValue() == CalculationEnum.COUNT
		|| variable.getCalculationValue() == CalculationEnum.DISTINCT_COUNT
		)
	{
		expression.setValueClassName(java.lang.Object.class.getName());
	}
	else
	{
		expression.setValueClassName(variable.getValueClassName());
	}

	return expression;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRVariableExpressionFactory.java


示例4: createObject

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public Object createObject(Attributes attributes)
{
	JRDesignCrosstabMeasure measure = (JRDesignCrosstabMeasure) digester.peek();

	JRDesignExpression expression = new JRDesignExpression();
	if (
		measure.getCalculationValue() == CalculationEnum.COUNT
		|| measure.getCalculationValue() == CalculationEnum.DISTINCT_COUNT
		)
	{
		expression.setValueClassName(Object.class.getName());
	}
	else
	{
		expression.setValueClassName(measure.getValueClassName());
	}

	return expression;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRCrosstabMeasureExpressionFactory.java


示例5: findFile

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
protected AFileResource findFile(MReportUnit mrunit,
		IProgressMonitor monitor, JasperDesign jd, Set<String> fileset,
		JRDesignExpression exp, IFile file) {
	String str = ExpressionUtil.cachedExpressionEvaluation(exp, jrConfig);
	if (str == null || fileset.contains(str))
		return null;

	File f = findFile(file, str);
	if (f != null && f.exists()) {
		PublishOptions popt = new PublishOptions();
		popt.setjExpression(exp);
		if (!f.getName().contains(":"))
			popt.setExpression("\"repo:" + f.getName() + "\"");
		fileset.add(str);

		return addResource(monitor, mrunit, fileset, f, popt);
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:AImpObject.java


示例6: performRequest

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public void performRequest(Request req) {
	if (RequestConstants.REQ_OPEN.equals(req.getType())) {
		if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
			JRExpressionEditor wizard = new JRExpressionEditor();
			MHtml m = (MHtml) getModel();
			wizard.setValue((JRDesignExpression) m
					.getPropertyValue(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION));
			ExpressionContext ec=ModelUtils.getElementExpressionContext((JRDesignElement)m.getValue(), m);
			wizard.setExpressionContext(ec);
			WizardDialog dialog = ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(Display.getDefault()
					.getActiveShell(), wizard);
			if (dialog.open() == Dialog.OK) {
				SetValueCommand cmd = new SetValueCommand();
				cmd.setTarget((IPropertySource) getModel());
				cmd.setPropertyId(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION);
				cmd.setPropertyValue(wizard.getValue());
				getViewer().getEditDomain().getCommandStack().execute(cmd);
			}
		}
	} else
		super.performRequest(req);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:HtmlFigureEditPart.java


示例7: setExpression

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
/**
 * Sets the expression for the widget.
 * 
 * @param exp
 *          the expression to set
 */
public void setExpression(JRDesignExpression exp) {
	isRefreshing = true;
	this.expression = exp;

	// PAY ATTENTION: Checks are needed in order to avoid notification
	// loop due to the modifyEvent raised after a setText call.
	if (exp != null && !exp.getText().equals(textExpression.getText())) {
		textExpression.setText(exp.getText());
		textExpression.setToolTipText(exp.getText());
		if (exp.getText().length() >= oldpos)
			textExpression.setSelection(oldpos, oldpos);

	} else if (exp == null && !textExpression.getText().isEmpty()) {
		textExpression.setText(""); //$NON-NLS-1$
		textExpression.setToolTipText(""); //$NON-NLS-1$
	}

	// Notifies the listeners of the new expression
	fireModifyEvent();

	isRefreshing = false;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:WTextExpression.java


示例8: getNewInputObject

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
protected String getNewInputObject() {
	if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
		JRExpressionEditor wizard = new JRExpressionEditor();
		WizardDialog dialog = 
				ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(getShell(),wizard);
		if (dialog.open() == Dialog.OK) {
			JRDesignExpression newExp = wizard.getValue();
			if(newExp!=null &&
					!Misc.nvl(newExp.getText()).equals("")){
				return newExp.getText();
			}
		}
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:ExpressionListFieldEditor.java


示例9: createSerie

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public JRDesignGanttSeries createSerie(JRDesignExpression expr, JRGanttSeries prev) {
	JRDesignGanttSeries f = new JRDesignGanttSeries();
	f.setSeriesExpression(expr);
	if (prev == null) {
		f.setPercentExpression(new JRDesignExpression("0"));
		f.setStartDateExpression(new JRDesignExpression("new java.util.Date()"));
		f.setEndDateExpression(new JRDesignExpression("new java.util.Date()"));
		f.setTaskExpression(new JRDesignExpression("\"Task\""));
	} else {
		f.setPercentExpression(ExprUtil.clone(prev.getPercentExpression()));
		f.setStartDateExpression(ExprUtil.clone(prev.getStartDateExpression()));
		f.setEndDateExpression(ExprUtil.clone(prev.getEndDateExpression()));
		f.setTaskExpression(ExprUtil.clone(prev.getTaskExpression()));
		f.setLabelExpression(ExprUtil.clone(prev.getLabelExpression()));
	}
	return f;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:GanttSeries.java


示例10: createSerie

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public JRDesignTimePeriodSeries createSerie(JRDesignExpression expr, JRTimePeriodSeries prev) {
	JRDesignTimePeriodSeries f = new JRDesignTimePeriodSeries();
	f.setSeriesExpression(expr);
	if (prev == null) {
		f.setValueExpression(new JRDesignExpression("0"));
		f.setStartDateExpression(new JRDesignExpression("new java.util.Date()"));
		f.setEndDateExpression(new JRDesignExpression("new java.util.Date()"));
	} else {
		f.setValueExpression(ExprUtil.clone(prev.getValueExpression()));
		f.setStartDateExpression(ExprUtil.clone(prev.getStartDateExpression()));
		f.setEndDateExpression(ExprUtil.clone(prev.getEndDateExpression()));
		f.setLabelExpression(ExprUtil.clone(prev.getLabelExpression()));
	}
	return f;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:TimePeriodSerie.java


示例11: createDetailCells

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
private void createDetailCells(JRDesignCrosstab jdc) {
	List<JRCrosstabCell> cells = jdc.getCellsList();
	JRCrosstabMeasure[] measures = jdc.getMeasures();
	if (measures != null && cells != null)
		for (JRCrosstabCell c : cells) {
			int y = 0;
			if (c.getHeight() != null && measures.length > 0) {
				int h = c.getHeight() / measures.length;
				for (int i = 0; i < measures.length; i++) {
					JRDesignExpression exp = new JRDesignExpression();
					exp.setText("$V{" + measures[i].getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$

					JRDesignTextField tf = (JRDesignTextField) new MTextField()
							.createJRElement(getConfig().getJasperDesign());
					tf.setX(0);
					tf.setY(y);
					tf.setWidth(c.getWidth());
					tf.setHeight(h);
					tf.setExpression(exp);
					((JRDesignCellContents) c.getContents()).addElement(tf);
					y += h;
				}
			}
		}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:CrosstabWizard.java


示例12: setBucketExpression

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
public static void setBucketExpression(JRDesignCrosstabBucket bucket,
		String oldExpText, AgregationFunctionEnum function) {
	JRDesignExpression exp = (JRDesignExpression) bucket.getExpression();
	if (function == AgregationFunctionEnum.UNIQUE)
		exp.setText(oldExpText);
	else if (function == AgregationFunctionEnum.YEAR) {
		exp.setText("new SimpleDateFormat(\"yyyy\").format(" + oldExpText
				+ ")");
		bucket.setValueClassName(String.class.getName());
	} else if (function == AgregationFunctionEnum.MONTH) {
		exp.setText("new SimpleDateFormat(\"yyyy-MM\").format("
				+ oldExpText + ")");
		bucket.setValueClassName(String.class.getName());
	} else if (function == AgregationFunctionEnum.WEEK) {
		exp.setText("new SimpleDateFormat(\"yyyy-ww\").format("
				+ oldExpText + ")");
		bucket.setValueClassName(String.class.getName());
	} else if (function == AgregationFunctionEnum.DAY) {
		exp.setText("new SimpleDateFormat(\"yyyy-MM-dd\").format("
				+ oldExpText + ")");
		bucket.setValueClassName(String.class.getName());
	}
	bucket.setExpression(exp);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:CrosstabWizard.java


示例13: setPropertyValue

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
public void setPropertyValue(Object id, Object value) {
	JRDesignCrosstabBucket jrField = (JRDesignCrosstabBucket) getValue();

	if (id.equals(JRDesignCrosstabBucket.PROPERTY_ORDER))
		jrField.setOrder((SortOrderEnum) orderD.getEnumValue(value));
	else if (id
			.equals(JRDesignCrosstabBucket.PROPERTY_COMPARATOR_EXPRESSION))
		jrField.setComparatorExpression(ExprUtil.setValues(
				jrField.getComparatorExpression(), value));
	else if (id.equals(JRDesignCrosstabBucket.PROPERTY_ORDER_BY_EXPRESSION))
		jrField.setOrderByExpression(ExprUtil.setValues(
				jrField.getOrderByExpression(), value));
	else if (id.equals(JRDesignCrosstabBucket.PROPERTY_EXPRESSION))
		jrField.setExpression((JRDesignExpression) ExprUtil.setValues(
				jrField.getExpression(), value));
	else if (id.equals(JRDesignCrosstabBucket.PROPERTY_VALUE_CLASS))
		jrField.setValueClassName((String) value);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:MBucket.java


示例14: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement designMap = new JRDesignComponentElement();
	StandardMapComponent component = new StandardMapComponent();
	JRDesignExpression exp1 = new JRDesignExpression();
	exp1.setText(MapDesignConverter.DEFAULT_LATITUDE.toString() + "f"); //$NON-NLS-1$
	JRDesignExpression exp2 = new JRDesignExpression();
	exp2.setText(MapDesignConverter.DEFAULT_LONGITUDE.toString() + "f"); //$NON-NLS-1$
	component.setLatitudeExpression(exp1);
	component.setLongitudeExpression(exp2);
	JRDesignExpression exp3 = new JRDesignExpression();
	exp3.setText(String.valueOf(MapComponent.DEFAULT_ZOOM));
	component.setZoomExpression(exp3);
	designMap.setComponent(component);
	designMap.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "c", //$NON-NLS-1$ //$NON-NLS-2$
			"map")); //$NON-NLS-1$
	StandardItemData markerData = safeGetMarkerData(component, null);
	markerData.setDataset(new JRDesignElementDataset());
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), designMap);
	
	return designMap;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:MMap.java


示例15: fillValue

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
private void fillValue(StandardItemProperty value) {
	isRefresh = true;
	if (isMandatory)
		cprop.setEnabled(false);
	evalue.setExpressionContext(expContext);
	cprop.setText(Misc.nvl(value.getName()));
	if (value.getValueExpression() != null) {
		buseexpr.setSelection(true);
		evalue.setExpression((JRDesignExpression) value.getValueExpression());
	} else {
		buseexpr.setSelection(false);
		tvalue.setText(Misc.nvl(value.getValue()));
	}
	changeValueOrExpression();
	isRefresh = false;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:MarkerPropertyDialog.java


示例16: initWidgets

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
private void initWidgets() {
	if(this.itemProperty==null){
		this.itemProperty = new StandardItemProperty("","",null); //$NON-NLS-1$ //$NON-NLS-2$
	}
	if(this.itemProperty.getValue()!=null){
		useExpressionCheckbox.setSelection(false);
		propertyName.setText(Misc.nvl(itemProperty.getName()));
		propertyValue.setText(itemProperty.getValue());
		propertyValueExpression.setVisible(false);
		propertyValueExpression.setEnabled(false);
		propertyValueExpression.setExpression(null);
		((GridData)propertyValueExpression.getLayoutData()).exclude=true;
	}
	else{
		useExpressionCheckbox.setSelection(true);
		propertyName.setText(Misc.nvl(itemProperty.getName()));
		propertyValueExpression.setExpression((JRDesignExpression)itemProperty.getValueExpression());
		propertyValue.setVisible(false);
		propertyValue.setEnabled(false);
		((GridData)propertyValue.getLayoutData()).exclude=true;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:ItemPropertyDialog.java


示例17: initWidgets

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
private void initWidgets() {
	if(pname.getValue()!=null){
		useExpressionCheckbox.setSelection(false);
		propertyValue.setText(pname.getValue());
		propertyValueExpression.setVisible(false);
		propertyValueExpression.setEnabled(false);
		propertyValueExpression.setExpression(null);
		((GridData)propertyValueExpression.getLayoutData()).exclude=true;
	}
	else{
		useExpressionCheckbox.setSelection(true);
		propertyValueExpression.setExpression((JRDesignExpression)pname.getValueExpression());
		propertyValue.setVisible(false);
		propertyValue.setEnabled(false);
		((GridData)propertyValue.getLayoutData()).exclude=true;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:MapElementDialog.java


示例18: gotoMarker

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
public void gotoMarker(IMarker marker) {
	if (activePage == PAGE_DESIGNER) {
		try {
			Object expr = marker.getAttribute(JRErrorHandler.MARKER_ERROR_JREXPRESSION);
			if (expr != null && expr instanceof String) {
				JRDesignExpression expression = new JRDesignExpression();
				expression.setId(new Integer((String) expr));
				JasperDesign jd = getJasperDesign();
				JRExpressionCollector rc = JRExpressionCollector.collector(jrContext, jd);
				if (!VErrorPreview.openExpressionEditor(jrContext, rc, (JRDesignDataset) jd.getMainDataset(), expression))
					for (JRDataset d : jd.getDatasetsList())
						if (VErrorPreview.openExpressionEditor(jrContext, rc, (JRDesignDataset) d, expression))
							return;
			}
		} catch (CoreException e) {
			e.printStackTrace();
		}
	}
	setActivePage(PAGE_XMLEDITOR);
	IDE.gotoMarker(xmlEditor, marker);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:JrxmlEditor.java


示例19: createFilterExpression

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
private void createFilterExpression(FormToolkit toolkit, CTabFolder tabFolder) {
	CTabItem bptab = new CTabItem(tabFolder, SWT.NONE);
	bptab.setText(Messages.DatasetDialog_filterexpression);

	Composite sectionClient = toolkit.createComposite(tabFolder);
	FillLayout fLayout = new FillLayout();
	fLayout.marginHeight = 5;
	fLayout.marginWidth = 5;
	sectionClient.setLayout(fLayout);

	filterExpression = new WTextExpression(sectionClient, SWT.NONE);
	filterExpression.setBackground(sectionClient.getBackground());
	filterExpression.setExpressionContext(new ExpressionContext(newdataset, mdataset.getJasperConfiguration()));
	filterExpression.setExpression((JRDesignExpression) newdataset.getFilterExpression());
	filterExpression.addModifyListener(new ExpressionModifiedListener() {

		@Override
		public void expressionModified(ExpressionModifiedEvent event) {
			newdataset.setFilterExpression(event.modifiedExpression);
		}
	});
	bptab.setControl(sectionClient);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:DatasetDialog.java


示例20: setExpression

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入依赖的package包/类
public void setExpression(JRDesignExpression exp) {
	this.expression = exp;
	setOnParent(exp);
	
	if (exp != null && exp.getText() != null) {
		
		if (!exp.getText().equals(expText.getText()))
		{
			expText.setText(exp.getText());
			expText.setToolTipText(expText.getText());
		}
	}
	else{
		expText.setText("");
		expText.setToolTipText("");
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:ExpressionWidget.java



注:本文中的net.sf.jasperreports.engine.design.JRDesignExpression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Request类代码示例发布时间:2022-05-21
下一篇:
Java AbstractLayout类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap