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


Java HtmlComponent类代码示例

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


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

示例1: performRequest

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
public void performRequest(Request req) {
	if (RequestConstants.REQ_OPEN.equals(req.getType())) {
		if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
			JRExpressionEditor wizard = new JRExpressionEditor();
			MHtml m = (MHtml) getModel();
			wizard.setValue((JRDesignExpression) m
					.getPropertyValue(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION));
			ExpressionContext ec=ModelUtils.getElementExpressionContext((JRDesignElement)m.getValue(), m);
			wizard.setExpressionContext(ec);
			WizardDialog dialog = ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(Display.getDefault()
					.getActiveShell(), wizard);
			if (dialog.open() == Dialog.OK) {
				SetValueCommand cmd = new SetValueCommand();
				cmd.setTarget((IPropertySource) getModel());
				cmd.setPropertyId(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION);
				cmd.setPropertyValue(wizard.getValue());
				getViewer().getEditDomain().getCommandStack().execute(cmd);
			}
		}
	} else
		super.performRequest(req);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:HtmlFigureEditPart.java

示例2: getPropertyValue

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
public Object getPropertyValue(Object id) {
	JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue();
	HtmlComponent htmlComp = (HtmlComponent) jrElement.getComponent();

	if (id.equals(HtmlComponent.PROPERTY_EVALUATION_TIME))
		return evaluationTimeD.getEnumValue(htmlComp.getEvaluationTime());
	if (id.equals(HtmlComponent.PROPERTY_EVALUATION_GROUP))
		return htmlComp.getEvaluationGroup();
	if (id.equals(HtmlComponent.PROPERTY_SCALE_TYPE))
		return scaleTypeD.getEnumValue(htmlComp.getScaleType());
	if (id.equals(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN))
		return hAlignD.getEnumValue(htmlComp.getHorizontalAlign());
	if (id.equals(HtmlComponent.PROPERTY_VERTICAL_ALIGN))
		return vAlignD.getEnumValue(htmlComp.getVerticalAlign());
	if (id.equals(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION))
		return ExprUtil.getExpression(htmlComp.getHtmlContentExpression());
	if (id.equals(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW))
		return htmlComp.getClipOnOverflow();

	return super.getPropertyValue(id);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:MHtml.java

示例3: createControls

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
/**
 * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
 *      org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
 */
public void createControls(Composite parent,
		TabbedPropertySheetPage tabbedPropertySheetPage) {
	super.createControls(parent, tabbedPropertySheetPage);

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

	createWidget4Property(parent, HtmlComponent.PROPERTY_SCALE_TYPE);
	createWidget4Property(parent, HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW);
	createWidget4Property(parent, HtmlComponent.PROPERTY_HORIZONTAL_ALIGN);
	createWidget4Property(parent, HtmlComponent.PROPERTY_VERTICAL_ALIGN);

	IPropertyDescriptor pd = getPropertyDesriptor(HtmlComponent.PROPERTY_EVALUATION_TIME);
	IPropertyDescriptor gpd = getPropertyDesriptor(HtmlComponent.PROPERTY_EVALUATION_GROUP);
	getWidgetFactory().createCLabel(parent, pd.getDisplayName());
	widgets.put(pd.getId(), new SPEvaluationTime(parent, this, pd, gpd));

	createWidget4Property(parent,
			HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:HtmlSection.java

示例4: paintWidgetImplementation

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
protected void paintWidgetImplementation() {

    //super.paintWidget();
    Graphics2D gr = getScene().getGraphics();
    
    if (htmlIcon == null && ((JRDesignComponentElement)getElement()).getComponent() instanceof HtmlComponent)
    {
        htmlIcon = new ImageIcon(this.getClass().getResource("/com/jaspersoft/ireport/components/html/html-32.png"));
    }
    
    Composite oldComposite = gr.getComposite();
    gr.fillRect(0, 0, getElement().getWidth(), getElement().getHeight());
    gr.setComposite(oldComposite);
    Shape oldClip = gr.getClip();
    Shape rect = new Rectangle2D.Float(0,0,getElement().getWidth(), getElement().getHeight());
    gr.clip(rect);
    if (htmlIcon != null)
    {
        gr.drawImage(htmlIcon.getImage(), 4, 4, null);
    }
    gr.setClip(oldClip);

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

示例5: dropFieldElementAt

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
public void dropFieldElementAt(Scene theScene, JasperDesign jasperDesign, JRDesignComponentElement element, Point location)
{
    if (theScene instanceof ReportObjectScene)
    {
        Point p = theScene.convertViewToScene( location );

        // find the band...
        JRDesignBand b = ModelUtils.getBandAt(jasperDesign, p);
        int yLocation = ModelUtils.getBandLocation(b, jasperDesign);
        Point pLocationInBand = new Point(p.x - jasperDesign.getLeftMargin(),
                                          p.y - yLocation);
        if (b != null)
        {

            // if the band is not a detail, propose to aggregate the value...
            if (b.getOrigin().getBandTypeValue() == BandTypeEnum.TITLE)
            {
                ((HtmlComponent)(element.getComponent())).setEvaluationTime(EvaluationTimeEnum.REPORT);
            }
        }
   }

    super.dropElementAt(theScene, jasperDesign, element, location);
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:25,代码来源:CreateHtmlAction.java

示例6: createImageFromComponentElement

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
public JRPrintImage createImageFromComponentElement(JRComponentElement componentElement) throws JRException {
	HtmlComponent html = (HtmlComponent) componentElement.getComponent();
	
	String htmlContent = "";
	
	if (html.getHtmlContentExpression() != null) {
		htmlContent = JRExpressionUtil.getExpressionText(html.getHtmlContentExpression());
	}
	
	JRBasePrintImage printImage = new JRBasePrintImage(componentElement.getDefaultStyleProvider());

	printImage.setStyle(componentElement.getStyle());
	printImage.setMode(componentElement.getModeValue());
	printImage.setBackcolor(componentElement.getBackcolor());
	printImage.setForecolor(componentElement.getForecolor());
	printImage.setX(componentElement.getX());
	printImage.setY(componentElement.getY());
	printImage.setWidth(componentElement.getWidth());
	printImage.setHeight(componentElement.getHeight());
	printImage.setScaleImage(html.getScaleType());
	printImage.setHorizontalImageAlign(html.getHorizontalImageAlign());
	printImage.setVerticalImageAlign(html.getVerticalImageAlign());
	
	FlyingSaucerXhtmlToImageRenderer renderer = new FlyingSaucerXhtmlToImageRenderer(getHtmlDocument(htmlContent), componentElement.getWidth(), componentElement.getHeight());
	printImage.setRenderer(renderer);
	return printImage;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:29,代码来源:FlyingSaucerHtmlPrintElement.java

示例7: createImageFromComponentElement

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
public JRPrintImage createImageFromComponentElement(JRComponentElement componentElement) throws JRException {
	HtmlComponent html = (HtmlComponent) componentElement.getComponent();
	
	JEditorPane editorPane = new JEditorPane();
	editorPane.setEditorKitForContentType("text/html", new SynchronousImageLoaderKit());
	editorPane.setContentType("text/html");
	
	String htmlContent = "";
	
	if (html.getHtmlContentExpression() != null) {
		htmlContent = JRExpressionUtil.getExpressionText(html.getHtmlContentExpression());
	}
	
	editorPane.setText(htmlContent);
	editorPane.setBorder(null);
	editorPane.setSize(editorPane.getPreferredSize());
	
	JRBasePrintImage printImage = new JRBasePrintImage(componentElement.getDefaultStyleProvider());
	printImage.setX(componentElement.getX());
	printImage.setY(componentElement.getY());
	printImage.setWidth(componentElement.getWidth());
	printImage.setHeight(componentElement.getHeight());
	printImage.setScaleImage(html.getScaleType());
	printImage.setHorizontalImageAlign(html.getHorizontalImageAlign());
	printImage.setVerticalImageAlign(html.getVerticalImageAlign());
	printImage.setStyle(componentElement.getStyle());
	printImage.setMode(componentElement.getModeValue());
	printImage.setBackcolor(componentElement.getBackcolor());
	printImage.setForecolor(componentElement.getForecolor());

	printImage.setRenderer(new AwtComponentRendererImpl(editorPane));
	
	return printImage;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:36,代码来源:DefaultHtmlPrintElement.java

示例8: createJRElement

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	HtmlComponent component = new HtmlComponent();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setValueClassName("java.lang.String"); //$NON-NLS-1$
	exp.setText("\"<p style='background-color:yellow;'>HTML paragraph</p>\""); //$NON-NLS-1$
	component.setHtmlContentExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey(
			"http://jasperreports.sourceforge.net/htmlcomponent", "hc", "html")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:MHtml.java

示例9: setPropertyValue

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
	JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue();
	HtmlComponent htmlComp = (HtmlComponent) jrElement.getComponent();

	if (id.equals(HtmlComponent.PROPERTY_EVALUATION_TIME))
		htmlComp.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD
				.getEnumValue(value));
	else if (id.equals(HtmlComponent.PROPERTY_EVALUATION_GROUP))
		htmlComp.setEvaluationGroup((String) value);
	else if (id.equals(HtmlComponent.PROPERTY_SCALE_TYPE))
		htmlComp.setScaleType((ScaleImageEnum) scaleTypeD
				.getEnumValue(value));
	else if (id.equals(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN))
		htmlComp.setHorizontalAlign((HorizontalAlignEnum) hAlignD
				.getEnumValue(value));
	else if (id.equals(HtmlComponent.PROPERTY_VERTICAL_ALIGN))
		htmlComp.setVerticalAlign((VerticalAlignEnum) vAlignD
				.getEnumValue(value));
	else if (id.equals(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION))
		htmlComp.setHtmlContentExpression(ExprUtil.setValues(
				htmlComp.getHtmlContentExpression(), value));
	else if (id.equals(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW))
		htmlComp.setClipOnOverflow((Boolean) value);
	else
		super.setPropertyValue(id, value);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:MHtml.java

示例10: initializeProvidedProperties

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@Override
protected void initializeProvidedProperties() {
	super.initializeProvidedProperties();
	addProvidedProperties(HtmlComponent.PROPERTY_SCALE_TYPE, Messages.MHtml_scaletype);
	addProvidedProperties(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW, Messages.MHtml_cliponoverflow);
	addProvidedProperties(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN, Messages.MHtml_horizontalalign);
	addProvidedProperties(HtmlComponent.PROPERTY_VERTICAL_ALIGN, Messages.MHtml_verticalalign);
	addProvidedProperties(HtmlComponent.PROPERTY_EVALUATION_TIME, Messages.MHtml_evaluation_time);
	addProvidedProperties(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION, Messages.MHtml_content_expression);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:HtmlSection.java

示例11: createNode

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
public ANode createNode(ANode parent, Object jrObject, int newIndex) {
	if (jrObject instanceof JRDesignComponentElement) {
		if (((JRDesignComponentElement) jrObject).getComponent() instanceof HtmlComponent) {
			return new MHtml(parent, (JRDesignComponentElement) jrObject,
					newIndex);
		}
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:HtmlComponentFactory.java

示例12: EvaluationTimeProperty

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
public EvaluationTimeProperty(HtmlComponent component, JRDesignDataset dataset)
{
    // TODO: Replace WhenNoDataType with the right constant
    super( HtmlComponent.PROPERTY_EVALUATION_TIME,EvaluationTimeEnum.class, I18n.getString("Global.Property.EvaluationTime"), I18n.getString("Global.Property.EvaluationTimedetail"), true, true);
    this.component = component;
    this.dataset = dataset;
    setValue("suppressCustomEditor", Boolean.TRUE);
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:9,代码来源:EvaluationTimeProperty.java

示例13: ScaleTypeProperty

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public ScaleTypeProperty(HtmlComponent component)
{
    super(ScaleImageEnum.class,  component);
    this.component = component;

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

示例14: EvaluationGroupProperty

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public EvaluationGroupProperty(HtmlComponent component, JRDesignDataset dataset)
{
    // TODO: Replace WhenNoDataType with the right constant
    super( HtmlComponent.PROPERTY_EVALUATION_GROUP,JRGroup.class, "Evaluation group", "Evaluate the expression when the specified group changes", true, true);
    this.component = component;
    this.dataset = dataset;
    setValue("suppressCustomEditor", Boolean.TRUE);
    
    dataset.getEventSupport().addPropertyChangeListener(WeakListeners.propertyChange(this, dataset.getEventSupport()));
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:12,代码来源:EvaluationGroupProperty.java

示例15: createPropertyDescriptors

import net.sf.jasperreports.components.html.HtmlComponent; //导入依赖的package包/类
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *            the desc
 */
public void createPropertyDescriptors(List<IPropertyDescriptor> desc,
		Map<String, Object> defaultsMap) {
	super.createPropertyDescriptors(desc, defaultsMap);

	JRExpressionPropertyDescriptor contentExprD = new JRExpressionPropertyDescriptor(
			HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION,
			Messages.MHtml_content_expression);
	contentExprD
			.setDescription(Messages.MHtml_content_expression_description);
	desc.add(contentExprD);

	scaleTypeD = new JSSEnumPropertyDescriptor(
			HtmlComponent.PROPERTY_SCALE_TYPE, Messages.MHtml_scaletype,
			ScaleImageEnum.class, NullEnum.NOTNULL);
	scaleTypeD.setDescription(Messages.MHtml_scaletype_description);
	desc.add(scaleTypeD);

	CheckBoxPropertyDescriptor clipOverflow = new CheckBoxPropertyDescriptor(
			HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW,
			Messages.MHtml_cliponoverflow, NullEnum.NULL);
	clipOverflow.setDescription(Messages.MHtml_cliponoverflow_desc);
	desc.add(clipOverflow);

	hAlignD = new JSSEnumPropertyDescriptor(
			HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
			Messages.MHtml_horizontalalign, HorizontalAlignEnum.class,
			NullEnum.NOTNULL, 3);
	hAlignD.setDescription(Messages.MHtml_horizontalalign_description);
	desc.add(hAlignD);

	vAlignD = new JSSEnumPropertyDescriptor(
			HtmlComponent.PROPERTY_VERTICAL_ALIGN,
			Messages.MHtml_verticalalign, VerticalAlignEnum.class,
			NullEnum.NOTNULL, 3);
	vAlignD.setDescription(Messages.MHtml_verticalalign_description);
	desc.add(vAlignD);

	evaluationTimeD = new JSSEnumPropertyDescriptor(
			HtmlComponent.PROPERTY_EVALUATION_TIME,
			Messages.MHtml_evaluation_time, EvaluationTimeEnum.class,
			NullEnum.NOTNULL);
	evaluationTimeD
			.setDescription(Messages.MHtml_evaluation_time_description);
	desc.add(evaluationTimeD);

	evaluationGroupNameD = new RComboBoxPropertyDescriptor(
			HtmlComponent.PROPERTY_EVALUATION_GROUP,
			Messages.MHtml_evaluation_group, new String[] { "" }); //$NON-NLS-1$
	evaluationGroupNameD
			.setDescription(Messages.MHtml_evaluation_group_description);
	desc.add(evaluationGroupNameD);

	contentExprD.setCategory(Messages.common_properties_category);
	scaleTypeD.setCategory(Messages.common_properties_category);
	hAlignD.setCategory(Messages.common_properties_category);
	vAlignD.setCategory(Messages.common_properties_category);
	evaluationTimeD.setCategory(Messages.common_properties_category);
	evaluationGroupNameD.setCategory(Messages.common_properties_category);
	clipOverflow.setCategory(Messages.common_properties_category);

	defaultsMap.put(HtmlComponent.PROPERTY_EVALUATION_TIME,
			evaluationTimeD.getEnumValue(EvaluationTimeEnum.NOW));
	defaultsMap.put(HtmlComponent.PROPERTY_SCALE_TYPE,
			scaleTypeD.getEnumValue(ScaleImageEnum.RETAIN_SHAPE));
	defaultsMap.put(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
			hAlignD.getEnumValue(HorizontalAlignEnum.LEFT));
	defaultsMap.put(HtmlComponent.PROPERTY_VERTICAL_ALIGN,
			vAlignD.getEnumValue(VerticalAlignEnum.MIDDLE));
	defaultsMap.put(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW, Boolean.FALSE);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:77,代码来源:MHtml.java


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