- protected Control createDialogArea(Composite parent) {
- composite = (Composite) super.createDialogArea(parent);
-
- createMappingsGroup(composite);
- createCRSSettingsGroup(composite);
-
- // compute default values
- Simantics.getSession().asyncRequest(new ReadRequest() {
-
- @Override
- public void run(ReadGraph graph) throws DatabaseException {
-
- vertexMappings = getVertexMappings(graph, configuration);
- edgeMappings = getEdgeMappings(graph, configuration);
-
- composite.getDisplay().asyncExec(() -> {
-
- vertexMappingCombo.setItems(vertexMappings.keySet().toArray(new String[vertexMappings.size()]));
- edgeMappingCombo.setItems(edgeMappings.keySet().toArray(new String[edgeMappings.size()]));
- vertexMappingCombo.select(0);
- edgeMappingCombo.select(0);
- });
-
- }
- });
- return composite;
- }
-
- private void createMappingsGroup(Composite parent) {
- Group group= new Group(parent, SWT.NONE);
- group.setFont(parent.getFont());
- group.setText("Default mappings");
- GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
- group.setLayout(new GridLayout(1, false));
-
- Composite cmposite = new Composite(group, SWT.NONE);
- cmposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- cmposite.setLayout(new GridLayout(2, false));
-
- Label vertexMappingLabel = new Label(cmposite, SWT.NONE);
- vertexMappingLabel.setText("Default vertex mapping");
-
- vertexMappingCombo = new Combo(cmposite, SWT.READ_ONLY | SWT.BORDER);
- GridDataFactory.fillDefaults().grab(true, false).applyTo(vertexMappingCombo);
-
- Label edgeMappingLabel = new Label(cmposite, SWT.NONE);
- edgeMappingLabel.setText("Default edge mapping");
-
- edgeMappingCombo = new Combo(cmposite, SWT.READ_ONLY | SWT.BORDER);
- GridDataFactory.fillDefaults().grab(true, false).applyTo(edgeMappingCombo);