blob: c4e07eb545d088412645874e1e0b32fa0da20593 [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.item;
import org.eclipse.birt.report.model.api.CellHandle;
import org.eclipse.birt.report.model.api.ReportItemHandle;
import org.eclipse.birt.report.model.api.SlotHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.osbp.xtext.reportdsl.jvmmodel.ReportGeneratorWorkSet;
public class CellItem extends ContainerItem {
private final CellHandle fItem;
protected CellItem(ReportGeneratorWorkSet workset, CellHandle cell) {
super(workset);
fItem = cell;
}
public CellItem setColumnSpan(int columnspan) {
try {
columnspan = Math.max(1, columnspan);
if (columnspan != fItem.getColumnSpan()) {
fItem.setColumnSpan(columnspan);
}
}
catch (SemanticException e) {
e.printStackTrace();
}
return this;
}
@Override
public ReportItemHandle getHandle() {
return null;
}
@Override
SlotHandle getSlotHandle() {
return fItem.getContent();
}
}