From 7a8d714eb2f4db55c6429f52d7383f6a05dc1302 Mon Sep 17 00:00:00 2001 From: Owen Reynolds Date: Tue, 10 Dec 2024 15:56:51 +0000 Subject: [PATCH 1/3] Added "Browse File system" button to launcher run configuration, model tab (edit). Model files can be added from the file system. --- .../rdf/dt/RDFModelConfigurationDialog.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java b/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java index f514102..22f8602 100644 --- a/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java +++ b/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java @@ -39,6 +39,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.FileDialog; public class RDFModelConfigurationDialog extends AbstractModelConfigurationDialog { @@ -261,6 +262,7 @@ public void widgetSelected(SelectionEvent e) { return groupContent; } + private String lastPath = null; private Composite createRDFUrlsGroup(Composite parent) { final Composite groupContent = DialogUtil.createGroupContainer(parent, "URLs to load", 2); @@ -312,7 +314,27 @@ public void widgetSelected(SelectionEvent e) { } } }); - + + final Button addFromFileSystemButton = new Button(urlButtons, SWT.NONE); + addFromFileSystemButton.setText("Browse File system..."); + addFromFileSystemButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); + fileDialog.setText("Select an RDF file to add"); + fileDialog.setFilterExtensions(new String[] { ".rdf", ".*" }); + if (lastPath != null) + fileDialog.setFilterPath(lastPath); + + String selectedFile = fileDialog.open(); + if (selectedFile != null) { + urls.add(new URLTableEntry("file:" + selectedFile)); + urlList.refresh(); + } + lastPath = fileDialog.getFilterPath(); + } + }); + final Button removeUrlButton = new Button(urlButtons, SWT.NONE); removeUrlButton.setText("Remove"); removeUrlButton.addSelectionListener(new SelectionAdapter() { From d699209032d3828a9209d7c9947a0fb30a09fb7f Mon Sep 17 00:00:00 2001 From: Antonio Garcia-Dominguez Date: Wed, 11 Dec 2024 10:01:11 +0000 Subject: [PATCH 2/3] Browse button: tweak name, add Turtle extension --- .../epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java b/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java index 22f8602..22eb774 100644 --- a/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java +++ b/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java @@ -316,13 +316,13 @@ public void widgetSelected(SelectionEvent e) { }); final Button addFromFileSystemButton = new Button(urlButtons, SWT.NONE); - addFromFileSystemButton.setText("Browse File system..."); + addFromFileSystemButton.setText("Browse Filesystem..."); addFromFileSystemButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); fileDialog.setText("Select an RDF file to add"); - fileDialog.setFilterExtensions(new String[] { ".rdf", ".*" }); + fileDialog.setFilterExtensions(new String[] { ".rdf", ".ttl", ".*" }); if (lastPath != null) fileDialog.setFilterPath(lastPath); From f80cd39c2e84a6d0ebec9315111fbc6eddfbd4b1 Mon Sep 17 00:00:00 2001 From: Owen Reynolds Date: Wed, 11 Dec 2024 11:28:17 +0000 Subject: [PATCH 3/3] Added additional file types --- .../eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java b/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java index 22eb774..8d4dfab 100644 --- a/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java +++ b/bundles/org.eclipse.epsilon.emc.rdf.dt/src/org/eclipse/epsilon/emc/rdf/dt/RDFModelConfigurationDialog.java @@ -322,7 +322,7 @@ public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) { FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); fileDialog.setText("Select an RDF file to add"); - fileDialog.setFilterExtensions(new String[] { ".rdf", ".ttl", ".*" }); + fileDialog.setFilterExtensions(new String[] { ".rdf", ".ttl", ".nt", ".nq", ".trig", ".owl", ".jsonld", ".trdf", ".rt", ".rpb", ".pbrdf", ".rj", ".trix", ".*" }); if (lastPath != null) fileDialog.setFilterPath(lastPath);