diff --git a/bundles/code/org.eclipse.fx.code.editor.langs.contrib/src/org/eclipse/fx/code/editor/langs/contrib/LangsConfigurationModelProvider.java b/bundles/code/org.eclipse.fx.code.editor.langs.contrib/src/org/eclipse/fx/code/editor/langs/contrib/LangsConfigurationModelProvider.java index 7ce445651..c9bbd2228 100644 --- a/bundles/code/org.eclipse.fx.code.editor.langs.contrib/src/org/eclipse/fx/code/editor/langs/contrib/LangsConfigurationModelProvider.java +++ b/bundles/code/org.eclipse.fx.code.editor.langs.contrib/src/org/eclipse/fx/code/editor/langs/contrib/LangsConfigurationModelProvider.java @@ -15,7 +15,7 @@ import org.eclipse.fx.code.editor.configuration.LanguageDef; import org.eclipse.fx.code.editor.configuration.text.ConfigurationModelProvider; import org.eclipse.fx.code.editor.services.URIProvider; -import org.eclipse.fx.core.Util; +import org.eclipse.fx.core.URLUtils; import org.eclipse.fx.core.log.LoggerCreator; import org.osgi.service.component.annotations.Component; @@ -80,12 +80,12 @@ public LangsConfigurationModelProvider() { } private static final Optional, URL>> prefix(String prefix, String url) { - return Util.createUrl(url, true).map( u -> new SuffixFunction(prefix,u)); + return URLUtils.createUrl(url, true).map( u -> new SuffixFunction(prefix,u)); } private static final Optional, URL>> javaSupport() { - Optional javaBase = Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/java.json", true); - Optional moduleInfo = Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/jmod.json", true); + Optional javaBase = URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/java.json", true); + Optional moduleInfo = URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/jmod.json", true); if( ! javaBase.isPresent() || ! moduleInfo.isPresent() ) { return null; } diff --git a/bundles/code/org.eclipse.fx.code.editor.langs.themes/src/org/eclipse/fx/code/editor/langs/themes/DefaultEditorStylesheets.java b/bundles/code/org.eclipse.fx.code.editor.langs.themes/src/org/eclipse/fx/code/editor/langs/themes/DefaultEditorStylesheets.java index f26e772d7..1f7b3793e 100644 --- a/bundles/code/org.eclipse.fx.code.editor.langs.themes/src/org/eclipse/fx/code/editor/langs/themes/DefaultEditorStylesheets.java +++ b/bundles/code/org.eclipse.fx.code.editor.langs.themes/src/org/eclipse/fx/code/editor/langs/themes/DefaultEditorStylesheets.java @@ -2,7 +2,7 @@ import java.net.URL; -import org.eclipse.fx.core.Util; +import org.eclipse.fx.core.URLUtils; import org.eclipse.fx.ui.services.theme.MultiURLStylesheet; import org.eclipse.fx.ui.services.theme.Theme; import org.eclipse.jdt.annotation.NonNull; @@ -18,23 +18,23 @@ public class DefaultEditorStylesheets implements MultiURLStylesheet { public DefaultEditorStylesheets() { ObservableList<@NonNull URL> stylesheets = FXCollections.observableArrayList(); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/adoc.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/ceylon.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/dart.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/go.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/groovy.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/java.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/jmod.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/js.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/kotlin.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/lua.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/php.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/py.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/rust.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/swift.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/ts.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/xml.css", true).ifPresent(stylesheets::add); - Util.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/sh.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/adoc.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/ceylon.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/dart.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/go.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/groovy.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/java.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/jmod.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/js.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/kotlin.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/lua.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/php.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/py.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/rust.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/swift.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/ts.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/xml.css", true).ifPresent(stylesheets::add); + URLUtils.createUrl("platform:/plugin/org.eclipse.fx.code.editor.langs/org/eclipse/fx/code/editor/ldef/langs/sh.css", true).ifPresent(stylesheets::add); this.stylesheets = stylesheets; } diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/internal/FileInput.java b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/internal/FileInput.java index ffb94d7b1..201ef7e78 100644 --- a/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/internal/FileInput.java +++ b/experimental/compensator/org.eclipse.fx.code.compensator.editor/src/org/eclipse/fx/code/compensator/editor/internal/FileInput.java @@ -25,8 +25,8 @@ import org.eclipse.fx.code.compensator.editor.TextEditor; import org.eclipse.fx.code.compensator.editor.URIProvider; import org.eclipse.fx.code.compensator.editor.services.ContentTypeDetector; +import org.eclipse.fx.core.IOUtils; import org.eclipse.fx.core.URI; -import org.eclipse.fx.core.Util; import org.eclipse.fx.core.di.Service; public class FileInput implements Input, ContentTypeProvider, URIProvider { @@ -49,7 +49,7 @@ public URI getURI() { public String getData() { if( data == null ) { try { - data = Util.slurpFileContent(path); + data = IOUtils.slurpFileContent(path); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/experimental/compensator/org.eclipse.fx.code.compensator.project/src/org/eclipse/fx/code/compensator/project/navigator/FolderItem.java b/experimental/compensator/org.eclipse.fx.code.compensator.project/src/org/eclipse/fx/code/compensator/project/navigator/FolderItem.java index b5138b09a..d7354d969 100644 --- a/experimental/compensator/org.eclipse.fx.code.compensator.project/src/org/eclipse/fx/code/compensator/project/navigator/FolderItem.java +++ b/experimental/compensator/org.eclipse.fx.code.compensator.project/src/org/eclipse/fx/code/compensator/project/navigator/FolderItem.java @@ -13,6 +13,7 @@ import org.eclipse.fx.code.compensator.project.ProjectNavigatorItem; import org.eclipse.fx.core.FilesystemService; +import org.eclipse.fx.core.ServiceUtils; import org.eclipse.fx.core.FilesystemService.Kind; import org.eclipse.fx.core.URI; import org.eclipse.fx.core.Util; @@ -33,7 +34,7 @@ public class FolderItem extends PathItem { public FolderItem(ProjectNavigatorItem parent, Path path, BiFunction pathItemFactory) { super(parent,path); this.pathItemFactory = pathItemFactory; - Util.lookupService(FilesystemService.class).observePath(path, this::handleFilesystemMod); + ServiceUtils.getService(FilesystemService.class).ifPresent(s -> s.observePath(path, this::handleFilesystemMod)); } private void handleFilesystemMod(Kind kind, Path path) {