1 package net.mograsim.plugin.tables;
3 import org.eclipse.swt.SWT;
4 import org.eclipse.swt.widgets.Combo;
5 import org.eclipse.swt.widgets.Composite;
6 import org.eclipse.swt.widgets.Label;
8 import net.mograsim.plugin.asm.AsmNumberUtil.NumberType;
10 public class RadixSelector
12 private final Composite parent;
13 private final DisplaySettings target;
17 public RadixSelector(Composite parent, DisplaySettings target)
24 private void setupRadixSelector()
26 label = new Label(parent, SWT.NONE);
27 label.setText("Radix: ");
28 combo = new Combo(parent, SWT.READ_ONLY);
30 String entries[] = new String[] { "Binary", "Octal", "Decimal", "Hexadecimal" };
31 NumberType corTypes[] = new NumberType[] { NumberType.BINARY, NumberType.OCTAL, NumberType.DECIMAL, NumberType.HEXADECIMAL };
32 combo.setItems(entries);
34 combo.addListener(SWT.Selection, e ->
36 int index = combo.getSelectionIndex();
38 target.setDataNumberType(NumberType.HEXADECIMAL);
40 target.setDataNumberType(corTypes[index]);
44 public Label getLabel()
49 public Combo getCombo()