Package org.openstreetmap.josm.plugins

Examples of org.openstreetmap.josm.plugins.PluginInformation


        notifyObservers();
    }

    protected void updateAvailablePlugin(PluginInformation other) {
        if (other == null) return;
        PluginInformation pi = getPluginInformation(other.name);
        if (pi == null) {
            availablePlugins.add(other);
            return;
        }
        pi.updateFromPluginSite(other);
    }
View Full Code Here


     * @return the list of plugins waiting for update or download
     */
    public List<PluginInformation> getPluginsScheduledForUpdateOrDownload() {
        List<PluginInformation> ret = new ArrayList<>();
        for (String plugin: pendingDownloads) {
            PluginInformation pi = getPluginInformation(plugin);
            if (pi == null) {
                continue;
            }
            ret.add(pi);
        }
View Full Code Here

     *
     * @param name the name of the plugin
     * @param selected true, if selected; false, otherwise
     */
    public void setPluginSelected(String name, boolean selected) {
        PluginInformation pi = getPluginInformation(name);
        if (pi != null) {
            selectedPluginsMap.put(pi,selected);
            if (pi.isUpdateRequired()) {
                pendingDownloads.add(pi.name);
            }
        }
        if (!selected) {
            pendingDownloads.remove(name);
View Full Code Here

        if (enabledPlugins == null) {
            this.selectedPluginsMap.clear();
            return;
        }
        for (String name: enabledPlugins) {
            PluginInformation pi = getPluginInformation(name);
            if (pi == null) {
                continue;
            }
            setPluginSelected(name, true);
        }
View Full Code Here

     *
     * @param name the plugin name
     * @return true if the plugin is selected; false, otherwise
     */
    public boolean isSelectedPlugin(String name) {
        PluginInformation pi = getPluginInformation(name);
        if (pi == null) return false;
        if (selectedPluginsMap.get(pi) == null) return false;
        return selectedPluginsMap.get(pi);
    }
View Full Code Here

     * @return the set of newly deactivated plugins
     */
    public List<PluginInformation> getNewlyActivatedPlugins() {
        List<PluginInformation> ret = new LinkedList<>();
        for (Entry<PluginInformation, Boolean> entry: selectedPluginsMap.entrySet()) {
            PluginInformation pi = entry.getKey();
            boolean selected = entry.getValue();
            if (selected && ! currentActivePlugins.contains(pi.name)) {
                ret.add(pi);
            }
        }
View Full Code Here

            File downloadedPluginFile = PluginHandler.findUpdatedJar(pi.name);
            if (downloadedPluginFile == null) {
                continue;
            }
            try {
                PluginInformation newinfo = new PluginInformation(downloadedPluginFile, pi.name);
                PluginInformation oldinfo = getPluginInformation(pi.name);
                if (oldinfo == null) {
                    // should not happen
                    continue;
                }
                oldinfo.updateLocalInfo(newinfo);
            } catch(PluginException e) {
                Main.error(e);
            }
        }
    }
View Full Code Here

                    model.updateAvailablePlugins(pluginInfoDownloadTask.getAvailablePlugins());
                    // select plugins which actually have to be updated
                    //
                    Iterator<PluginInformation> it = toUpdate.iterator();
                    while(it.hasNext()) {
                        PluginInformation pi = it.next();
                        if (!pi.isUpdateRequired()) {
                            it.remove();
                        }
                    }
                    if (toUpdate.isEmpty()) {
                        alertNothingToUpdate();
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.plugins.PluginInformation

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.