本文整理匯總了Java中net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue類的典型用法代碼示例。如果您正苦於以下問題:Java JRDesignSubreportReturnValue類的具體用法?Java JRDesignSubreportReturnValue怎麽用?Java JRDesignSubreportReturnValue使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JRDesignSubreportReturnValue類屬於net.sf.jasperreports.engine.design包,在下文中一共展示了JRDesignSubreportReturnValue類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validate
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
public boolean validate() {
// validate toVariable is unique
List<String> lto = new ArrayList<String>();
List<JRDesignSubreportReturnValue> input = (List<JRDesignSubreportReturnValue>) tableViewer.getInput();
for (JRDesignSubreportReturnValue d : input)
lto.add(d.getToVariable());
int size = lto.size();
int setSize = new HashSet<String>(lto).size();
if (size != setSize) {
setErrorMessage(Messages.RVPropertyPage_error_message_return_variables_contain_duplicate_tovariable_values);
setPageComplete(false);
return false;
} else {
setErrorMessage(null);
setPageComplete(true);
}
return true;
}
示例2: setReturnValues
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
/**
* This method will duplicate the map. The panel will work on a copy of the map.
**/
@SuppressWarnings("unchecked")
public void setReturnValues(List oldReturnVariables) {
this.returnValues.clear();
DefaultTableModel model = (DefaultTableModel)jTable.getModel();
// Create a copy of the map content...
Iterator iterator = oldReturnVariables.iterator();
while (iterator.hasNext())
{
JRDesignSubreportReturnValue oldReturnValue = (JRDesignSubreportReturnValue)iterator.next();
JRDesignSubreportReturnValue returnValue = new JRDesignSubreportReturnValue();
returnValue.setSubreportVariable(oldReturnValue.getSubreportVariable() );
returnValue.setCalculation(oldReturnValue.getCalculationValue() );
returnValue.setIncrementerFactoryClassName(oldReturnValue.getIncrementerFactoryClassName() );
returnValue.setToVariable(oldReturnValue.getToVariable() );
returnValues.add(returnValue);
model.addRow(new Object[]{returnValue, returnValue.getToVariable() });
}
}
示例3: setSubreportReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
/**
* Setter for property tmpParameter.
*
* @param tmpVariable New value of property tmpParameter.
*/
public void setSubreportReturnValue(JRDesignSubreportReturnValue tmpSubreportReturnValue)
{
this.jComboBoxSubreportVariable.setSelectedItem(new String(tmpSubreportReturnValue.getSubreportVariable() ));
for (int i=0; i<jComboBoxVariable.getItemCount(); ++i)
{
Object var = jComboBoxVariable.getItemAt(i);
if ((var+"").equals( tmpSubreportReturnValue.getToVariable() ))
{
jComboBoxVariable.setSelectedIndex(i);
break;
}
}
Misc.setComboboxSelectedTagValue( jComboBoxCalculationType, tmpSubreportReturnValue.getCalculationValue() );
this.jTextFieldNameIncrementerFactoryClass.setText(tmpSubreportReturnValue.getIncrementerFactoryClassName());
}
示例4: createObject
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
/**
* Creates an object from a subreport copied value XML element.
*
* @param atts the element attributes
* @return a {@link JRDesignSubreportReturnValue JRDesignSubreportReturnValue} object
*/
@Override
public Object createObject(Attributes atts)
{
JRXmlLoader xmlLoader = (JRXmlLoader) digester.peek(digester.getCount() - 1);
JasperDesign design = (JasperDesign) digester.peek(digester.getCount() - 2);
JRDesignSubreportReturnValue returnValue = new JRDesignSubreportReturnValue();
String variableName = atts.getValue(JRXmlConstants.ATTRIBUTE_toVariable);
JRVariable variable = design.getVariablesMap().get(variableName);
if (variable == null)
{
xmlLoader.addError(new JRValidationException("Unknown variable " + variableName, returnValue));
}
returnValue.setSubreportVariable(atts.getValue(JRXmlConstants.ATTRIBUTE_subreportVariable));
returnValue.setToVariable(variableName);
CalculationEnum calculation = CalculationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_calculation));
if (calculation != null)
{
returnValue.setCalculation(calculation);
}
String incrementerFactoryClass = atts.getValue(JRXmlConstants.ATTRIBUTE_incrementerFactoryClass);
if (incrementerFactoryClass != null)
{
returnValue.setIncrementerFactoryClassName(incrementerFactoryClass);
}
return returnValue;
}
示例5: createHelperReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
@Override
protected CommonReturnValue createHelperReturnValue(CommonReturnValue returnValue, String nameSuffix, CalculationEnum calculation)
{
JRDesignSubreportReturnValue helper = new JRDesignSubreportReturnValue();
helper.setToVariable(returnValue.getToVariable() + nameSuffix);
helper.setSubreportVariable(((VariableReturnValue)returnValue).getFromVariable());
helper.setCalculation(calculation);
helper.setIncrementerFactoryClassName(helper.getIncrementerFactoryClassName());//FIXMERETURN shouldn't it be returnValue?
return helper;
}
示例6: createDistinctCountHelperReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
@Override
protected CommonReturnValue createDistinctCountHelperReturnValue(CommonReturnValue returnValue)
{
JRDesignSubreportReturnValue helper = new JRDesignSubreportReturnValue();
helper.setToVariable(returnValue.getToVariable() + "_DISTINCT_COUNT");
helper.setSubreportVariable(((VariableReturnValue)returnValue).getFromVariable());
helper.setCalculation(CalculationEnum.NOTHING);
helper.setIncrementerFactoryClassName(JRDistinctCountIncrementerFactory.class.getName());
return helper;
}
示例7: getColumnText
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
public String getColumnText(Object element, int columnIndex) {
JRDesignSubreportReturnValue val = (JRDesignSubreportReturnValue) element;
switch (columnIndex) {
case 0:
return val.getSubreportVariable();
case 1:
return val.getToVariable();
case 2:
return val.getCalculationValue().getName();
case 3:
return Misc.nvl(val.getIncrementerFactoryClassName());
}
return ""; //$NON-NLS-1$
}
示例8: jButtonAddActionPerformed
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void jButtonAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddActionPerformed
// Check if there is at least a local not system defined variable...
List localVariables = IReportManager.getInstance().getActiveReport().getVariablesList();
int count = 0;
for (int i=0; count == 0 && i<localVariables.size(); ++i)
{
JRDesignVariable var = (JRDesignVariable)localVariables.get(i);
if (!var.isSystemDefined()) count++;
}
if (count == 0)
{
javax.swing.JOptionPane.showMessageDialog(this,
I18n.getString("SubreportReturnValuesPanel.Message.Warning"),
I18n.getString("SubreportReturnValuesPanel.Message.Error"),
javax.swing.JOptionPane.WARNING_MESSAGE);
return;
}
Object pWin = SwingUtilities.getWindowAncestor(this);
JRSubreportReturnValueDialog jrpd = null;
if (pWin instanceof Dialog) jrpd = new JRSubreportReturnValueDialog((Dialog)pWin);
else jrpd = new JRSubreportReturnValueDialog((Frame)pWin);
jrpd.updateVariables();
jrpd.setVisible(true);
if (jrpd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
JRDesignSubreportReturnValue returnValue = jrpd.getSubreportReturnValue();
returnValues.add(returnValue);
DefaultTableModel model = (DefaultTableModel)jTable.getModel();
model.addRow(new Object[]{returnValue, returnValue.getToVariable() });
}
}
示例9: jButtonModifyActionPerformed
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed
DefaultTableModel model = (DefaultTableModel)jTable.getModel();
int row = jTable.getSelectedRow();
if (row < 0) return;
row = ((JXTable)jTable).convertRowIndexToModel(row);
JRDesignSubreportReturnValue oldReturnValue = (JRDesignSubreportReturnValue)model.getValueAt(row,0);
Window pWin = SwingUtilities.windowForComponent(this);
JRSubreportReturnValueDialog jrpd = null;
if (pWin instanceof Dialog) jrpd = new JRSubreportReturnValueDialog((Dialog)pWin);
else if (pWin instanceof Frame) jrpd = new JRSubreportReturnValueDialog((Frame)pWin);
else jrpd = new JRSubreportReturnValueDialog((Dialog)null);
//JRSubreportReturnValueDialog jrpd = new JRSubreportReturnValueDialog(SwingUtilities.getWindowAncestor(this));
jrpd.setSubreportReturnValue(oldReturnValue);
jrpd.setVisible(true);
if (jrpd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
JRDesignSubreportReturnValue newReturnValue = jrpd.getSubreportReturnValue();
returnValues.set(row, newReturnValue);
model.setValueAt(newReturnValue, row, 0);
model.setValueAt(newReturnValue.getToVariable() , row, 1);
jTable.updateUI();
}
}
示例10: getTableCellRendererComponent
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value instanceof JRDesignSubreportReturnValue)
{
label.setText( ((JRDesignSubreportReturnValue)value).getSubreportVariable() );
}
return label;
}
示例11: jButtonOKActionPerformed
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonOKActionPerformed
{
if ((this.jComboBoxSubreportVariable.getSelectedItem()+"").trim().length() <= 0)
{
javax.swing.JOptionPane.showMessageDialog(this,
I18n.getString("JRSubreportReturnValueDialog.Message.Warning"),
I18n.getString("JRSubreportReturnValueDialog.Message.Error"),
javax.swing.JOptionPane.WARNING_MESSAGE);
return;
}
subreportReturnValue = new JRDesignSubreportReturnValue();
subreportReturnValue.setSubreportVariable( this.jComboBoxSubreportVariable.getSelectedItem()+"" );
if (this.jComboBoxVariable.getSelectedItem() == null)
{
javax.swing.JOptionPane.showMessageDialog(this,
I18n.getString("JRSubreportReturnValueDialog.Message.Warning2"),
I18n.getString("JRSubreportReturnValueDialog.Message.Error2"),
javax.swing.JOptionPane.WARNING_MESSAGE);
return;
}
subreportReturnValue.setToVariable( jComboBoxVariable.getSelectedItem()+"");
Object t = this.jComboBoxCalculationType.getSelectedItem();
if (t != null && t instanceof Tag) subreportReturnValue.setCalculation( (CalculationEnum)((Tag)t).getValue() );
if (this.jTextFieldNameIncrementerFactoryClass.getText().length() == 0)
{
subreportReturnValue.setIncrementerFactoryClassName(null);
}
else
{
subreportReturnValue.setIncrementerFactoryClassName( this.jTextFieldNameIncrementerFactoryClass.getText());
}
setVisible(false);
this.setDialogResult(javax.swing.JOptionPane.OK_OPTION);
dispose();
}
示例12: getSubreportReturnValue
import net.sf.jasperreports.engine.design.JRDesignSubreportReturnValue; //導入依賴的package包/類
/**
* Getter for property tmpParameter.
*
* @return Value of property tmpParameter.
*/
public JRDesignSubreportReturnValue getSubreportReturnValue()
{
return subreportReturnValue;
}