@Override public void setUsingCache(Boolean isUsingCache) { Object old = this.isUsingCache; this.isUsingCache = isUsingCache; getEventSupport().firePropertyChange(JRBaseImage.PROPERTY_USING_CACHE, old, this.isUsingCache); }
@Override public void setLazy(boolean isLazy) { boolean old = this.isLazy; this.isLazy = isLazy; getEventSupport().firePropertyChange(JRBaseImage.PROPERTY_LAZY, old, this.isLazy); }
@Override public void setOnErrorType(OnErrorTypeEnum onErrorTypeValue) { OnErrorTypeEnum old = this.onErrorTypeValue; this.onErrorTypeValue = onErrorTypeValue; getEventSupport().firePropertyChange(JRBaseImage.PROPERTY_ON_ERROR_TYPE, old, this.onErrorTypeValue); }
/** * @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)); ASPropertyWidget w = createWidget4Property(parent, JRDesignImage.PROPERTY_EXPRESSION); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 1; w.getControl().setLayoutData(gd); IPropertyDescriptor pd = getPropertyDesriptor(JRDesignImage.PROPERTY_EVALUATION_TIME); IPropertyDescriptor gpd = getPropertyDesriptor(JRDesignImage.PROPERTY_EVALUATION_GROUP); getWidgetFactory().createCLabel(parent, pd.getDisplayName()); widgets.put(pd.getId(), new SPEvaluationTime(parent, this, pd, gpd)); gd = new GridData(); gd.horizontalSpan = 2; createWidget4Property(parent, JRBaseImage.PROPERTY_LAZY, false).getControl().setLayoutData(gd); createWidget4Property(parent, JRBaseImage.PROPERTY_USING_CACHE); createWidget4Property(parent, JRBaseStyle.PROPERTY_FILL); createWidget4Property(parent, JRBaseStyle.PROPERTY_SCALE_IMAGE); createWidget4Property(parent, JRBaseImage.PROPERTY_ON_ERROR_TYPE); }
protected void initializeProvidedProperties() { super.initializeProvidedProperties(); addProvidedProperties(JRDesignImage.PROPERTY_EXPRESSION, Messages.common_expression); addProvidedProperties(JRDesignImage.PROPERTY_EVALUATION_TIME, Messages.MImage_evaluation_type); addProvidedProperties(JRBaseImage.PROPERTY_LAZY, Messages.MImage_lazy); addProvidedProperties(JRBaseImage.PROPERTY_USING_CACHE, Messages.common_using_cache); addProvidedProperties(JRBaseStyle.PROPERTY_FILL, Messages.common_fill); addProvidedProperties(JRBaseStyle.PROPERTY_SCALE_IMAGE, Messages.MImage_scale_image); addProvidedProperties(JRBaseImage.PROPERTY_ON_ERROR_TYPE, Messages.MImage_on_error_type); }
@Override public Object getPropertyValue(Object id) { JRDesignImage jrElement = (JRDesignImage) getValue(); if (id.equals(JRBaseStyle.PROPERTY_FILL)) return fillD.getEnumValue(jrElement.getOwnFillValue()); if (id.equals(JRBaseStyle.PROPERTY_SCALE_IMAGE)) return scaleImageD.getEnumValue(jrElement.getOwnScaleImageValue()); if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT)) return hAlignD.getEnumValue(jrElement.getOwnHorizontalAlignmentValue()); if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT)) return vAlignD.getEnumValue(jrElement.getOwnVerticalAlignmentValue()); if (id.equals(JRBaseImage.PROPERTY_ON_ERROR_TYPE)) return onErrorTypeD.getEnumValue(jrElement.getOnErrorTypeValue()); if (id.equals(JRDesignImage.PROPERTY_EVALUATION_TIME)) return evaluationTimeD.getEnumValue(jrElement.getEvaluationTimeValue()); if (id.equals(JRDesignImage.PROPERTY_EXPRESSION)) return ExprUtil.getExpression(jrElement.getExpression()); if (id.equals(JRDesignImage.PROPERTY_EVALUATION_GROUP)) { if (jrElement.getEvaluationGroup() != null) return jrElement.getEvaluationGroup().getName(); return ""; //$NON-NLS-1$ } if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) { if (propertyDTO == null) { propertyDTO = new ParameterDTO(); propertyDTO.setJasperDesign(getJasperDesign()); propertyDTO.setValue(jrElement.getHyperlinkParameters()); } return propertyDTO; } if (id.equals(JRBaseImage.PROPERTY_USING_CACHE)) return jrElement.getUsingCache(); if (id.equals(JRBaseImage.PROPERTY_LAZY)) return new Boolean(jrElement.isLazy()); // hyperlink -------------------------------------- if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET)) return jrElement.getLinkTarget(); if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE)) return jrElement.getLinkType(); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkAnchorExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkPageExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkReferenceExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkTooltipExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) { return ExprUtil.getExpression(jrElement.getHyperlinkWhenExpression()); } if (id.equals(JRDesignImage.PROPERTY_ANCHOR_NAME_EXPRESSION)){ return ExprUtil.getExpression(jrElement.getAnchorNameExpression()); } if (id.equals(JRDesignImage.PROPERTY_BOOKMARK_LEVEL)){ return jrElement.getBookmarkLevel(); } return super.getPropertyValue(id); }
@Override public Object getPropertyActualValue(Object id) { JRDesignImage jrElement = (JRDesignImage) getValue(); if (id.equals(JRBaseStyle.PROPERTY_FILL)) return fillD.getEnumValue(jrElement.getFillValue()); if (id.equals(JRBaseStyle.PROPERTY_SCALE_IMAGE)) return scaleImageD.getEnumValue(jrElement.getScaleImageValue()); if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT)) return hAlignD.getEnumValue(jrElement.getHorizontalAlignmentValue()); if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT)) return vAlignD.getEnumValue(jrElement.getVerticalAlignmentValue()); if (id.equals(JRBaseImage.PROPERTY_ON_ERROR_TYPE)) return onErrorTypeD.getEnumValue(jrElement.getOnErrorTypeValue()); if (id.equals(JRDesignImage.PROPERTY_EVALUATION_TIME)) return evaluationTimeD.getEnumValue(jrElement.getEvaluationTimeValue()); if (id.equals(JRDesignImage.PROPERTY_EXPRESSION)) return ExprUtil.getExpression(jrElement.getExpression()); if (id.equals(JRDesignImage.PROPERTY_EVALUATION_GROUP)) { if (jrElement.getEvaluationGroup() != null) return jrElement.getEvaluationGroup().getName(); return ""; //$NON-NLS-1$ } if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) { if (propertyDTO == null) { propertyDTO = new ParameterDTO(); propertyDTO.setJasperDesign(getJasperDesign()); propertyDTO.setValue(jrElement.getHyperlinkParameters()); } return propertyDTO; } if (id.equals(JRBaseImage.PROPERTY_USING_CACHE)) return jrElement.getUsingCache(); if (id.equals(JRBaseImage.PROPERTY_LAZY)) return new Boolean(jrElement.isLazy()); // hyperlink -------------------------------------- if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET)) return jrElement.getLinkTarget(); if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE)) return jrElement.getLinkType(); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkAnchorExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkPageExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkReferenceExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkTooltipExpression()); if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) return ExprUtil.getExpression(jrElement.getHyperlinkWhenExpression()); return super.getPropertyActualValue(id); }
@Override public void setPropertyValue(Object id, Object value) { JRDesignImage jrElement = (JRDesignImage) getValue(); if (id.equals(JRBaseStyle.PROPERTY_FILL)) jrElement.setFill((FillEnum) fillD.getEnumValue(value)); else if (id.equals(JRBaseStyle.PROPERTY_SCALE_IMAGE)) jrElement.setScaleImage((ScaleImageEnum) scaleImageD.getEnumValue(value)); else if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT)) jrElement.setHorizontalAlignment((HorizontalAlignEnum) hAlignD.getEnumValue(value)); else if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT)) jrElement.setVerticalAlignment((VerticalAlignEnum) vAlignD.getEnumValue(value)); else if (id.equals(JRBaseImage.PROPERTY_ON_ERROR_TYPE)) jrElement.setOnErrorType((OnErrorTypeEnum) onErrorTypeD.getEnumValue(value)); else if (id.equals(JRDesignImage.PROPERTY_EVALUATION_TIME)) jrElement.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD.getEnumValue(value)); else if (id.equals(JRDesignImage.PROPERTY_EVALUATION_GROUP)) { if (value != null && !value.equals("")) { //$NON-NLS-1$ JRDesignDataset dataset = (JRDesignDataset)getElementDataset(); JRGroup group = (JRGroup) dataset.getGroupsMap().get(value); jrElement.setEvaluationGroup(group); } } else if (id.equals(JRDesignImage.PROPERTY_EXPRESSION)) jrElement.setExpression(ExprUtil.setValues(jrElement.getExpression(), value)); else if (id.equals(JRBaseImage.PROPERTY_USING_CACHE)) jrElement.setUsingCache((Boolean) value); else if (id.equals(JRBaseImage.PROPERTY_LAZY)) jrElement.setLazy(((Boolean) value).booleanValue()); else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET)) jrElement.setLinkTarget((String) value); else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE)) jrElement.setLinkType((String) value); else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION)) jrElement.setHyperlinkAnchorExpression(ExprUtil.setValues(jrElement.getHyperlinkAnchorExpression(), value)); else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION)) jrElement.setHyperlinkPageExpression(ExprUtil.setValues(jrElement.getHyperlinkPageExpression(), value)); else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION)) jrElement.setHyperlinkReferenceExpression(ExprUtil.setValues(jrElement.getHyperlinkReferenceExpression(), value)); else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION)) jrElement.setHyperlinkTooltipExpression(ExprUtil.setValues(jrElement.getHyperlinkTooltipExpression(), value)); else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) { jrElement.setHyperlinkWhenExpression(ExprUtil.setValues(jrElement.getHyperlinkWhenExpression(), value)); } else if (id.equals(JRDesignImage.PROPERTY_ANCHOR_NAME_EXPRESSION)) jrElement.setAnchorNameExpression(ExprUtil.setValues(jrElement.getAnchorNameExpression(), value)); else if (id.equals(JRDesignImage.PROPERTY_BOOKMARK_LEVEL)) jrElement.setBookmarkLevel(value != null ? Integer.parseInt(value.toString()) : 0); else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) { if (value instanceof ParameterDTO) { ParameterDTO v = (ParameterDTO) value; JRHyperlinkParameter[] hyperlinkParameters = jrElement.getHyperlinkParameters(); if (hyperlinkParameters != null) for (JRHyperlinkParameter prm : hyperlinkParameters) jrElement.removeHyperlinkParameter(prm); for (JRHyperlinkParameter param : v.getValue()) jrElement.addHyperlinkParameter(param); propertyDTO = v; } } super.setPropertyValue(id, value); }
@Override public String getName() { return JRBaseImage.PROPERTY_ON_ERROR_TYPE; }
@Override public String getName() { return JRBaseImage.PROPERTY_USING_CACHE; }
@Override public String getName() { return JRBaseImage.PROPERTY_LAZY; }