• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JRDesignSortField类的典型用法和代码示例

java 2次浏览

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

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

示例1: createObject

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JRDesignSortField sortField = new JRDesignSortField();
	
	sortField.setName(atts.getValue(JRXmlConstants.ATTRIBUTE_name));

	SortOrderEnum order = SortOrderEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_order));
	if (order != null)
	{
		sortField.setOrder(order);
	}

	SortFieldTypeEnum type = SortFieldTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_type));
	if (type != null)
	{
		sortField.setType(type);
	}

	return sortField;
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:22,
代码来源:JRSortFieldFactory.java

示例2: getPropertyValue

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public Object getPropertyValue(Object id) {
	JRDesignSortField jrField = (JRDesignSortField) getValue();
	if (id.equals(JRDesignSortField.PROPERTY_NAME))
		return jrField.getName();
	if (id.equals(JRDesignSortField.PROPERTY_ORDER)) {
		if (orderD == null)
			getPropertyDescriptors();
		return orderD.getEnumValue(jrField.getOrderValue());
	}
	if (id.equals(JRDesignSortField.PROPERTY_TYPE)) {
		if (typeD == null)
			getPropertyDescriptors();
		return typeD.getEnumValue(jrField.getType());
	}
	return null;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:17,
代码来源:MSortField.java

示例3: setPropertyValue

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public void setPropertyValue(Object id, Object value) {
	JRDesignSortField jrField = (JRDesignSortField) getValue();
	if (id.equals(JRDesignSortField.PROPERTY_NAME)) {
		if (!value.equals("")) { //$NON-NLS-1$
			String oldName = jrField.getName();
			String oldType = jrField.getType().getName();
			String newName = (String) value;
			//The type is the same
			changeNameAndType(oldName, oldType, newName,  jrField.getType(), jrField);
		}
	} else if (id.equals(JRDesignSortField.PROPERTY_ORDER))
		jrField.setOrder((SortOrderEnum) orderD.getEnumValue(value));
	else if (id.equals(JRDesignSortField.PROPERTY_TYPE)) {
		SortFieldTypeEnum type = (SortFieldTypeEnum) typeD.getEnumValue(value);
		selectFirstAvailableName(type);
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:18,
代码来源:MSortField.java

示例4: addSortOrder

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * Add a sort order field to jasperDesign
 * 
 * @param jasperDesign
 * @param sortField
 * @param sortOrder
 */
private static void addSortOrder(JasperDesign jasperDesign, SortFieldTO sortField) {
	if (sortField != null) {
		// not a pseudo field
		// the name of the field from XML to sort by
		String sortFieldName = sortField.getName();
		if (ReportBeansToXML.hasExtraSortField(sortField.getFieldID())) {
			sortFieldName = sortFieldName + TReportLayoutBean.PSEUDO_COLUMN_NAMES.ORDER;
		}
		SortOrderEnum sortOrderEnum = null;
		if (sortField.isDescending()) {
			sortOrderEnum = SortOrderEnum.DESCENDING;
		} else {
			sortOrderEnum = SortOrderEnum.ASCENDING;
		}
		try {
			jasperDesign.addSortField(new JRDesignSortField(sortFieldName, SortFieldTypeEnum.FIELD, sortOrderEnum));
		} catch (JRException e) {
			LOGGER.warn("Adding the sort field " + sortFieldName + " for sorting failed with " + e.getMessage());
			LOGGER.debug(ExceptionUtils.getStackTrace(e));
		}
	}
}
 

开发者ID:trackplus,
项目名称:Genji,
代码行数:30,
代码来源:ReportOverviewJasperDesign.java

示例5: updateDatasetSortFieldList

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * This function replace the list.
 * The replacement is done removing each single SortField and adding all the fields again
 * reading them by the list model.
 */
private void updateDatasetSortFieldList()
{
    
    while (getDataset().getSortFieldsList().size() > 0)
        {
            JRDesignSortField field = (JRDesignSortField)getDataset().getSortFieldsList().get(0);
            getDataset().removeSortField(field);
        }
        
        DefaultListModel dlm = (DefaultListModel)jList1.getModel();
        for (int i=0; i<dlm.getSize(); ++i)
        {
            try {
                getDataset().addSortField( (JRDesignSortField)dlm.get(i) );
            } catch (Exception ex) {}
        }
    
}
 

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

示例6: jButtonAscDescActionPerformed

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
private void jButtonAscDescActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAscDescActionPerformed

        // get selected sortfield...
        int[] items = jList1.getSelectedIndices();
        for (int i=0; i<items.length; ++i)
        {
            JRDesignSortField field = (JRDesignSortField)jList1.getModel().getElementAt(items[i]);
            if (field.getOrderValue() == SortOrderEnum.ASCENDING)
            {
                field.setOrder( SortOrderEnum.DESCENDING);
            }
            else
            {
                field.setOrder( SortOrderEnum.ASCENDING);
            }
        }
        updateDatasetSortFieldList();
        jList1.updateUI();
        
    }
 

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

示例7: jButtonModifyActionPerformed

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed

        // get selected sortfield...
        if (jList1.getSelectedIndex() >= 0)
        {
            JRDesignSortField field = (JRDesignSortField)jList1.getSelectedValue();
            SortFieldDialog sfd = new SortFieldDialog(this, true);
            sfd.setDataset( getDataset() );
            sfd.setSortField( field );
            
            sfd.setVisible(true);
            
            if (sfd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION)
            {
                field.setName( sfd.getSortField().getName() );
                field.setOrder( sfd.getSortField().getOrderValue() );
                jList1.updateUI();
            }
            updateDatasetSortFieldList();
        }
    }
 

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

示例8: jButtonAddActionPerformed

点赞 3

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
private void jButtonAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddActionPerformed

        SortFieldDialog jrpd = new SortFieldDialog(this, true);
        jrpd.setDataset( getDataset() );
        jrpd.setVisible(true);

        if (jrpd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION)
        {

            JRDesignSortField field = jrpd.getSortField();
            ((DefaultListModel)jList1.getModel()).addElement(field);
            try {
                getDataset().addSortField( field );
            } catch (Exception ex) { }
        }
        

    }
 

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

示例9: overwriteExistingSortField

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
private void overwriteExistingSortField(List<JRSortField> sortFields, JRSortField newSortField) {
	int indexOfExistingSortField = sortFields.indexOf(newSortField);
	if (indexOfExistingSortField != -1) {
		// remove sortfield if previos order was 'Descending'
		boolean mustRemove = (sortFields.get(indexOfExistingSortField)).getOrderValue().equals(SortOrderEnum.DESCENDING);
		if (mustRemove) {
			sortFields.remove(indexOfExistingSortField);
		} else {
			((JRDesignSortField)sortFields.get(indexOfExistingSortField)).setOrder(newSortField.getOrderValue());
		}
		
	} else if (newSortField.getOrderValue() != null) { // this is necessary because a dummy order - None - is introduced
		sortFields.add(newSortField);
	}
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:16,
代码来源:SortParameterContributor.java

示例10: getColumnText

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
	JRDesignSortField field = (JRDesignSortField) element;
	switch (columnIndex) {
	case 0:
		return field.getName();
	case 1:
		return field.getType().getName();
	case 2:
		if (field.getOrderValue() != null)
			return field.getOrderValue().getName();
	}
	return ""; //$NON-NLS-1$
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:14,
代码来源:SortFieldsTable.java

示例11: getColumnImage

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public Image getColumnImage(Object element, int columnIndex) {
	JRDesignSortField field = (JRDesignSortField) element;
	switch (columnIndex) {
	case 0:
		if (field.getType().equals(SortFieldTypeEnum.FIELD))
			return JaspersoftStudioPlugin.getInstance().getImage(MField.getIconDescriptor().getIcon16());
		else
			return JaspersoftStudioPlugin.getInstance().getImage(MVariable.getIconDescriptor().getIcon16());
	}
	return null; //$NON-NLS-1$
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:12,
代码来源:SortFieldsTable.java

示例12: createControls

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
	super.createControls(parent, tabbedPropertySheetPage);

	parent.setLayout(new GridLayout(2, false));

	ASPropertyWidget nameWidget = createWidget4Property(parent, JRDesignSortField.PROPERTY_NAME);
	nameWidget.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	
	createWidget4Property(parent, JRDesignSortField.PROPERTY_TYPE);
	createWidget4Property(parent, JRDesignSortField.PROPERTY_ORDER);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:12,
代码来源:SortFieldSection.java

示例13: initializeProvidedProperties

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
protected void initializeProvidedProperties() {
	super.initializeProvidedProperties();
	addProvidedProperties(JRDesignSortField.PROPERTY_NAME, Messages.common_name);
	addProvidedProperties(JRDesignSortField.PROPERTY_TYPE, Messages.MSortField_typeTitle);
	addProvidedProperties(JRDesignSortField.PROPERTY_ORDER, Messages.common_order);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:8,
代码来源:SortFieldSection.java

示例14: getChangePropertyCommand

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
protected Command getChangePropertyCommand(Object property, Object newValue, APropertyNode n) {
	if (property.equals(JRDesignSortField.PROPERTY_TYPE)){
		//reopen the wizard to select an unique name
		return new ChangeSortFieldTypeCommand((MSortFields)n.getParent(), (MSortField)n);
	} else if (property.equals(JRDesignSortField.PROPERTY_NAME)){
		return new ChangeSortFieldNameCommand((MSortFields)n.getParent(), (MSortField)n, (String)newValue);
	} else {
		return super.getChangePropertyCommand(property, newValue, n);
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:11,
代码来源:SortFieldSection.java

示例15: postSetValue

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * Get a list of all the Sortfield that are using a variable, and if one of them is using
 * the renamed variable then its name also is updated with the new one
 */
@Override
public Command postSetValue(IPropertySource target, Object prop, Object newValue, Object oldValue) {
	JSSCompoundCommand c = new JSSCompoundCommand(null);
	if (target instanceof MVariable && prop.equals(JRDesignVariable.PROPERTY_NAME)) {
		MVariable targetNode = (MVariable) target;
		c.setReferenceNodeIfNull(targetNode);
		JRDesignDataset d = ModelUtils.getDataset(targetNode);
		if (d != null){
			for(INode field : ModelUtils.getSortFields(targetNode)){
				APropertyNode sortField = (APropertyNode)field;
				JRDesignSortField jrField = (JRDesignSortField) sortField.getValue();
				if (jrField != null){
					Object fieldName = jrField.getName();
					Object fieldType = jrField.getType();
					if (SortFieldTypeEnum.VARIABLE.equals(fieldType) && fieldName != null && fieldName.equals(oldValue)){
						SetValueCommand updateSFCommand = new SetValueCommand();
						updateSFCommand.setTarget(sortField);
						updateSFCommand.setPropertyId(JRDesignSortField.PROPERTY_NAME);
						updateSFCommand.setPropertyValue(newValue);
						c.add(updateSFCommand);
					}
				}
			}
		}
	}
	return c;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:32,
代码来源:PostSetVariableName.java

示例16: getImagePath

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public ImageDescriptor getImagePath() {
	if (getValue() != null) {
		JRDesignSortField sortField = (JRDesignSortField) getValue();
		if (sortField.getType().equals(SortFieldTypeEnum.FIELD))
			return MField.getIconDescriptor().getIcon16();
		if (sortField.getType().equals(SortFieldTypeEnum.VARIABLE))
			return MVariable.getIconDescriptor().getIcon16();
	}
	return getIconDescriptor().getIcon16();
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:11,
代码来源:MSortField.java

示例17: createPropertyDescriptors

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *          the desc
 */
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {
	nameD = new RComboBoxPropertyDescriptor(JRDesignSortField.PROPERTY_NAME, Messages.common_name, new String[] { "" }); //$NON-NLS-1$
	nameD.setDescription(Messages.MSortField_name_description);
	desc.add(nameD);

	typeD = new JSSEnumPropertyDescriptor(JRDesignSortField.PROPERTY_TYPE, Messages.MSortField_typeTitle,
			SortFieldTypeEnum.class, NullEnum.NOTNULL) {
		public ASPropertyWidget createWidget(Composite parent, AbstractSection section) {
			Image[] images = new Image[] {
					JaspersoftStudioPlugin.getInstance().getImage("icons/resources/fields-sort-16.png"), //$NON-NLS-1$
					JaspersoftStudioPlugin.getInstance().getImage("icons/resources/variables-sort-16.png") }; //$NON-NLS-1$
			return new SPToolBarEnum(parent, section, this, images, false);
		}
	};
	typeD.setDescription("Sort field type"); //$NON-NLS-1$
	desc.add(typeD);

	orderD = new JSSEnumPropertyDescriptor(JRDesignSortField.PROPERTY_ORDER, Messages.common_order,
			SortOrderEnum.class, NullEnum.NOTNULL) {
		public ASPropertyWidget createWidget(Composite parent, AbstractSection section) {
			Image[] images = new Image[] {
					JaspersoftStudioPlugin.getInstance().getImage("icons/resources/sort-number-column.png"), //$NON-NLS-1$
					JaspersoftStudioPlugin.getInstance().getImage("icons/resources/sort-number-descending.png") }; //$NON-NLS-1$
			return new SPToolBarEnum(parent, section, this, images, false);
		}
	};
	orderD.setDescription(Messages.MSortField_order_description);
	desc.add(orderD);

	defaultsMap.put(JRDesignSortField.PROPERTY_ORDER, typeD.getEnumValue(SortOrderEnum.ASCENDING));
	defaultsMap.put(JRDesignSortField.PROPERTY_TYPE, orderD.getEnumValue(SortFieldTypeEnum.FIELD));

	setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#sortField"); //$NON-NLS-1$
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:42,
代码来源:MSortField.java

示例18: changeNameAndType

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * Change the name and the type of the sortfields updating also its entry
 * in the dataset map
 * 
 * @param oldName the old name
 * @param oldType the old type
 * @param newName the new name
 * @param newType the new type
 * @param field the field
 */
private void changeNameAndType(String oldName, String oldType, String newName, SortFieldTypeEnum newType, JRSortField field){
	JRDesignDataset d = ModelUtils.getDataset(this);
	if (d != null) {
		String oldKey = getSortFieldKey(oldName, oldType);
		d.getSortFieldsMap().remove(oldKey);
		d.getSortFieldsMap().put(getSortFieldKey(newName, newType.getName()), field);
		JRDesignSortField jrField = (JRDesignSortField) field;
		jrField.setName(newName);
		jrField.setType(newType);
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:22,
代码来源:MSortField.java

示例19: execute

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
public void execute() {
	if (jrField != null) {
		oldName = jrField.getName();
		oldType = jrField.getType();
		jrDataSet.getSortFieldsMap().remove(getSortFieldKey(jrField));
		
		SortFieldWizard wizard = new SortFieldWizard();
		JRDesignSortField dummyField = new JRDesignSortField();
		wizard.init(jrDataSet, dummyField);
		if (jrField.getType() == SortFieldTypeEnum.FIELD) {
			dummyField.setType(SortFieldTypeEnum.VARIABLE);
			wizard.setShownElementsType(SHOW_TYPE.VARIABLES);
		} else {
			dummyField.setType(SortFieldTypeEnum.FIELD);
			wizard.setShownElementsType(SHOW_TYPE.FIELDS);
		}
		WizardDialog dialog = new WizardDialog(UIUtils.getShell(), wizard);
		dialog.create();
		if (dialog.open() != Dialog.OK) {
			oldName = null;
			oldType = null;
		} else {
			jrField.setType(dummyField.getType());
			jrField.setName(dummyField.getName());
		}
		jrDataSet.getSortFieldsMap().put(getSortFieldKey(jrField), jrField);
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:30,
代码来源:ChangeSortFieldTypeCommand.java

示例20: WizardSortFieldPage

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public WizardSortFieldPage(JRDesignDataset jrDataset, JRDesignSortField jrSortField) {
	super("sortfieldpage"); //$NON-NLS-1$
	this.jrDataset = jrDataset;
	this.jrSortfield = jrSortField;
	setTitle(Messages.WizardSortFieldPage_Title);
	setDescription(Messages.WizardSortFieldPage_Description);
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:8,
代码来源:WizardSortFieldPage.java

示例21: execute

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
public void execute() {
	if (oldFieldModel.getValue() != null) {
		JRDesignSortField sortField = (JRDesignSortField)oldFieldModel.getValue();
		oldName = sortField.getName();
		//Don't do anything if the name is the same
		if (oldName.equals(newName)) return;
		jrDataSet.getSortFieldsMap().remove(getSortFieldKey(sortField));
		sortField.setName(newName);
		jrDataSet.getSortFieldsMap().put(getSortFieldKey(sortField), sortField);
	}
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:13,
代码来源:ChangeSortFieldNameCommand.java

示例22: undo

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
public void undo() {
	JRDesignSortField sortField = (JRDesignSortField)oldFieldModel.getValue();
	if (oldName.equals(newName)) return;
	jrDataSet.getSortFieldsMap().remove(getSortFieldKey(sortField));
	sortField.setName(oldName);
	jrDataSet.getSortFieldsMap().put(getSortFieldKey(sortField), sortField);
	oldName = null;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:10,
代码来源:ChangeSortFieldNameCommand.java

示例23: postSetValue

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * Get a list of all the Sortfield that are using a field, and if one of them is using
 * the renamed field then its name also is updated with the new one
 */
@Override
public Command postSetValue(IPropertySource target, Object prop, Object newValue, Object oldValue) {
	JSSCompoundCommand c = new JSSCompoundCommand(null);
	if (target instanceof MField && prop.equals(JRDesignField.PROPERTY_NAME)) {
		MField targetNode = (MField) target;
		c.setReferenceNodeIfNull(targetNode);
		JRDesignDataset d = ModelUtils.getDataset(targetNode);
		if (d != null){
			for(INode field : ModelUtils.getSortFields(targetNode)){
				APropertyNode sortField = (APropertyNode)field;
				JRDesignSortField jrField = (JRDesignSortField) sortField.getValue();
				if (jrField != null){
					Object sortFieldName = jrField.getName();
					Object sortFieldType = jrField.getType();
					if (SortFieldTypeEnum.FIELD.equals(sortFieldType) && sortFieldName != null && sortFieldName.equals(oldValue)){
						SetValueCommand updateSFCommand = new SetValueCommand();
						updateSFCommand.setTarget(sortField);
						updateSFCommand.setPropertyId(JRDesignSortField.PROPERTY_NAME);
						updateSFCommand.setPropertyValue(newValue);
						c.add(updateSFCommand);
					}
				}
			}
		}
	}
	return c;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:32,
代码来源:PostSetFieldName.java

示例24: jButtonRemoveActionPerformed

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
private void jButtonRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoveActionPerformed

        if (jList1.getSelectedValues() != null)
        {
            Object[] values = jList1.getSelectedValues();
            for (int i=0; i<values.length; ++i)
            {
                JRDesignSortField field = (JRDesignSortField)values[i];
                ((DefaultListModel)jList1.getModel()).removeElement(field);
                getDataset().removeSortField( field );
            }
        }


    }
 

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

示例25: setDataset

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public void setDataset(JRDesignDataset dataset) {
    this.dataset = dataset;
    List cp = dataset.getSortFieldsList();
    for (int i=0; i<cp.size(); ++i) {
        ((DefaultListModel)jList1.getModel()).addElement( (JRDesignSortField)cp.get(i) );
    }
}
 

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

示例26: jButtonOKActionPerformed

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOKActionPerformed
    
    Object obj = this.jComboBoxSortBy.getSelectedItem();
    
    if (obj == null)
    {
        javax.swing.JOptionPane.showMessageDialog(this,
                //I18n.getString("sortFieldDialog.messageNotValidField",
                I18n.getString("SortFieldDialog.Message.Error"),
                //I18n.getString("sortFieldDialog.messageTitleNotValidField",
                I18n.getString("SortFieldDialog.Message.Error2"),
                javax.swing.JOptionPane.WARNING_MESSAGE );
        return;
    }

    String fieldName = "";
    tmpSortField = new JRDesignSortField();

    if (obj instanceof JRDesignField)
    {
        fieldName = ((JRDesignField)obj).getName();
        tmpSortField.setType(SortFieldTypeEnum.FIELD);
    }
    else if (obj instanceof JRDesignVariable)
    {
        fieldName = ((JRDesignVariable)obj).getName();
        tmpSortField.setType(SortFieldTypeEnum.VARIABLE);
    }
    
    
    tmpSortField.setName(fieldName);
    tmpSortField.setOrder( (jComboBoxSortType.getSelectedIndex() == 1) ? 
                SortOrderEnum.DESCENDING : SortOrderEnum.ASCENDING);

    setVisible(false);
    this.setDialogResult( javax.swing.JOptionPane.OK_OPTION);
    dispose();
}
 

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

示例27: setSortField

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public void setSortField(JRDesignSortField sortField) {
    this.tmpSortField = new JRDesignSortField();
    this.tmpSortField.setName(  sortField.getName() );
    this.tmpSortField.setOrder(  sortField.getOrderValue() );
    this.tmpSortField.setType( sortField.getType() );
    this.tmpSortField.setName( sortField.getName());

    for (int i=0; i<jComboBoxSortBy.getItemCount(); ++i)
    {
        Object item = jComboBoxSortBy.getItemAt(i);

        if (item instanceof JRDesignField &&
            sortField.getType() == SortFieldTypeEnum.FIELD &&
            ((JRDesignField)item).getName().equals(sortField.getName()))
        {
            jComboBoxSortBy.setSelectedIndex(i);
            break;
        }
        else if (item instanceof JRDesignVariable &&
            sortField.getType() == SortFieldTypeEnum.VARIABLE &&
            ((JRDesignVariable)item).getName().equals(sortField.getName()))
        {
            jComboBoxSortBy.setSelectedIndex(i);
            break;
        }
    }

    this.jComboBoxSortType.setSelectedIndex( ((tmpSortField.getOrderValue() == SortOrderEnum.DESCENDING) ? 1 : 0) );
}
 

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

示例28: execute

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
public void execute() throws CommandException 
{
	SortOrderEnum sortOrder = HeaderToolbarElementUtils.getSortOrder(sortData.getSortOrder());//FIXMEJIVE use labels in JR enum, even if they are longer

	JRDesignSortField newSortField = 
		new JRDesignSortField(
			sortData.getSortColumnName(),
			SortFieldTypeEnum.getByName(sortData.getSortColumnType()),
			sortOrder
			);
	
	JRSortField oldSortField = null;
	List<JRSortField> sortFields = dataset.getSortFieldsList();
	if (
		JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(dataset, PROPERTY_CREATE_SORT_FIELDS_FOR_GROUPS, false)
		&& (sortFields == null || sortFields.isEmpty())
		)
	{
		List<JRGroup> groups = dataset.getGroupsList();
		for (JRGroup group : groups)
		{
			JRExpression expression = group.getExpression();
			if (expression != null)
			{
				JRExpressionChunk[] chunks = expression.getChunks();
				if (chunks != null && chunks.length == 1)
				{
					JRExpressionChunk chunk = chunks[0];
					if (
						chunk.getType() == JRExpressionChunk.TYPE_FIELD
						|| chunk.getType() == JRExpressionChunk.TYPE_VARIABLE
						)
					{
						JRDesignSortField groupSortField = 
							new JRDesignSortField(
								chunk.getText(),
								chunk.getType() == JRExpressionChunk.TYPE_FIELD 
									? SortFieldTypeEnum.FIELD
									: SortFieldTypeEnum.VARIABLE,
								SortOrderEnum.ASCENDING
								);
						individualCommandStack.execute(new AddSortFieldCommand(dataset, groupSortField));
					}
				}
			}
		}
	}

	for (JRSortField crtSortField : sortFields)
	{
		if (
			newSortField.getName().equals(crtSortField.getName())
			&& newSortField.getType() == crtSortField.getType()
			)
		{
			oldSortField = crtSortField;
			break;
		}
	}

	if (oldSortField != null)
	{
		individualCommandStack.execute(new RemoveSortFieldCommand(dataset, oldSortField));
	}
	
	if (sortOrder != null)
	{
		individualCommandStack.execute(new AddSortFieldCommand(dataset, newSortField));
	}
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:72,
代码来源:SortCommand.java

示例29: AddSortFieldCommand

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * 
 */
public AddSortFieldCommand(JRDesignDataset dataset, JRDesignSortField sortField) 
{
	this.dataset = dataset;
	this.sortField = sortField;
}
 

开发者ID:TIBCOSoftware,
项目名称:jasperreports,
代码行数:9,
代码来源:AddSortFieldCommand.java

示例30: getFields

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public List<JRDesignSortField> getFields() {
	return (List<JRDesignSortField>) tviewer.getInput();
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:4,
代码来源:SortFieldsTable.java

示例31: getDisplayText

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public String getDisplayText() {
	return ((JRDesignSortField) getValue()).getName();
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:4,
代码来源:MSortField.java

示例32: init

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public void init(JRDesignDataset jd, JRDesignSortField sortField) {
	this.jrDataSet = jd;
	this.jrSortField = sortField;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:5,
代码来源:SortFieldWizard.java

示例33: CreateSortFieldCommand

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
public CreateSortFieldCommand(JRDesignDataset destNode, JRDesignSortField srcNode, int index) {
	super();
	this.jrDataSet = destNode;
	this.index = index;
	this.jrField = srcNode;
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:7,
代码来源:CreateSortFieldCommand.java

示例34: getSortField

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * return a new sortField instance
 */
public JRDesignSortField getSortField() {
    return tmpSortField;
}
 

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

示例35: addSort

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
protected void addSort(JRDesignSortField sort) throws JRException {
	accessor.getDesign().addSortField(sort);
}
 

开发者ID:svn2github,
项目名称:dynamicreports-jasper,
代码行数:5,
代码来源:MainDatasetExpressionTransform.java

示例36: addSort

点赞 2

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
protected void addSort(JRDesignSortField sort) throws JRException {
	jrDataset.addSortField(sort);
}
 

开发者ID:svn2github,
项目名称:dynamicreports-jasper,
代码行数:5,
代码来源:DatasetExpressionTransform.java

示例37: ReorderSortFieldCommand

点赞 1

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
/**
 * Instantiates a new reorder field command.
 * 
 * @param child
 *          the child
 * @param parent
 *          the parent
 * @param newIndex
 *          the new index
 */
public ReorderSortFieldCommand(MSortField child, MSortFields parent, int newIndex) {
	super(Messages.common_reorder_elements);

	this.newIndex = Math.max(0, newIndex);
	this.jrDataset = (JRDesignDataset) parent.getValue();
	this.jrField = (JRDesignSortField) child.getValue();
}
 

开发者ID:OpenSoftwareSolutions,
项目名称:PDFReporter-Studio,
代码行数:18,
代码来源:ReorderSortFieldCommand.java

示例38: getListCellRendererComponent

点赞 1

import net.sf.jasperreports.engine.design.JRDesignSortField; //导入依赖的package包/类
@Override
public java.awt.Component getListCellRendererComponent(javax.swing.JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

    java.awt.Component retValue;
    
    retValue = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    
    if (value instanceof JRDesignSortField && retValue instanceof JLabel)
    {
        JRDesignSortField sf = (JRDesignSortField)value;
        JLabel label = (JLabel)retValue;

        String t = sf.getType() == SortFieldTypeEnum.FIELD ? "Field" : "Variable";

        Color cf = Color.green.darker().darker();
        Color cv = Color.BLUE;
        String c = sf.getType() == SortFieldTypeEnum.FIELD ? getEncodedColor(cf) : getEncodedColor(cv);

        String text = "<html>" + sf.getName() + " " + ((isSelected) ? t : "<font color=\"" + c + "\">" + t + "</font>");


        label.setText( text);
        
        label.setIcon( sf.getOrderValue() == SortOrderEnum.DESCENDING ? descIcon : ascIcon );
    }
    
    return retValue;
}
 

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


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)