gnu.java.util.prefs.gconf
Class GConfNativePeer
Native peer for GConf based preference backend.
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
GConfNativePeer
public GConfNativePeer()
Creates a new instance of GConfNativePeer
gconf_client_add_dir
protected static final void gconf_client_add_dir(String node)
Adds the given node to the list of nodes that GConf watches for
changes.
node
- the node to watch for changes.
gconf_client_dir_exists
protected static final boolean gconf_client_dir_exists(String node)
Queries the GConf database to see if the given node exists, returning
true if the node exist, false otherwise.
node
- the node to query for existence.
- true if the node exist, false otherwise.
gconf_client_get_string
protected static final String gconf_client_get_string(String key)
Returns the key associated to the given key. Null is returned if the
key is not valid.
key
- the key to return the value of.
- The value associated to the given key, or null.
gconf_client_remove_dir
protected static final void gconf_client_remove_dir(String node)
Removes the given node from the list of nodes that GConf watches for
changes.
node
- the node to remove from from the list of watched nodes.
gconf_client_set_string
protected static final boolean gconf_client_set_string(String key,
String value)
Sets the given key/value pair into the GConf database.
The key must be a valid GConf key.
key
- the key to store in the GConf databasevalue
- the value to associate to the given key.
- true if the change has effect, false otherwise.
gconf_client_unset
protected static final boolean gconf_client_unset(String key)
Usets the given key, removing the key from the database.
- true if the operation success, false otherwise.
gconf_escape_key
protected static final String gconf_escape_key(String plain)
Escape the input String so that it's a valid element for GConf.
plain
- the String to escape.
- An escaped String for use with GConf.
gconf_unescape_key
protected static final String gconf_unescape_key(String escaped)
Converts a string escaped with gconf_escape_key back into its
original form.
escaped
- key as returned by gconf_escape_key
getChildrenNodes
public List getChildrenNodes(String node)
throws BackingStoreException
Lists the subnodes in node
. The returned list contains
allocated strings. Each string is the name relative tho the given node.
node
- the node to get subnodes from. If there are no subnodes in the
given node, a list of size 0 is returned.
getKey
public String getKey(String key)
Gets the value of a configuration key.
key
- the configuration key.
- the values of this key, null if the key is not valid.
getKeys
public List getKeys(String node)
throws BackingStoreException
Lists the key in the given node. Does not list subnodes. Keys names are the
stripped names (name relative to the current node) of the keys stored in
this node.
node
- the node where keys are stored.
- a java.util.List of keys. If there are no keys in the given node, a
list of size 0 is returned.
nodeExist
public boolean nodeExist(String node)
Queries whether the node node
exists in theGConf database.
Returns true
or false
.
node
- the node to check.
setString
public boolean setString(String key,
String value)
Change the value of key to val. Automatically creates the key if it didn't
exist before (ie it was unset or it only had a default value).
Key names must be valid GConf key names, that is, there can be more
restrictions than for normal Preference Backend.
key
- the key to alter (or add).value
- the new value for this key.
- true if the key was updated, false otherwise.
startWatchingNode
public void startWatchingNode(String node)
Add the node node
to the list of nodes the GConf will watch.
An event is raised everytime this node is changed. You can add a node
multiple times.
node
- the node to track.
stopWatchingNode
public void stopWatchingNode(String node)
Remove the node node
to the list of nodes the GConf is
watching. Note that if a node has been added multiple times, you must
remove it the same number of times before the remove takes effect.
node
- the node you don't want to track anymore.
unset
public boolean unset(String key)
Unsets the value of key; if key is already unset, has no effect. Depending
on the GConf daemon, unsetting a key may have the side effect to remove it
completely form the database.
- true on success, false if the key was not updated.
GConfNativePeer.java -- GConf based preference peer for native methods
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.