当前位置: 首页>>代码示例>>Java>>正文


Java JRDesignField.setDescription方法代码示例

本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignField.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java JRDesignField.setDescription方法的具体用法?Java JRDesignField.setDescription怎么用?Java JRDesignField.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.jasperreports.engine.design.JRDesignField的用法示例。


在下文中一共展示了JRDesignField.setDescription方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPropertyValue

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的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

示例2: getFields

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
public List<JRDesignField> getFields(
		JasperReportsContext context, JRDataset dataset, 
		Map<String, Object> parameters, ESSearch connection)
        throws JRException {
    
	logger.debug("Providing fields a query.");
	
	String query = "{ query: { match_all: {} } }";
	
	if ( dataset.getQuery() != null ) {
		query = dataset.getQuery().getText();
	}
	
	logger.debug("Passing query to connection: " + query);
	connection.setSearch(query);
    Map<String, Class<?>> queryFields = connection.getFields(query);
    
    List<JRDesignField> fields = new ArrayList<JRDesignField>();
    
    for (String fieldName: queryFields.keySet() ) {
        JRDesignField field = new JRDesignField();
        field.setName(fieldName);
        field.setValueClass(queryFields.get(fieldName));
        field.setDescription(fieldName);
        fields.add(field);
    }
    
    return fields;
}
 
开发者ID:WedjaaOpen,项目名称:ESJasperAdapter,代码行数:30,代码来源:ESFieldsProvider.java

示例3: getFieldsFromObjectNode

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
private List<JRDesignField> getFieldsFromObjectNode(ObjectNode node){
	List<JRDesignField> fields = new ArrayList<JRDesignField>();
	Iterator<String> fieldNames = node.fieldNames();
	while(fieldNames.hasNext()){
		String name = fieldNames.next();
		JRDesignField f=new JRDesignField();
		f.setName(ModelUtils.getNameForField(fields, name));
		f.setDescription(name);
		f.setValueClass(String.class);
		fields.add(f);		
	}
	return fields;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:JsonDataManager.java

示例4: addNewField

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
private void addNewField(String nodeName,
		LinkedHashMap<String, JRDesignField> fieldsMap, Node item, String prefix) {
	JRDesignField f = new JRDesignField();
	f.setName(ModelUtils.getNameForField(
			new ArrayList<JRDesignField>(fieldsMap.values()), nodeName));
	f.setValueClass(String.class);
	if (item.getNodeType() == Node.ATTRIBUTE_NODE) {
		f.setDescription(prefix + "@" + item.getNodeName()); //$NON-NLS-1$
	} else {
		f.setDescription(prefix + item.getNodeName());
	}
	fieldsMap.put(nodeName, f);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:XMLDataAdapterDescriptor.java

示例5: getFields

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
public List<JRDesignField> getFields(DataAdapterService con, JasperReportsConfiguration jConfig, JRDataset reportDataset) throws JRException, UnsupportedOperationException {
	jrdsp = ((DataSourceProviderDataAdapterService) con).getProvider();
	if (jrdsp != null) {
		JasperReport jr = null;
		try {
			IFile file = (IFile) jConfig.get(FileUtils.KEY_FILE);
			if (file != null && file.exists()) {
				JasperReportCompiler compiler = new JasperReportCompiler();
				jr = compiler.compileReport(jConfig, file);
			}
		} catch (CoreException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		JRField[] aray = jrdsp.getFields(jr);
		if (aray != null) {
			List<JRDesignField> fields = new ArrayList<JRDesignField>();
			for (JRField f : aray) {
				if (f instanceof JRDesignField)
					fields.add((JRDesignField) f);
				else {
					JRDesignField jdf = new JRDesignField();
					jdf.setName(StringUtils.xmlEncode(f.getName(), null));
					jdf.setValueClassName(f.getValueClassName());
					jdf.setDescription(StringUtils.xmlEncode(f.getDescription(), null));
					fields.add(jdf);
				}
			}
			return fields;
		}
	}
	return new ArrayList<JRDesignField>();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:35,代码来源:JRDSProviderFieldsProvider.java

示例6: addField

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
private static void addField(String name, String description, String type, Map<String, JRDesignField> fieldsMap) {
	JRDesignField f = new JRDesignField();
	f.setName(name);
	f.setDescription(description);

	f.setValueClassName(type);

	fieldsMap.put(name, f);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:OlapFieldsProviderSupport.java

示例7: getAdapter

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
@Override
public Object getAdapter(Class adapter) {
	if(adapter==JRDesignField.class || adapter==JRField.class){
		JRDesignField field=new JRDesignField();
		field.setName(nodeText);
		field.setDescription(expression);
		field.setValueClass(String.class);
		return field;
	}
	return super.getAdapter(adapter);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:JsonSupportNode.java

示例8: getAdapter

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
@Override
public Object getAdapter(Class adapter) {
	if(adapter==JRDesignField.class || adapter==JRField.class){
		JRDesignField field=new JRDesignField();
		field.setName(nodeName);
		field.setDescription(xpathExpression);
		field.setValueClass(String.class);
		return field;
	}
	return super.getAdapter(adapter);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:XMLNode.java

示例9: createField

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
private static JRDesignField createField(String fieldName, Class<?> _class) {
	JRDesignField field = new JRDesignField();
	field.setName(fieldName);
	field.setValueClass(_class);
	field.setDescription(null);
	return field;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:8,代码来源:HBaseFieldsProvider.java

示例10: getFields

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
@Override
public JRField[] getFields(IReportConnection con, JRDataset reportDataset, Map parameters) throws JRException, UnsupportedOperationException {
    /**
         * Copyright (C) 2006 CINCOM SYSTEMS, INC.
         * All Rights Reserved
         * www.cincom.com
         */
        if (con instanceof JRXMLADataSourceConnection)
        {
            try {
                String query = reportDataset.getQuery().getText();
               
                 java.util.ArrayList v_fields = getFields(query, (JRXMLADataSourceConnection)con);
               
                 // Translate 
                JRField[] final_fields = new JRField[v_fields.size()];
                for (int i=0; i<v_fields.size(); ++i)
                {
                    XmlaFieldNode f = (XmlaFieldNode)v_fields.get(i);
                    JRDesignField field = new JRDesignField();
                    field.setName( f.getName() );
                    field.setValueClassName( f.getValueClassName() );
                    field.setDescription( f.getDescription() );
                    final_fields[i] = field;
                }

                return final_fields;
            
                 
            } catch (Exception ex)
            {
                throw new JRException(ex);
            }
        }
        else
        {
                 throw new JRException("The active connection is not of type XMLA. Activate an XMLA connection first.");
        }
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:40,代码来源:CincomMDXFieldsProvider.java

示例11: readFields

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
public List<JRDesignField> readFields(String query) throws Exception {
    List<JRDesignField> fields = new ArrayList<JRDesignField>();

    try {

        InputStream is = getClass().getResourceAsStream("/com/jaspersoft/ireport/designer/data/data.jrxml");
        JasperDesign dataJd = net.sf.jasperreports.engine.xml.JRXmlLoader.load(is);

        // Remove fields...
        dataJd.getFieldsList().clear(); // This would not be legal...
        dataJd.getFieldsMap().clear();

        JasperReport jr = JasperCompileManager.compileReport(dataJd);

        net.sf.jasperreports.engine.JRField[] jrfields = getDataSourceProvider().getFields( jr );

        for (int i=0; i< jrfields.length; ++i)
        {
            JRDesignField field = new JRDesignField();
            field.setName( jrfields[i].getName());
            field.setDescription( jrfields[i].getDescription());
            field.setValueClassName( jrfields[i].getValueClassName());
            field.setValueClass( jrfields[i].getValueClass());
            ModelUtils.replacePropertiesMap( jrfields[i].getPropertiesMap(), field.getPropertiesMap());
            fields.add(field);
        }
    } catch (Exception ex)
    {}

    return fields;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:32,代码来源:JRDataSourceProviderConnection.java

示例12: addPathColumn

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
private void addPathColumn(List<JRField> fields) {
    JRDesignField field = new JRDesignField();
    field.setName("Path");
    field.setDescription("Path");
    field.setValueClass(String.class);
    fields.add(field);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:8,代码来源:ResourceQueryFieldsProvider.java

示例13: addStepField

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
private void addStepField(List<JRField> fields) {
    JRDesignField field = new JRDesignField();
    field.setName("Step");
    field.setDescription("Step");
    field.setValueClass(Integer.class);
    fields.add(field);
    
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:9,代码来源:JRobinFieldsProvider.java

示例14: addTimestampField

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
private void addTimestampField(List<JRField> fields) {
    JRDesignField field = new JRDesignField();
    field.setName("Timestamp");
    field.setDescription("Timestamp");
    field.setValueClass(Date.class);
    fields.add(field);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:8,代码来源:JRobinFieldsProvider.java

示例15: jButton1ActionPerformed

import net.sf.jasperreports.engine.design.JRDesignField; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

    if (jTextFieldName.getText().length() == 0)
    {
        JOptionPane.showMessageDialog(this, 
                //I18n.getString("message.olapBrowser.notValidFieldName",
                I18n.getString("OlapBrowser.Message.Error"),
                I18n.getString("OlapBrowser.Message.Error2"), JOptionPane.ERROR_MESSAGE);
        return;
        
    }
    if (jTextFieldExpression.getText().length() == 0)
    {
        JOptionPane.showMessageDialog(this,
                //I18n.getString("message.olapBrowser.notValidFieldExpression",
                I18n.getString("OlapBrowser.Message.Error3"),
                I18n.getString("OlapBrowser.Message.Error2"), JOptionPane.ERROR_MESSAGE);
        return;
    }
    
    JRDesignField field = new JRDesignField();
    field.setName(jTextFieldName.getText().trim() );
    field.setValueClassName(""+((Tag)jComboBoxType.getSelectedItem()).getValue());
    field.setDescription( jTextFieldExpression.getText() );
    
   /*  
    try
    {
            MappingLexer lexer = new MappingLexer(new StringReader(jTextFieldExpression.getText()));
            
            //MappingParser parser = new MappingParser(lexer);
            //parser.setMappingMetadata(this);
            parser.mapping();
    }
    catch (Exception e)
    {
        JOptionPane.showMessageDialog(this,"Field expression not valid:\n" + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        return;
    }
    */                
    
    
    if (fieldAlreadyExists(field))
    {
        JOptionPane.showMessageDialog(this,
                //I18n.getString("message.olapBrowser.fieldDuplicated",
                I18n.getString("OlapBrowser.Message.Warning"), 
                I18n.getString("OlapBrowser.Message.Error2"), JOptionPane.ERROR_MESSAGE);
        return;
    }
    
    Vector row = new Vector();
    row.addElement(field);
    row.addElement(field.getValueClassName());
    row.addElement(field.getDescription());
    
    DefaultTableModel dtm = (DefaultTableModel)getJTableFields().getModel();
    dtm.addRow(row);
    getJTableFields().getSelectionModel().addSelectionInterval( getJTableFields().getRowCount()-1, getJTableFields().getRowCount()-1 );
        
    
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:64,代码来源:OlapBrowser.java


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