Package org.osgi.service.prefs

Examples of org.osgi.service.prefs.Preferences.clear()


            }

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            Platform.getPreferencesService().exportPreferences((IEclipsePreferences) toSave, out,
                    null);
            toSave.clear();

            return URLEncoder.encode(out.toString(), ENCODING);
        } catch (Throwable t) {
            ProjectPlugin
                    .log(
View Full Code Here


            }

            FileOutputStream out = new FileOutputStream(catalogLocation);
            Platform.getPreferencesService().exportPreferences((IEclipsePreferences) toSave, out,
                    null);
            toSave.clear();

        } catch (Throwable t) {
            CatalogPlugin.log("Error saving services for the local catalog", t); //$NON-NLS-1$
        }
    }
View Full Code Here

                if (keywordsText.getText().trim().length() > 0) {
                    Preferences node = findNode(createdCRS.getName().getCode());
                    if( node!=null ){
                        Preferences kn = node.node(ALIASES_ID);
                        String[] keywords = keywordsText.getText().split(","); //$NON-NLS-1$
                        kn.clear();
                        for( String string : keywords ) {
                            string=string.trim().toUpperCase();
                            if(string.length()>0)
                                kn.put(string,string);
                        }
View Full Code Here

      }
      if (node.keys().length == 0) {
        current = null;
        return;
      }
      node.clear();
      next(next);
    } catch (Exception e) {
      UiPlugin.log("", e); //$NON-NLS-1$
    }
  }
View Full Code Here

     * ********/

    void savePreferences() {
        Preferences workingNode = m_prefs.node(PREFS_LOCAL_WORKING_STATE);
        try {
            workingNode.clear();
        }
        catch (BackingStoreException e) {
            // Something went wrong clearing the node... Too bad, this means we
            // cannot store the properties.
            m_log.log(LogService.LOG_WARNING, "Could not store all preferences for " + workingNode.absolutePath());
View Full Code Here

        return deployer.getPreferencesService().getUserPreferences(getName());
    }

    protected void deletePreferences() throws BackingStoreException {
        Preferences prefs = getPreferences();
        prefs.clear();
        prefs.flush();
    }

    public boolean isAutoStart() {
        return autoStart;
View Full Code Here

        expect(prefs.node("repositories")).andReturn(repositoriesNode);
        repositoriesNode.clear();
        repositoriesNode.putInt("count", 1);
        repositoriesNode.put("item.0", uri.toString());
        expect(prefs.node("features")).andReturn(featuresNode);
        featuresNode.clear();
        prefs.putBoolean("bootFeaturesInstalled", false);
        prefs.flush();
        featuresRegistry.register(isA(Repository.class));

        replay(preferencesService, prefs, repositoriesNode, featuresNode, bundleContext, installedBundle, featuresRegistry);
View Full Code Here

        expect(prefs.node("repositories")).andReturn(repositoriesNode);
        repositoriesNode.clear();
        repositoriesNode.putInt("count", 1);
        repositoriesNode.put("item.0", uri.toString());
        expect(prefs.node("features")).andReturn(featuresNode);
        featuresNode.clear();
        featuresNode.put("f1" + FeatureImpl.SPLIT_FOR_NAME_AND_VERSION + FeatureImpl.DEFAULT_VERSION, "12345");
        prefs.putBoolean("bootFeaturesInstalled", false);
        prefs.flush();

        replay(preferencesService, prefs, repositoriesNode, featuresNode, bundleContext, installedBundle);
View Full Code Here

    }

    synchronized void saveState() throws IOException, BackingStoreException {
        Preferences prefs = preferences.getUserPreferences("AdminServiceState");
        Preferences child = prefs.node("Instances");
        child.clear();
        Instance[] data = getInstances();
        child.putInt("count", data.length);
        for (int i = 0; i < data.length; i++) {
            child.put("item." + i + ".name", data[i].getName());
            child.put("item." + i + ".loc", data[i].getLocation());
View Full Code Here

     * ********/

    void savePreferences() {
        Preferences workingNode = m_prefs.node(PREFS_LOCAL_WORKING_STATE);
        try {
            workingNode.clear();
        }
        catch (BackingStoreException e) {
            // Something went wrong clearing the node... Too bad, this means we
            // cannot store the properties.
            m_log.log(LogService.LOG_WARNING, "Could not store all preferences for " + workingNode.absolutePath());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.