Search in sources :

Example 6 with Version

use of org.terasology.gestalt.naming.Version in project Terasology by MovingBlocks.

the class ModuleDetailsScreen method setUpUpdateModuleButton.

private void setUpUpdateModuleButton() {
    updateModuleButton.bindEnabled(new ReadOnlyBinding<Boolean>() {

        @Override
        public Boolean get() {
            final String online = onlineVersion.getText();
            final String installed = installedVersion.getText();
            if (StringUtils.isNotBlank(online) && StringUtils.isNotBlank(installed)) {
                return new Version(online).compareTo(new Version(installed)) > 0;
            }
            return false;
        }
    });
    updateModuleButton.subscribe((button -> {
        if (dependencyInfoBinding.get() != null) {
            startDownloadingNewestModulesRequiredFor(dependencyInfoBinding.get());
        }
    }));
}
Also used : ModuleInstaller(org.terasology.engine.core.module.ModuleInstaller) Arrays(java.util.Arrays) In(org.terasology.engine.registry.In) Color(org.terasology.nui.Color) LoggerFactory(org.slf4j.LoggerFactory) ModuleMetadata(org.terasology.gestalt.module.ModuleMetadata) AbstractItemRenderer(org.terasology.nui.itemRendering.AbstractItemRenderer) DependencyInfo(org.terasology.gestalt.module.dependencyresolution.DependencyInfo) Canvas(org.terasology.nui.Canvas) ReadOnlyBinding(org.terasology.nui.databinding.ReadOnlyBinding) DateFormat(java.text.DateFormat) TranslationSystem(org.terasology.engine.i18n.TranslationSystem) StringTextRenderer(org.terasology.nui.itemRendering.StringTextRenderer) Binding(org.terasology.nui.databinding.Binding) StringUtils(org.codehaus.plexus.util.StringUtils) Module(org.terasology.gestalt.module.Module) Collection(java.util.Collection) WaitPopup(org.terasology.engine.rendering.nui.layers.mainMenu.WaitPopup) Set(java.util.Set) Version(org.terasology.gestalt.naming.Version) Collectors(java.util.stream.Collectors) DependencyResolver(org.terasology.gestalt.module.dependencyresolution.DependencyResolver) Objects(java.util.Objects) UIText(org.terasology.nui.widgets.UIText) List(java.util.List) Context(org.terasology.engine.context.Context) Stream(java.util.stream.Stream) Vector2i(org.joml.Vector2i) ExtraDataModuleExtension(org.terasology.engine.core.module.ExtraDataModuleExtension) UIList(org.terasology.nui.widgets.UIList) Name(org.terasology.gestalt.naming.Name) MenuAnimationSystems(org.terasology.engine.rendering.nui.animation.MenuAnimationSystems) ModuleManager(org.terasology.engine.core.module.ModuleManager) UIButtonWebBrowser(org.terasology.engine.rendering.nui.widgets.UIButtonWebBrowser) SimpleDateFormat(java.text.SimpleDateFormat) DownloadPopupProgressListener(org.terasology.engine.rendering.nui.layers.mainMenu.advancedGameSetupScreen.DownloadPopupProgressListener) DependencyResolutionFailedException(org.terasology.engine.core.module.DependencyResolutionFailedException) HashSet(java.util.HashSet) StandardModuleExtension(org.terasology.engine.core.module.StandardModuleExtension) ResourceUrn(org.terasology.gestalt.assets.ResourceUrn) ConfirmPopup(org.terasology.engine.rendering.nui.layers.mainMenu.ConfirmPopup) MessagePopup(org.terasology.engine.rendering.nui.layers.mainMenu.MessagePopup) Logger(org.slf4j.Logger) UILabel(org.terasology.nui.widgets.UILabel) CoreScreenLayer(org.terasology.engine.rendering.nui.CoreScreenLayer) UIButton(org.terasology.nui.widgets.UIButton) Comparator(java.util.Comparator) RemoteModuleExtension(org.terasology.engine.core.module.RemoteModuleExtension) Collections(java.util.Collections) Version(org.terasology.gestalt.naming.Version)

Aggregations

Version (org.terasology.gestalt.naming.Version)6 Name (org.terasology.gestalt.naming.Name)5 Module (org.terasology.gestalt.module.Module)4 ModuleMetadata (org.terasology.gestalt.module.ModuleMetadata)4 ModuleManager (org.terasology.engine.core.module.ModuleManager)2 File (java.io.File)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Objects (java.util.Objects)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 StringUtils (org.codehaus.plexus.util.StringUtils)1 Vector2i (org.joml.Vector2i)1