Package devplugin

Examples of devplugin.Version


        pb.add(iconLabel, cc.xyw(2,4,3));

        JLabel label3 = new JLabel();

        if (item.isAlreadyInstalled()) {
          Version installedVersion = item.getInstalledVersion();
          if ((installedVersion != null) && (installedVersion.compareTo(item.getVersion()) < 0)) {
            label.setIcon(NEW_VERSION_ICON);

            label3.setText("(" + mLocalizer.msg("installed","Installed version: ") + installedVersion.toString()+")");
            label3.setFont(label3.getFont().deriveFont(label3.getFont().getSize2D()+2));

            pb.add(label3, cc.xy(4,2));
          }
        }
View Full Code Here


      while (it.hasNext()) {
        SoftwareUpdateItem item = it.next();
        String className = item.getClassName();

        // remove incompatible items
        Version required = item.getRequiredVersion();
        Version maximum = item.getMaximumVersion();
        if ((required!=null && TVBrowser.VERSION.compareTo(required)<0) ||
            (maximum != null && TVBrowser.VERSION.compareTo(maximum)>0) ||
            !item.getProperty("filename").toLowerCase().endsWith(".jar") ||
            !item.isSupportingCurrentOs()) {
View Full Code Here

            }
          });
        }catch(Exception e) {}

        String versionString = prop.getProperty("version",null);
        Version testVersion = null;

        if(versionString != null) {
          try {
            int asInt = Integer.parseInt(versionString);
            int major = asInt / 100;
            int minor = asInt % 100;
            testVersion = new Version(major,minor);
          }
          catch(NumberFormatException exc) {
            // Ignore
          }
        }

        String temp = prop.getProperty("dir.tvdata", null);
        boolean versionTest = !TVBrowser.isTransportable() && Launch.isOsWindowsNtBranch() && testVersion != null && testVersion.compareTo(new Version(3,0,true)) < 0
                               && (temp == null || temp.replace("/","\\").equals(System.getProperty("user.home")+"\\TV-Browser\\tvdata"));

        if((TVBrowser.isTransportable() || versionTest)
            && !(new File(getUserDirectoryName(),"tvdata").isDirectory())) {
          try {
View Full Code Here

            Class<?> pluginClass = classLoader.loadClass(pluginName.toLowerCase() + '.' + pluginName);

            Method getVersion = pluginClass.getMethod("getVersion", new Class[0]);

            Version version1 = null;
            try {
              version1 = (Version) getVersion.invoke(pluginClass, new Object[0]);
            } catch (Throwable t1) {
              t1.printStackTrace();
            }

            if (installedPlugin != null && (installedPlugin.getInfo().getVersion().compareTo(version1) > 0 || (installedPlugin.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
              alreadyInstalled.append(installedPlugin.getInfo().getName()).append('\n');
            } else if (service != null && (service.getInfo().getVersion().compareTo(version1) > 0 || (service.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
              alreadyInstalled.append(service.getInfo().getName()).append('\n');
            } else {
              RandomAccessFile write = new RandomAccessFile(tmpFile, "rw");

              String versionString = Integer.toString(version1.getMajor()) + '.' + (version1.getMinor() / 10) + (version1.getMinor() % 10)
                  + '.' + version1.getSubMinor();

              write.seek(write.length());

              write.writeBytes("[plugin:" + pluginName + "]\n");
              write.writeBytes("name_en=" + pluginName + "\n");
              write.writeBytes("filename=" + jarFile.getName() + "\n");
              write.writeBytes("version=" + versionString + "\n");
              write.writeBytes("stable=" + version1.isStable() + "\n");
              write.writeBytes("download=" + jarFile.toURI().toURL() + "\n");
              write.writeBytes("category=unknown\n");

              write.close();
View Full Code Here

      }
    }catch(NumberFormatException e) {
      return null;
    }
    stable = "true".equalsIgnoreCase(getProperty("stable"));
    return new Version(major, minor, subMinor, stable, getProperty("version.name"));
  }
View Full Code Here

        subMinor = Integer.parseInt(s[2]);
      }
    }catch(NumberFormatException e) {
      return null;
    }
    return new Version(major, minor, subMinor);
  }
View Full Code Here

      mBlockStart = null;
    }
    else {
      String[] versionPart = partA[1].split(",");

      mBlockStart = new Version(Integer.valueOf(versionPart[0]),Integer.valueOf(versionPart[1]),Integer.valueOf(versionPart[2]),Boolean.valueOf(versionPart[3]));
    }

    if(partA[2].equals("null")) {
      mBlockStart = null;
    }
    else {
      String[] versionPart = partA[2].split(",");

      mBlockEnd = new Version(Integer.valueOf(versionPart[0]),Integer.valueOf(versionPart[1]),Integer.valueOf(versionPart[2]),Boolean.valueOf(versionPart[3]));
    }
  }
View Full Code Here

  public boolean isBlockedVersion(PluginAccess plugin) {
    return plugin != null
        && plugin.getId().equals(mPluginId)
        && (((mBlockEnd == null || plugin.getInfo().getVersion().compareTo(mBlockEnd) <= 0) && (mBlockStart == null || plugin
            .getInfo().getVersion().compareTo(mBlockStart) >= 0)) || plugin.getInfo().getVersion().compareTo(
            new Version(0, 0, 0, true)) <= 0);
  }
View Full Code Here

  public boolean isBlockedVersion(String pluginId, Version version) {
    return pluginId != null
        && version != null
        && pluginId.equals(mPluginId)
        && (((mBlockEnd == null || version.compareTo(mBlockEnd) <= 0) && (mBlockStart == null || version
            .compareTo(mBlockStart) >= 0)) || version.compareTo(new Version(0, 0, 0, true)) <= 0);
  }
View Full Code Here

      String name = in.readUTF();
      String author = in.readUTF();
      String description = in.readUTF();
      String license = in.readUTF();

      DummyPlugin.setCurrentVersion(new Version(in));

      String pluginId = in.readUTF();
      in.readLong(); // file size is unused
      String lcFileName = in.readUTF();
      in.close();
View Full Code Here

TOP

Related Classes of devplugin.Version

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.