java.util.prefs.AbstractPreferences Java Examples
The following examples show how to use
java.util.prefs.AbstractPreferences.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MarginallyCleverPreferences.java From Robot-Overlord-App with GNU General Public License v2.0 | 6 votes |
/** * http://stackoverflow.com/a/24249709 * * @param name * @return */ @NotNull @Override protected AbstractPreferences childSpi(@NotNull String name) { AbstractPreferences childPreferenceNode = (AbstractPreferences) children.get(name); boolean isChildRemoved = false; if (childPreferenceNode != null) { try { isChildRemoved = getIsRemoved(childPreferenceNode); } catch (ReflectiveOperationException e) { Log.error( e.getMessage() ); } } if (childPreferenceNode == null || isChildRemoved) { final AbstractPreferences castedPreferences = new MarginallyCleverPreferences(this, name); childPreferenceNode = castedPreferences; children.put(name, childPreferenceNode); } return childPreferenceNode; }
Example #2
Source File: MarginallyCleverPreferences.java From Robot-Overlord-App with GNU General Public License v2.0 | 6 votes |
/** * http://stackoverflow.com/a/24249709 */ @NotNull @Override protected AbstractPreferences childSpi(@NotNull String name) { AbstractPreferences childPreferenceNode = (AbstractPreferences) children.get(name); boolean isChildRemoved = false; if (childPreferenceNode != null) { try { isChildRemoved = getIsRemoved(childPreferenceNode); } catch (ReflectiveOperationException e) { Log.error( e.getMessage() ); } } if (childPreferenceNode == null || isChildRemoved) { final AbstractPreferences castedPreferences = new MarginallyCleverPreferences(this, name); childPreferenceNode = castedPreferences; children.put(name, childPreferenceNode); } return childPreferenceNode; }
Example #3
Source File: CodeStylePreferences.java From netbeans with Apache License 2.0 | 6 votes |
@Override protected AbstractPreferences childSpi(String name) { if (prefs == null) { prefs = new HashMap<String, AbstractPreferences>(3); } AbstractPreferences p = prefs.get(name); if (p == null) { // root.cacheMisses++; Preferences r = delegate.node(name); p = new CachingPreferences(this, name, r); // ((CachingPreferences)p).root = this.root; prefs.put(name, p); // } else { // root.cacheHits++; } return p; }
Example #4
Source File: XMLHintPreferences.java From netbeans with Apache License 2.0 | 6 votes |
@Override protected AbstractPreferences childSpi(String name) { String escapedName = escape(name); NodeList nl = node.getElementsByTagName("node"); for (int i = 0; i < nl.getLength(); i++) { Node n = nl.item(i); if (n instanceof Element && escapedName.equals(((Element) n).getAttribute("name"))) { return new XMLHintPreferences(driver, this, name, (Element) n, node, true); } } Element nue = node.getOwnerDocument().createElement("node"); nue.setAttribute("name", escapedName); return new XMLHintPreferences(driver, this, name, nue, node, false); }
Example #5
Source File: BinaryPreferences.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
protected AbstractPreferences childSpi( final String name ) { if ( name == null || name.length() == 0 ) { throw new IllegalArgumentException(); } return new BinaryPreferences( this, name ); }
Example #6
Source File: PropertyResourceConfigurerTests.java From java-technology-stack with MIT License | 5 votes |
@Override protected AbstractPreferences childSpi(String name) { AbstractPreferences child = children.get(name); if (child == null) { child = new MockPreferences(this, name); children.put(name, child); } return child; }
Example #7
Source File: InheritedPreferences.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected AbstractPreferences childSpi(String name) { Preferences storedNode = stored != null ? stored.node(name) : null; if (storedNode != null) { return new InheritedPreferences(null, storedNode); } else { return null; } }
Example #8
Source File: AdjustConfigurationPanel.java From netbeans with Apache License 2.0 | 5 votes |
protected AbstractPreferences childSpi(String name) { ModifiedPreferences result = subNodes.get(name); if (result == null) { subNodes.put(name, result = new ModifiedPreferences(this, name)); } return result; }
Example #9
Source File: AuxiliaryConfigBasedPreferencesProvider.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected AbstractPreferences childSpi(String name) { synchronized (AuxiliaryConfigBasedPreferencesProvider.this) { String nuePath = path + "/" + name; if (!getChildrenNames().contains(name)) { AuxiliaryConfigBasedPreferencesProvider.this.createdNodes.add(nuePath); } return new AuxiliaryConfigBasedPreferences(this, name, nuePath); } }
Example #10
Source File: AuxiliaryConfigBasedPreferencesProvider.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected AbstractPreferences getChild(final String nodeName) throws BackingStoreException { try { return ProjectManager.mutex(false, project).readAccess(new ExceptionAction<AbstractPreferences>() { public AbstractPreferences run() throws BackingStoreException { return AuxiliaryConfigBasedPreferences.super.getChild(nodeName); } }); } catch (MutexException ex) { throw (BackingStoreException) ex.getException(); } }
Example #11
Source File: InheritedPreferences.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected AbstractPreferences childSpi(String name) { Preferences storedNode = stored != null ? stored.node(name) : null; if (storedNode != null) { return new InheritedPreferences(null, storedNode); } else { return null; } }
Example #12
Source File: ProjectAwareCodeStylePreferences.java From netbeans with Apache License 2.0 | 5 votes |
public Preferences getPreferences() { synchronized (this) { Preferences prefs = useProject ? projectPrefs : globalPrefs; // to support tests that don't use editor.mimelookup.impl return prefs == null ? AbstractPreferences.systemRoot() : prefs; } }
Example #13
Source File: ProxyPreferences.java From netbeans with Apache License 2.0 | 5 votes |
private void firePrefChange(String key, String newValue) { try { Method m = AbstractPreferences.class.getDeclaredMethod("enqueuePreferenceChangeEvent", String.class, String.class); //NOI18N m.setAccessible(true); m.invoke(this, key, newValue); } catch (Exception e) { LOG.log(Level.WARNING, null, e); } }
Example #14
Source File: PropertyResourceConfigurerTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Override protected AbstractPreferences childSpi(String name) { AbstractPreferences child = children.get(name); if (child == null) { child = new MockPreferences(this, name); children.put(name, child); } return child; }
Example #15
Source File: MountedPreferences.java From knopflerfish.org with BSD 3-Clause "New" or "Revised" License | 5 votes |
protected AbstractPreferences childSpi(String name) { synchronized(mounts) { Preferences mount = mounts.get(name); if(mount != null) { return new MountedPreferences(this, mount, name); } if(target != null) { return new MountedPreferences(this, target.node(name), name); } else { MountedPreferences m = new MountedPreferences(this, null, name); mount(m, name); return m; } } }
Example #16
Source File: OSGiUsersPreferences.java From knopflerfish.org with BSD 3-Clause "New" or "Revised" License | 5 votes |
protected AbstractPreferences childSpi(String name) { synchronized(children) { OSGiPreferences child = children.get(name); if(child == null) { org.osgi.service.prefs.Preferences node = prefsService.getUserPreferences(name); child = new OSGiPreferences(this, node, name); children.put(name, child); } return child; } }
Example #17
Source File: MarginallyCleverPreferences.java From Robot-Overlord-App with GNU General Public License v2.0 | 5 votes |
/** * FIXME - Pure hack to get around erasure. * * @return true if removed * @throws ReflectiveOperationException */ private boolean getIsRemoved(AbstractPreferences abstractPreference) throws ReflectiveOperationException { Log.message( abstractPreference.toString() ); final Method declaredMethod = AbstractPreferences.class.getDeclaredMethod("isRemoved"); declaredMethod.setAccessible(true); Object isRemoved = declaredMethod.invoke(abstractPreference, new Object[]{null}); return (boolean) isRemoved; }
Example #18
Source File: MarginallyCleverPreferences.java From Robot-Overlord-App with GNU General Public License v2.0 | 5 votes |
/** * FIXME - Pure hack to get around erasure. * * @param abstractPreference * @return * @throws ReflectiveOperationException */ private boolean getIsRemoved(AbstractPreferences abstractPreference) throws ReflectiveOperationException { Log.message( abstractPreference.toString() ); final Method declaredMethod = AbstractPreferences.class.getDeclaredMethod("isRemoved"); declaredMethod.setAccessible(true); Object isRemoved = declaredMethod.invoke(abstractPreference, new Object[]{null}); return (boolean) isRemoved; }
Example #19
Source File: ProxyPreferences.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected AbstractPreferences childSpi(String name) { // Preferences [] nueDelegates = new Preferences[delegates.length]; // for(int i = 0; i < delegates.length; i++) { // nueDelegates[i] = delegates[i].node(name); // } // return new ProxyPreferences(name, this, nueDelegates); throw new UnsupportedOperationException("Not supported yet."); //NOI18N }
Example #20
Source File: PropertyResourceConfigurerTests.java From spring-analysis-note with MIT License | 5 votes |
@Override protected AbstractPreferences childSpi(String name) { AbstractPreferences child = children.get(name); if (child == null) { child = new MockPreferences(this, name); children.put(name, child); } return child; }
Example #21
Source File: HintsPanelLogic.java From netbeans with Apache License 2.0 | 4 votes |
@Override protected AbstractPreferences childSpi(String name) { throw new UnsupportedOperationException("Not supported yet."); }
Example #22
Source File: PropertyResourceConfigurerTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
protected MockPreferences(AbstractPreferences parent, String name) { super(parent, name); }
Example #23
Source File: CategorySupport.java From netbeans with Apache License 2.0 | 4 votes |
protected AbstractPreferences childSpi(String name) { throw new UnsupportedOperationException("Not supported yet."); }
Example #24
Source File: FmtOptions.java From netbeans with Apache License 2.0 | 4 votes |
@Override protected AbstractPreferences childSpi(String name) { throw new UnsupportedOperationException("Not supported yet."); }
Example #25
Source File: FileSystemPreferences.java From phoebus with Eclipse Public License 1.0 | 4 votes |
@Override protected AbstractPreferences childSpi(String name) { return new FileSystemPreferences(this, name); }
Example #26
Source File: HintsPanelLogic.java From netbeans with Apache License 2.0 | 4 votes |
@Override protected AbstractPreferences childSpi(String name) { throw new UnsupportedOperationException("Not supported yet."); }
Example #27
Source File: FileBasedPreferences.java From exhibitor with Apache License 2.0 | 4 votes |
@Override protected AbstractPreferences childSpi(String name) { throw new UnsupportedOperationException(); }
Example #28
Source File: MountedPreferences.java From knopflerfish.org with BSD 3-Clause "New" or "Revised" License | 4 votes |
public MountedPreferences(AbstractPreferences parent, Preferences target, String targetName) { super(parent, targetName); this.target = target; }
Example #29
Source File: HintTest.java From netbeans with Apache License 2.0 | 4 votes |
protected AbstractPreferences childSpi(String name) { return new TempPreferences(this, name); }
Example #30
Source File: ReplToolTesting.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Override protected AbstractPreferences childSpi(String name) { return nodes.computeIfAbsent(name, n -> new MemoryPreferences(this, name)); }