Commit 522cb19f authored by Christoph Döbber's avatar Christoph Döbber
Browse files

fixed OPLabels

refs 903
parent fbcad26e
...@@ -18,6 +18,8 @@ $Id$ ...@@ -18,6 +18,8 @@ $Id$
package org.fortiss.af3.operatorpanel.ui.simulator.views; package org.fortiss.af3.operatorpanel.ui.simulator.views;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.fortiss.af3.operatorpanel.model.OPLabel; import org.fortiss.af3.operatorpanel.model.OPLabel;
...@@ -29,9 +31,9 @@ import org.fortiss.af3.operatorpanel.model.OPLabel; ...@@ -29,9 +31,9 @@ import org.fortiss.af3.operatorpanel.model.OPLabel;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating GREEN Hash: 1E398D4044F7DF9B5697E7EA45DFD299 * @ConQAT.Rating YELLOW Hash: 67D2B3CD583B6847452ABBC98007B202
*/ */
/* package */class OPVCLabel extends OPViewControlBase<OPLabel, Label> { /* package */class OPVCLabel extends OPViewControlBase<OPLabel, Composite> {
/** Constructor. */ /** Constructor. */
public OPVCLabel(OPLabel item, Composite parent) { public OPVCLabel(OPLabel item, Composite parent) {
...@@ -40,9 +42,13 @@ import org.fortiss.af3.operatorpanel.model.OPLabel; ...@@ -40,9 +42,13 @@ import org.fortiss.af3.operatorpanel.model.OPLabel;
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected Label createControl(Composite parent) { protected Composite createControl(Composite parent) {
Label label = new Label(parent, SWT.NONE); Composite container = new Composite(parent, SWT.NO_BACKGROUND);
container.setLayout(new GridLayout(1, false));
Label label = new Label(container, SWT.NONE);
label.setText(modelItem.getComment()); label.setText(modelItem.getComment());
return label; label.setAlignment(SWT.CENTER);
label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true, 1, 1));
return container;
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment