Shifting to GridData for form layout.

This commit is contained in:
a2geek committed 2026-08-11 14:48:02 -05:00
1 parent aec88e483e
commit 316cec8fd3
2 files changed
+23 -20

No files matched your search

@@ -30,11 +30,12 @@ import com.webcodepro.applecommander.util.TextBundle;
import org.applecommander.source.Source;
import org.applecommander.source.Sources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import java.util.ArrayList;
import java.util.List;
@@ -49,7 +50,7 @@ public class CompareDisksResultsPane extends WizardPane<CompareDisksWizard.Pages
private final Composite parent;
private final Object layoutData;
private final CompareDisksWizard wizard;
private Label resultLabel;
private Text resultText;
/**
* Constructor for ExportFileStartPane.
*/
@@ -65,20 +66,19 @@ public class CompareDisksResultsPane extends WizardPane<CompareDisksWizard.Pages
public Control create() {
Composite control = new Composite(parent, SWT.NULL);
control.setLayoutData(layoutData);
RowLayout layout = new RowLayout(SWT.VERTICAL);
layout.justify = true;
GridLayout layout = new GridLayout();
layout.marginBottom = 5;
layout.marginLeft = 5;
layout.marginRight = 5;
layout.marginTop = 5;
layout.spacing = 3;
control.setLayout(layout);
resultLabel = new Label(control, SWT.WRAP);
resultLabel.setLayoutData(new RowData(400, 500));
resultText = new Text(control, SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
resultText.setEditable(false);
resultText.setLayoutData(new GridData(GridData.FILL_BOTH));
Label label = new Label(control, SWT.WRAP);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
label.setText(textBundle.get("CompareDisksResultsPane.RestartText"));
parent.pack();
@@ -98,7 +98,7 @@ public class CompareDisksResultsPane extends WizardPane<CompareDisksWizard.Pages
wizard.enableFinishButton(true);
String message = compareDisks();
resultLabel.setText(message);
resultText.setText(message);
}
protected String compareDisks() {
List<String> errorMessages = new ArrayList<>();
@@ -27,8 +27,8 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
/**
@@ -61,23 +61,25 @@ public class CompareDisksStartPane extends WizardPane<CompareDisksWizard.Pages>
public Control create() {
control = new Composite(parent, SWT.NULL);
control.setLayoutData(layoutData);
RowLayout layout = new RowLayout(SWT.VERTICAL);
layout.justify = true;
GridLayout layout = new GridLayout();
layout.marginBottom = 5;
layout.marginLeft = 5;
layout.marginRight = 5;
layout.marginTop = 5;
layout.spacing = 3;
control.setLayout(layout);
Label label = new Label(control, SWT.WRAP);
label.setText(textBundle.get("CompareDisksStartPane.Description"));
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.GRAB_HORIZONTAL));
label = new Label(control, SWT.WRAP);
label.setText(getDiskLabel(1));
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.GRAB_HORIZONTAL));
diskname1Text = new Text(control, SWT.WRAP | SWT.BORDER);
diskname1Text.setLayoutData(new RowData(400, 100));
int widthHint = parent.getSize().x - parent.getBorderWidth();
diskname1Text = new Text(control, SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
diskname1Text.setLayoutData(new GridData(GridData.FILL_BOTH));
diskname1Text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
Text text = (Text) event.getSource();
@@ -102,8 +104,8 @@ public class CompareDisksStartPane extends WizardPane<CompareDisksWizard.Pages>
label = new Label(control, SWT.WRAP);
label.setText(getDiskLabel(2));
diskname2Text = new Text(control, SWT.WRAP | SWT.BORDER);
diskname2Text.setLayoutData(new RowData(400, 100));
diskname2Text = new Text(control, SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
diskname2Text.setLayoutData(new GridData(GridData.FILL_BOTH));
diskname2Text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
Text text = (Text) event.getSource();
@@ -146,7 +148,8 @@ public class CompareDisksStartPane extends WizardPane<CompareDisksWizard.Pages>
limitText = new Text(control, SWT.WRAP | SWT.BORDER);
limitText.setText(Integer.toString(wizard.getMessageLimit()));
limitText.setLayoutData(new RowData(200, -1));
limitText.setTextLimit(10);
limitText.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
limitText.addModifyListener(this::limitTextModifyListener);
parent.pack();