本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignParameter.getName方法的典型用法代码示例。如果您正苦于以下问题:Java JRDesignParameter.getName方法的具体用法?Java JRDesignParameter.getName怎么用?Java JRDesignParameter.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.design.JRDesignParameter
的用法示例。
在下文中一共展示了JRDesignParameter.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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$
}
示例2: 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);
}
示例3: 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);
}
示例4: processSubReports
import net.sf.jasperreports.engine.design.JRDesignParameter; //导入方法依赖的package包/类
/**
* Generates sub-reports and adds them into the parameter map.
*
* @param templateFile
* The path to the JR template of the report.
* @param parameters
* The parameters to be sent to Jasper Report.
* @param baseDesignPath
* Base design path.
* @param connectionProvider
* A connection provider in case the report needs it.
* @param language
* Language to be used when generating the sub-report.
* @throws OBException
* In case there is any error generating the sub-reports an exception is thrown with the
* error message.
*/
private static void processSubReports(String templateFile, Map<String, Object> parameters,
String baseDesignPath, ConnectionProvider connectionProvider, String language)
throws OBException {
try {
JasperDesign jasperDesign = JRXmlLoader.load(templateFile);
Object[] parameterList = jasperDesign.getParametersList().toArray();
String parameterName = "";
String subReportName = "";
Collection<String> subreportList = new ArrayList<String>();
File template = new File(templateFile);
String templateLocation = template.getParent() + "/";
/*
* TODO: At present this process assumes the subreport is a .jrxml file. Need to handle the
* possibility that this subreport file could be a .jasper file.
*/
for (int i = 0; i < parameterList.length; i++) {
final JRDesignParameter parameter = (JRDesignParameter) parameterList[i];
if (parameter.getName().startsWith("SUBREP_")) {
parameterName = parameter.getName();
subreportList.add(parameterName);
subReportName = Replace.replace(parameterName, "SUBREP_", "") + ".jrxml";
JasperReport jasperReportLines = createSubReport(templateLocation, subReportName,
baseDesignPath, connectionProvider, language);
parameters.put(parameterName, jasperReportLines);
}
}
} catch (final JRException e) {
log.error("Error processing subreports for template: " + templateFile, e);
throw new OBException(e.getMessage(), e);
}
}
示例5: getPropertyValue
import net.sf.jasperreports.engine.design.JRDesignParameter; //导入方法依赖的package包/类
public Object getPropertyValue(Object id) {
JRDesignParameter jrParameter = (JRDesignParameter) getValue();
if (id.equals(JRDesignParameter.PROPERTY_NAME))
return jrParameter.getName();
if (id.equals(JRDesignParameter.PROPERTY_VALUE_CLASS_NAME))
return jrParameter.getValueClassName();
return null;
}
示例6: setParameter
import net.sf.jasperreports.engine.design.JRDesignParameter; //导入方法依赖的package包/类
/** Setter for property tmpParameter.
* @param tmpParameter New value of property tmpParameter.
**/
public void setParameter(JRDesignParameter tmpParameter) {
this.jTextFieldName.setText( tmpParameter.getName() );
oldName =tmpParameter.getName();
String text = "";
if (tmpParameter.getDefaultValueExpression() != null &&
tmpParameter.getDefaultValueExpression().getText() != null )
{
text = tmpParameter.getDefaultValueExpression().getText();
}
String className = tmpParameter.getValueClassName();
if (className != null)
{
boolean found = false;
for (int i=0; i<jComboBox1.getItemCount(); ++i)
{
Object val=jComboBox1.getItemAt(i);
if (val instanceof Tag && className.equals(((Tag)val).getValue()))
{
jComboBox1.setSelectedIndex(i);
found = true;
break;
}
else if (className.equals(val))
{
found = true;
jComboBox1.setSelectedIndex(i);
break;
}
}
if (!found)
{
jComboBox1.setSelectedItem(className);
}
}
this.jRTextExpressionAreaDefaultExpression.setText( text );
}