X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Fnature%2Fproperties%2FMograsimNaturePropertyPage.java;h=1b6c3d8e3faad5d2e4fe4a2553161024864a572f;hb=161ecd36b6dcfe0e38cee3fd6ea8ad42d0705777;hp=bffceac45eb803247e465a6b37cb38d5c0db42e3;hpb=9662828740a9f059694fdf5665f59d8bcbd0122a;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/properties/MograsimNaturePropertyPage.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/properties/MograsimNaturePropertyPage.java index bffceac4..1b6c3d8e 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/properties/MograsimNaturePropertyPage.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/properties/MograsimNaturePropertyPage.java @@ -24,9 +24,10 @@ public class MograsimNaturePropertyPage extends PropertyPage private static final String WARNING = "Changing the Mograsim machine can completely break your project. Be careful."; private static final String MACHINE_LABEL = "Machine definition"; private static final String MACHINE_PROPERTY = "net.mograsim.projectMachineId"; - private static final String DEFAULT_MACHINE = "Am2900Simple";// TODO don't hardcode that here! + private static final String DEFAULT_MACHINE = "Am2900Teaching";// TODO don't hardcode that here! private MachineCombo machineSelect; + private Label machineDescription; private MachineDefinition defaultMachineDefinition; private MachineContext machineContext; @@ -41,7 +42,7 @@ public class MograsimNaturePropertyPage extends PropertyPage private void addFirstSection(Composite parent) { - Composite composite = createDefaultComposite(parent); + Composite composite = createDefaultComposite(parent, false); // Label for path field Label pathLabel = new Label(composite, SWT.NONE); @@ -59,7 +60,7 @@ public class MograsimNaturePropertyPage extends PropertyPage private void addSecondSection(Composite parent) { - Composite composite = createDefaultComposite(parent); + Composite composite = createDefaultComposite(parent, true); // Label for machine Label ownerLabel = new Label(composite, SWT.NONE); @@ -68,8 +69,9 @@ public class MograsimNaturePropertyPage extends PropertyPage // Machine choice machineSelect = MachineContextSwtTools.createMachineSelector(composite, SWT.NONE); - if (currentId.isPresent()) - machineSelect.add(currentId.get()); + machineDescription = new Label(composite, SWT.WRAP); + machineSelect.addListener(md -> machineDescription.setText(md.getDescription())); + machineDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); Optional currentMachineDefinition = machineContext.getMachineDefinition(); @@ -99,7 +101,7 @@ public class MograsimNaturePropertyPage extends PropertyPage return composite; } - private Composite createDefaultComposite(Composite parent) + private Composite createDefaultComposite(Composite parent, boolean grabExcessVerticalSpace) { Composite composite = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -109,6 +111,8 @@ public class MograsimNaturePropertyPage extends PropertyPage GridData data = new GridData(); data.verticalAlignment = GridData.FILL; data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + data.grabExcessVerticalSpace = grabExcessVerticalSpace; composite.setLayoutData(data); return composite;