1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

should selected and reveal first element when checking items in list.

This commit is contained in:
David Inglis 2004-09-08 14:50:27 +00:00
parent fbcd0437b1
commit a617f1ba4d
2 changed files with 4 additions and 0 deletions

View file

@ -36,6 +36,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
@ -181,6 +182,7 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
List checkedList = Arrays.asList(parserIDs);
fErrorParserList.setElements(checkedList);
fErrorParserList.setCheckedElements(checkedList);
fErrorParserList.getTableViewer().setSelection(new StructuredSelection(checkedList.get(0)), true);
Iterator items = mapParsers.keySet().iterator();
while( items.hasNext()) {

View file

@ -43,6 +43,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@ -376,6 +377,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
}
}
binaryList.setCheckedElements(selected);
binaryList.getTableViewer().setSelection(new StructuredSelection(selected.get(0)), true);
// Give a change to the UI contributors to react.
// But do it last after the comboBox is set.
handleBinaryParserChanged();