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

Java JRDesignParameter类代码示例

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

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



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

示例1: buildJRDesignParameters

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
public static Map<String,JRDesignParameter> buildJRDesignParameters(Map<String,Object> parameters)
{
	// convert parameters to JRDesignParameters so they can be parsed
	HashMap<String,JRDesignParameter> jrParameters = new HashMap<String,JRDesignParameter>();

	Iterator<String> iterator = parameters.keySet().iterator();
	while (iterator.hasNext())
	{
		String key = iterator.next();
		Object value = parameters.get(key);
		
		if (value != null)
		{
			JRDesignParameter jrParameter = new JRDesignParameter();
			jrParameter.setName(key);
			jrParameter.setValueClass(value.getClass());
			
			jrParameters.put(jrParameter.getName(), jrParameter);
		}			
	}

	return jrParameters;
}
 
开发者ID:mtpettyp,项目名称:openreports,代码行数:24,代码来源:ORUtil.java


示例2: run

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
public void run(List<JRDesignParameter> prms) {
	Object sel = selection[0];
	MExpression mexpr = null;
	List<MFromTable> tbls = Util.getFromTables((ANode) sel);
	for (JRParameter t : prms) {
		if (sel instanceof AMExpression)
			mexpr = run(t, (AMExpression<?>) sel);
		else if (isInSelect(sel))
			mexpr = run(t, (ANode) sel, -1);
		sel = mexpr;
		mexpr.getOperands().add(Factory.getDefaultOperand(mexpr));
		ParameterPOperand pop = new ParameterPOperand(mexpr);
		pop.setJrParameter((JRDesignParameter) t);
		mexpr.getOperands().add(pop);
	}
	showDialog(mexpr);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:CreateExpression.java


示例3: getColumnText

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
	JRDesignParameter field = (JRDesignParameter) element;
	switch (columnIndex) {
	case 0:
		return field.getName();
	case 1:
		if (field.isSystemDefined())
			return ""; //$NON-NLS-1$
		else
			return Boolean.toString(field.isForPrompting());
	case 2:
		return Misc.nvl(field.getValueClassName(), ""); //$NON-NLS-1$
	case 3:
		return Misc.nvl(field.getDescription(), ""); //$NON-NLS-1$
	}
	return ""; //$NON-NLS-1$
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:ParametersTable.java


示例4: refresh

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
/**
 * When the data is refreshed is checked if the class name is a collection, in this
 * case the controls to define the nested type are shown, otherwise they are hidden.
 */
@Override
public void refresh() {
	setRefreshing(true);
	APropertyNode element = getElement();
	if (element != null) {
		element.getPropertyDescriptors();
		for (Object key : widgets.keySet()) {
			if (key.equals(JRDesignParameter.PROPERTY_NESTED_TYPE_NAME)){
				String type = element.getPropertyValue(JRDesignVariable.PROPERTY_VALUE_CLASS_NAME).toString();
				if (isClassCollection(type)) setCompVisible(true);
				else setCompVisible(false);
			}
			widgets.get(key).setData(element, element.getPropertyValue(key));
			if (key.equals(JRDesignParameter.PROPERTY_DEFAULT_VALUE_EXPRESSION)){
				// fix the visibilities mask: allows only PARAMETERS
				ExpressionContext expContext = ((WTextExpression) ((SPExpression) widgets.get(key)).getControl()).getExpressionContext();
				if(expContext!=null){
					expContext.setVisibilities(EnumSet.of(Visibility.SHOW_PARAMETERS));
				}
			}
		}
	}
	setRefreshing(false);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:ParameterSection.java


示例5: setValue

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
/**
 * Set the valued edited by this dialog
 * 
 * @param value a ParametersDTO (not null) of the parameters list that the user manipulate  
 * @param datasetRun the (not null) dataset run from where the value is extracted
 */
public void setValue(ParameterDTO value, MDatasetRun datasetRun) {
	this.value = value;
	if (value == null) {
		value = new ParameterDTO();
	}
	//get the dataset referenced by the dataset run
	JRDataset dataset = datasetRun.getJasperDesign().getDatasetMap().get(datasetRun.getPropertyValue(JRDesignDatasetRun.PROPERTY_DATASET_NAME));
	if (dataset != null) {
		List<JRParameter> userParameters = new ArrayList<JRParameter>();
		//flag to add or not the system parameters
		boolean addSystemParameters = true;
		for(JRParameter param : dataset.getParameters()){
			if (!param.isSystemDefined() || addSystemParameters) userParameters.add(param);
		}
		//the original dataset parameters are cached
		datasetParameters = userParameters.toArray(new JRParameter[userParameters.size()]);
	}
	else datasetParameters = new JRDesignParameter[0];
	if (table != null)
		fillTable(table);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:ComboParametersPage.java


示例6: postSetValue

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
/**
 * Get a list of all the datasets run used by every element, and if one or more of this are references to the dataset
 * with the changed parameter search create a command that search inside them the reference to the parameter and if
 * found rename it
 */
@Override
public Command postSetValue(IPropertySource target, Object prop, Object newValue, Object oldValue) {
	JSSCompoundCommand c = new JSSCompoundCommand(null);
	// Check if the updated element is a dataset and the updated property is the name
	if (target instanceof MParameter && prop.equals(JRDesignParameter.PROPERTY_NAME)) {
		MParameter mprm = (MParameter) target;
		if (mprm.getParent() != null && mprm.getParent().getParent() != null) {
			// Get all the references to this dataset
			ANode parentElement = mprm.getParent().getParent();
			c.setReferenceNodeIfNull(parentElement);
			if (parentElement instanceof MDataset) {
				MDataset parentDataset = (MDataset) parentElement;
				List<IDatasetContainer> references = DeleteDatasetCommand.getDatasetUsage(parentDataset.getRoot()
						.getChildren(), parentDataset.getPropertyActualValue(JRDesignDataset.PROPERTY_NAME).toString());
				for (IDatasetContainer datasetRun : references) {
					List<MDatasetRun> datasetList = datasetRun.getDatasetRunList();
					for (MDatasetRun actualDataset : datasetList) {
						c.add(new SetParameterName(actualDataset, oldValue.toString(), newValue.toString()));
					}
				}
			}
		}
	}
	return c;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:31,代码来源:PostSetParameterName.java


示例7: getPropertyValue

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
@Override
public Object getPropertyValue(Object id) {
	JRDesignParameter jrParameter = (JRDesignParameter) getValue();
	if (id.equals(JRDesignParameter.PROPERTY_DESCRIPTION))
		return jrParameter.getDescription();
	if (id.equals(JRDesignParameter.PROPERTY_FOR_PROMPTING))
		return new Boolean(jrParameter.isForPrompting());
	if (id.equals(JRDesignParameter.PROPERTY_DEFAULT_VALUE_EXPRESSION))
		return ExprUtil.getExpression(jrParameter.getDefaultValueExpression());
	if (id.equals(PROPERTY_MAP)) {
		return jrParameter.getPropertiesMap();
	}
	if (id.equals(JRDesignParameter.PROPERTY_NESTED_TYPE_NAME))
		return jrParameter.getNestedTypeName();
	return super.getPropertyValue(id);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:MParameter.java


示例8: setPropertyValue

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
	JRDesignParameter jrParameter = (JRDesignParameter) getValue();
	if (id.equals(JRDesignParameter.PROPERTY_DESCRIPTION))
		jrParameter.setDescription((String) value);
	else if (id.equals(JRDesignParameter.PROPERTY_FOR_PROMPTING) && isMainDataset())
		jrParameter.setForPrompting(((Boolean) value).booleanValue());
	else if (id.equals(JRDesignParameter.PROPERTY_NESTED_TYPE_NAME))
		jrParameter.setNestedTypeName((String) value);
	else if (id.equals(JRDesignParameter.PROPERTY_DEFAULT_VALUE_EXPRESSION))
		jrParameter.setDefaultValueExpression(ExprUtil.setValues(jrParameter.getDefaultValueExpression(), value));
	else if (id.equals(PROPERTY_MAP)) {
		JRPropertiesMap v = (JRPropertiesMap) value;
		String[] names = jrParameter.getPropertiesMap().getPropertyNames();
		for (int i = 0; i < names.length; i++) {
			jrParameter.getPropertiesMap().removeProperty(names[i]);
		}
		names = v.getPropertyNames();
		for (int i = 0; i < names.length; i++)
			jrParameter.getPropertiesMap().setProperty(names[i], v.getProperty(names[i]));
		this.getPropertyChangeSupport().firePropertyChange(PROPERTY_MAP, false, true);
	}
	super.setPropertyValue(id, value);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:MParameter.java


示例9: createPropertyDescriptors

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *          the desc
 */
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {
	validator = new ParameterNameValidator();
	validator.setTargetNode(this);
	JSSValidatedTextPropertyDescriptor nameD = new JSSValidatedTextPropertyDescriptor(JRDesignParameter.PROPERTY_NAME, Messages.common_name, validator);
	nameD.setDescription(Messages.MParameterSystem_name_description);
	desc.add(nameD);

	NClassTypePropertyDescriptor classD = new NClassTypePropertyDescriptor(JRDesignParameter.PROPERTY_VALUE_CLASS_NAME,
			Messages.common_class);
	classD.setDescription(Messages.MParameterSystem_class_description);
	desc.add(classD);
	classD.setHelpRefBuilder(new HelpReferenceBuilder(
			"net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#parameter_class"));

	defaultsMap.put(JRDesignParameter.PROPERTY_VALUE_CLASS_NAME, "java.lang.String"); //$NON-NLS-1$
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:MParameterSystem.java


示例10: setPropertyValue

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
public void setPropertyValue(Object id, Object value) {
	JRDesignField jrField = (JRDesignField) getValue();
	if (id.equals(JRDesignParameter.PROPERTY_NAME)) {
		if (!value.equals("")) {
			jrField.setName((String) value);
		}
	} else if (id.equals(JRDesignParameter.PROPERTY_VALUE_CLASS_NAME)){
		jrField.setValueClassName((String) value);
	}
	else if (id.equals(JRDesignParameter.PROPERTY_DESCRIPTION)){
		jrField.setDescription((String) value);
	}
	else if (id.equals(PROPERTY_MAP)) {
		JRPropertiesMap v = (JRPropertiesMap) value;
		String[] names = jrField.getPropertiesMap().getPropertyNames();
		for (int i = 0; i < names.length; i++) {
			jrField.getPropertiesMap().removeProperty(names[i]);
		}
		names = v.getPropertyNames();
		for (int i = 0; i < names.length; i++)
			jrField.getPropertiesMap().setProperty(names[i], v.getProperty(names[i]));
		this.getPropertyChangeSupport().firePropertyChange(PROPERTY_MAP, false, true);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:MField.java


示例11: createInput

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
protected boolean createInput(Composite sectionClient, JRDesignParameter p, Map<String, Object> params, boolean first)
		throws ClassNotFoundException {
	ParameterJasper pres = new ParameterJasper(p);
	// Use a custom control for the report maxcount instead of the integer standard one
	if (p.getName().equals(JRParameter.REPORT_MAX_COUNT)) {
		createControl(sectionClient, pres, new BooleanNumericInput(), p, first);
		return true;
	}
	for (IDataInput in : ReportControler.inputs) {
		if (in.isForType(pres.getValueClass())) {
			createControl(sectionClient, pres, in.getInstance(), p, first);
			return true;
		}
	}
	return false;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:VParameters.java


示例12: createBParam

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

	ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
	scompo.setExpandHorizontal(true);
	scompo.setExpandVertical(true);

	Composite sectionClient = toolkit.createComposite(scompo);
	sectionClient.setLayout(new GridLayout(2, false));

	for (JRParameter p : prompts)
		if (!p.isForPrompting() || p.isSystemDefined())
			createInput(toolkit, sectionClient, (JRDesignParameter) p);
	sectionClient.pack();
	scompo.setMinSize(sectionClient.getSize());
	scompo.setContent(sectionClient);
	bptab.setControl(scompo);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:ParametersDialog.java


示例13: createUserParam

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
private void createUserParam(FormToolkit toolkit, CTabFolder tabFolder) {
	if (canShowParameters()) {
		CTabItem ptab = new CTabItem(tabFolder, SWT.NONE);
		ptab.setText(Messages.ParametersDialog_user_parameters);

		ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
		scompo.setExpandHorizontal(true);
		scompo.setExpandVertical(true);

		Composite sectionClient = toolkit.createComposite(scompo);
		sectionClient.setLayout(new GridLayout(2, false));

		for (JRParameter p : prompts)
			if (p.isForPrompting() && !p.isSystemDefined())
				createInput(toolkit, sectionClient, (JRDesignParameter) p);
		sectionClient.pack();
		scompo.setMinSize(sectionClient.getSize());
		scompo.setContent(sectionClient);
		ptab.setControl(scompo);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:ParametersDialog.java


示例14: cloneParameter

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
/**
 *  Utility function to duplicate a parameter. All the parameter properties
 *  and parameter default value expression are duplicated as well.
 */
public static JRDesignParameter cloneParameter(JRDesignParameter param)
{
    JRDesignParameter newParam = new JRDesignParameter();
    newParam.setName( param.getName() );
    newParam.setForPrompting( param.isForPrompting() );
    newParam.setSystemDefined( param.isSystemDefined() );
    //newParam.setValueClass( param.getValueClass() );
    newParam.setValueClassName( param.getValueClassName() );
    newParam.setDescription( param.getDescription());
    if (param.getDefaultValueExpression() != null)
    {
        newParam.setDefaultValueExpression( cloneExpression( (JRDesignExpression)param.getDefaultValueExpression()) );
    }
    
    // Duplicate properties...
    replacePropertiesMap(param.getPropertiesMap(), newParam.getPropertiesMap());
    
    return newParam;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:24,代码来源:ModelUtils.java


示例15: ParameterNode

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
public ParameterNode(JasperDesign jd, JRDesignParameter parameter, Lookup doLkp)
{
    super (Children.LEAF, new ProxyLookup(doLkp, Lookups.fixed(jd, parameter)));
    this.jd = jd;
    this.parameter = parameter;
    setDisplayName ( parameter.getName());
    super.setName( parameter.getName() );
    if (parameter.isSystemDefined())
    {
        setIconBaseWithExtension("com/jaspersoft/ireport/designer/resources/parameter-16.png");
    }
    else
    {
        setIconBaseWithExtension("com/jaspersoft/ireport/designer/resources/parameter-16.png");
    }
    
    parameter.getEventSupport().addPropertyChangeListener(this);
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:19,代码来源:ParameterNode.java


示例16: propertyChange

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
    
    com.jaspersoft.ireport.designer.IReportManager.getInstance().notifyReportChange();
    if (evt.getPropertyName() == null) return;
    if (evt.getPropertyName().equals( JRDesignParameter.PROPERTY_NAME ))
    {
        super.setName(getParameter().getName());
        this.setDisplayName(getParameter().getName());
        // update sorting of childrens...
        if (this.getParentNode() != null && this.getParentNode() instanceof ParametersNode)
        {
            SwingUtilities.invokeLater(new Runnable() {

                public void run() {
                    ((ParametersNode)(ParameterNode.this.getParentNode())).updateSorting();
                }
            });
        }
    }
    
    // Update the sheet
    this.firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue() );
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:24,代码来源:ParameterNode.java


示例17: setString

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
@Override
public void setString(String value) {

    if (value == null ||
        value.equals(""))
    {
        // set the default value...
        value = "net.sf.jasperreports.engine.JRDefaultScriptlet";
    }

    if (scriptlet.getName().equals("REPORT"))
    {
        dataset.setScriptletClass(value);
        scriptlet.setValueClassName(value);
    }
    else
    {
        scriptlet.setValueClassName(value);
        JRDesignParameter p = (JRDesignParameter)dataset.getParametersMap().get(scriptlet.getName()+"_SCRIPTLET");
        if (p!=null)
        {
            p.setValueClassName(value);
        }
    }
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:26,代码来源:ScriptletNode.java


示例18: createTransferable

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
@Override
protected Transferable createTransferable(JComponent c) {

  String text = "";
  if (c instanceof JList)
  {
      JList jList = (JList)c;
      if (jList.getSelectedValue() instanceof JRDesignParameter)
      {
          JRDesignParameter p = (JRDesignParameter) jList.getSelectedValue();
          text =  ((action == MOVE) ? "$P{" : "$P!{")+ p.getName() + "}";
      }
  }
  
  return new StringSelection(text);
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:17,代码来源:ParameterTextTransferHandler.java


示例19: jList1MouseClicked

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
private void jList1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList1MouseClicked

        if (SwingUtilities.isLeftMouseButton(evt) && evt.getClickCount() == 2 && jList1.getSelectedValue() != null)
        {
            JRDesignParameter p = (JRDesignParameter)jList1.getSelectedValue();
            JRParameterDialog pd = new JRParameterDialog(getReportQueryDialog(),getDataset().getParametersMap());
            pd.setExpressionContext(new ExpressionContext(getDataset()));
            pd.setParameter(p);
            pd.setVisible(true);

            if (pd.getDialogResult() == JOptionPane.OK_OPTION)
            {
                JRDesignParameter pNew = pd.getParameter();

                p.setName(pNew.getName());
                p.setValueClassName(pNew.getValueClassName());
                p.setDefaultValueExpression(pNew.getDefaultValueExpression());

                jList1.updateUI();
            }

        }

    }
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:25,代码来源:SQLFieldsProviderEditor.java


示例20: createNewParameter

import net.sf.jasperreports.engine.design.JRDesignParameter; //导入依赖的package包/类
private void createNewParameter()
{
     if (getDataset() == null) return;
    JRParameterDialog dialog = new JRParameterDialog(getReportQueryDialog(), getDataset().getParametersMap());
    dialog.setExpressionContext(new ExpressionContext(getDataset()));

    dialog.setVisible(true);

    if (dialog.getDialogResult() == JOptionPane.OK_OPTION)
    {
        JRDesignParameter p = dialog.getParameter();
        try {
            getDataset().addParameter(p);
        } catch (JRException ex) {
            ex.printStackTrace();
        }
    }
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:19,代码来源:SQLFieldsProviderEditor.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SingleMemberAnnotation类代码示例发布时间:2022-05-21
下一篇:
Java AdError类代码示例发布时间: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