Package ca.canucksoftware.webos

Examples of ca.canucksoftware.webos.InstalledEntry


        if(pkgs==null) {
            try {
                pkgs = webOS.listInstalled();
                apps = getApps();
                for(int i=0; i<pkgs.size(); i++) {
                    InstalledEntry curr = pkgs.get(i);
                    String name = curr.getName();
                    if(name.equals("This is a webOS application.")) {
                        if(apps!=null) {
                            JSONObject json = getAppInfoFromId(curr.getId());
                            try {
                                curr.setName(json.getString("title"));
                                curr.setDeveloper(json.getString("vendor"));
                            } catch(Exception e) {}
                        } else {
                            curr.setName(curr.getName(webOS));
                        }
                    }
                }
            } catch(StackOverflowError e) {
                System.err.println(e.getMessage());
            }
        }
        filtered.clear();
        while(modTable.getRowCount()>0) {
            modTable.removeRow(0);
        }
        for(int i=0; i<pkgs.size(); i++) {
            InstalledEntry curr = pkgs.get(i);
            if((jComboBox1.getSelectedIndex()==1)==
                    (curr.getId().startsWith("ca.canucksoftware.patches.") ||
                    curr.getId().startsWith("org.webosinternals.patches."))) {
                filtered.add(curr);
                modTable.addRow(new Object[] {curr.getName(), Boolean.FALSE});
            }
        }
    }
View Full Code Here


    public void uninstall() {
        webOS.remountPartitionReadWrite();
        for(int i=0; i<modTable.getRowCount(); i++) {
            if(modTable.getValueAt(i, 1)==Boolean.TRUE) {
                InstalledEntry curr = filtered.get(i);
                ArrayList<String> warn = webOS.whatDependsRecursive(curr.getId());
                if(warn.size()>0) {
                    String warnMsg = "<html><body width=\"300px\">" +
                            MessageFormat.format(bundle
                            .getString("DEPENDANT_PACKAGES_EXIST_WARNING"),
                            new Object[] {modTable.getValueAt(i, 0)}) + "\n";
View Full Code Here

        }
        return result;
    }

    public boolean uninstallPackage(InstalledEntry entry) {
        InstalledEntry curr = entry;
        boolean continueOn = true;
        ArrayList<String> depends = webOS.whatDepends(entry.getId());
        if(depends.size()>0) {
            for(int i=0; i<depends.size(); i++) {
                int index = indexOfPackage(depends.get(i));
                if(index>-1) {
                    continueOn &= uninstallPackage(pkgs.get(index));
                    if(!continueOn) {
                        break;
                    }
                }
            }
        }
        if(continueOn && webOS.uninstall(curr.getId())) {
            pkgs.remove(curr);
            int index = indexOfFiltered(curr.getId());
            if(index>-1) {
                modTable.removeRow(index);
                filtered.remove(index);
            }
            continueOn = true;
View Full Code Here

    }

    private boolean okToAdd(PackageEntry item, boolean includeInstalled) {
        boolean result = true;
        if(!includeInstalled) {
            result &= (installed.indexOf(new InstalledEntry(item.id))==-1);
        }
        result &= item.arch.equals(device.arch()) || item.arch.equals("any") ||
                item.arch.equals("all") || device.arch().startsWith(item.arch);
        if(result && item.source!=null) {
            if(item.source.has("DeviceCompatibility")) {
View Full Code Here

    public ArrayList<PackageEntry> getUpdates() {
        ArrayList<PackageEntry> results = new ArrayList(0);
        for(int i=0; i<packages.size(); i++) {
            PackageEntry curr = (PackageEntry) packages.get(i);
            int index = installed.indexOf(new InstalledEntry(curr.id));
            if(index>-1) {
                if(curr.isUpdate(installed.get(index))) {
                    results.add(curr);
                }
            }
View Full Code Here

    public boolean hasPackages() {
        return (packages.size()>0);
    }

    public boolean isInstalled(PackageEntry pkg) {
        return installed.contains(new InstalledEntry(pkg.id));
    }
View Full Code Here

TOP

Related Classes of ca.canucksoftware.webos.InstalledEntry

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.