blob: 35161b0c77b363849d57f3ce8339747c9a18956d [file] [log] [blame]
/**
*
* 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 Height extends ItemDimension {
public Height(String value) {
super(value);
}
public Height(double value) {
super(value);
}
@Override
public void apply(ReportItemHandle item) {
try {
if (fValue instanceof String) {
item.setHeight((String) fValue);
}
else if (fValue instanceof Double) {
item.setHeight((Double) fValue);
}
} catch (SemanticException e) {
e.printStackTrace();
}
}
}