import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.StateItem;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.RGB;
public TimeGraphLegend(Shell parent, ITimeGraphPresentationProvider provider) {
super(parent);
this.provider = provider;
- this.setShellStyle(getShellStyle());
+ this.setShellStyle(getShellStyle() | SWT.RESIZE);
}
@Override
Composite composite = new Composite(dlgArea, SWT.NONE);
GridLayout layout = new GridLayout();
- layout.numColumns = 2;
composite.setLayout(layout);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
composite.setLayoutData(gd);
}
private void createStatesGroup(Composite composite) {
- Group gs = new Group(composite, SWT.NONE);
+ ScrolledComposite sc = new ScrolledComposite(composite, SWT.V_SCROLL|SWT.H_SCROLL);
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+ Group gs = new Group(sc, SWT.H_SCROLL);
+ sc.setContent(gs);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ sc.setLayoutData(gd);
+
String stateTypeName = provider.getStateTypeName();
StringBuffer buffer = new StringBuffer();
if (!stateTypeName.isEmpty()) {
buffer.append(Messages.TmfTimeLegend_StateTypeName);
gs.setText(buffer.toString());
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gs.setLayoutData(gd);
-
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 20;
gd.verticalIndent = 8;
name.setLayoutData(gd);
}
+ sc.setMinSize(gs.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
@Override