| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.xtext.reportdsl.common.attribute; |
| |
| import org.eclipse.birt.report.model.api.ReportItemHandle; |
| import org.eclipse.birt.report.model.api.activity.SemanticException; |
| |
| public class Width extends ItemDimension { |
| public Width(String value) { |
| super(value); |
| } |
| public Width(double value) { |
| super(value); |
| } |
| |
| @Override |
| public void apply(ReportItemHandle item) { |
| try { |
| if (fValue instanceof String) { |
| item.setWidth((String) fValue); |
| } |
| else if (fValue instanceof Double) { |
| item.setWidth((Double) fValue); |
| } |
| } catch (SemanticException e) { |
| e.printStackTrace(); |
| } |
| } |
| } |