use of org.knime.workbench.explorer.view.preferences.MountSettings in project knime-core by knime.
the class IntroPage method mountServer.
private void mountServer() {
String s = ExplorerActivator.getDefault().getPreferenceStore().getString(PreferenceConstants.P_EXPLORER_MOUNT_POINT_XML);
List<MountSettings> mountSettingsList = MountSettings.parseSettings(s, true);
Set<String> idSet = new LinkedHashSet<>();
for (MountSettings settings : mountSettingsList) {
idSet.add(settings.getFactoryID());
}
List<String> contentProviderIDs = new ArrayList<String>(idSet);
List<String> mountIDs = new ArrayList<String>(mountSettingsList.size());
for (MountSettings settings : mountSettingsList) {
mountIDs.add(settings.getMountID());
}
EditMountPointDialog dlg = new EditMountPointDialog(Display.getDefault().getActiveShell(), ExplorerMountTable.getAddableContentProviders(contentProviderIDs), mountIDs);
if (dlg.open() != Window.OK) {
return;
}
AbstractContentProvider newCP = dlg.getContentProvider();
if (newCP != null) {
MountSettings mountSettings = new MountSettings(newCP);
if (mountSettings.getDefaultMountID() == null) {
mountSettings.setDefaultMountID(dlg.getDefaultMountID());
}
mountSettingsList.add(mountSettings);
// store new mount point settings
String settingsString = MountSettings.getSettingsString(mountSettingsList);
ExplorerActivator.getDefault().getPreferenceStore().setValue(PreferenceConstants.P_EXPLORER_MOUNT_POINT_XML, settingsString);
}
}
Aggregations