Skip to content

Commit

Permalink
fix: added scroll functionality to the CheckboxTableViewer for select…
Browse files Browse the repository at this point in the history
…ing export types for CSV and Excel

Implemented scroll functionality in the CheckboxTableViewer used to select export types for CSV and Excel. This enhancement ensures that users can navigate through a potentially long list of export types comfortably, even within constrained dialog sizes.

ING-4333
  • Loading branch information
emanuelaepure10 committed Jun 26, 2024
1 parent 93c6156 commit 59ed0cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PlatformUI;

Expand All @@ -57,7 +55,6 @@ public class InstanceExportConfigurationPage extends CommonInstanceExportConfigu
private CheckboxTableViewer featureTypeTable;
private Button selectAll = null;
private Group chooseFeatureTypes;
private Table table;

/**
*
Expand Down Expand Up @@ -122,23 +119,17 @@ public void widgetSelected(SelectionEvent e) {
}
});

Label separatorLabel = new Label(page, SWT.NONE);
separatorLabel.setText("Warning! Feature types with no data are not selectable");
Table table = new Table(chooseFeatureTypes,
SWT.CHECK | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);

// Set the text colour of the label to yellow
Color greyLabel = PlatformUI.getWorkbench().getDisplay()
.getSystemColor(SWT.COLOR_DARK_GRAY);
separatorLabel.setForeground(greyLabel);
featureTypeTable = new CheckboxTableViewer(table);

table = new Table(chooseFeatureTypes, SWT.CHECK | SWT.MULTI | SWT.SCROLL_PAGE);
table.setHeaderVisible(false);
table.setLinesVisible(false);
table.setBackground(PlatformUI.getWorkbench().getDisplay()
.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
GridDataFactory groupData = GridDataFactory.fillDefaults().grab(true, false);
groupData.applyTo(table);
// Configure the layout for the table
GridData tableGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
tableGridData.heightHint = 300; // Minimum height for the table
tableGridData.widthHint = 300; // Minimum width for the table
table.setLayoutData(tableGridData);

featureTypeTable = new CheckboxTableViewer(table);
featureTypeTable.setLabelProvider(new LabelProvider() {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,17 @@ public void widgetSelected(SelectionEvent e) {
}
});

table = new Table(chooseFeatureTypes, SWT.CHECK | SWT.MULTI | SWT.SCROLL_PAGE);
table.setHeaderVisible(false);
table.setLinesVisible(false);
table.setBackground(PlatformUI.getWorkbench().getDisplay()
.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
GridDataFactory groupData = GridDataFactory.fillDefaults().grab(true, false);
groupData.applyTo(table);
table = new Table(chooseFeatureTypes,
SWT.CHECK | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);

featureTypeTable = new CheckboxTableViewer(table);

// Configure the layout for the table
GridData tableGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
tableGridData.heightHint = 300; // Minimum height for the table
tableGridData.widthHint = 300; // Minimum width for the table
table.setLayoutData(tableGridData);

featureTypeTable.setLabelProvider(new LabelProvider() {

@Override
Expand Down

0 comments on commit 59ed0cc

Please sign in to comment.