Commit 9d288869 authored by Johannes Roith's avatar Johannes Roith

Fix link wrapping.

parent d9735492
......@@ -17,6 +17,8 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import de.in.tum.www2.cup.Conflict;
import de.in.tum.www2.cup.ConflictManager;
......@@ -58,20 +60,24 @@ ICupParserLaLrChangeObserver, IRegisterForControllerChanges {
super(parent, style);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
data.grabExcessHorizontalSpace = true;
data.widthHint = 100; // Do not remove. This is a bugfix. :-)
data.heightHint = 80;
setLayoutData(data);
setBackground(new Color(Display.getCurrent(), Colors.lightGray));
GridLayout layout = new GridLayout();
layout.numColumns = 3;
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 2;
layout.verticalSpacing = 3;
setLayout(layout);
this.conflictTypeLabel = new Label(this, SWT.NONE);
this.stateLabel = new Label(this, SWT.NONE);
this.detailText = new Link(this, SWT.NONE);
this.detailText = new Link(this, SWT.WRAP);
this.detailText.setBackground(new Color(Display.getCurrent(), Colors.lightGray));
TableWrapData td = new TableWrapData();
td.colspan = 1;
detailText.setLayoutData(td);
}
public void update(Conflict conflict) {
......@@ -97,8 +103,7 @@ ICupParserLaLrChangeObserver, IRegisterForControllerChanges {
builder.append(" and other <a href=\"test2\">items</a>.");
detailText.setText(builder.toString());
detailText.setBackground(new Color(Display.getCurrent(), Colors.red));
detailText.setSize(400, 100);
detailText.setBackground(new Color(Display.getCurrent(), Colors.lightGray));
// TODO: this MUST not be set here, because the link item is reused!
detailText.addSelectionListener(new SelectionAdapter(){
......
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