alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is Forte for Java, Community Edition. The Initial
 * Developer of the Original Code is Sun Microsystems, Inc. Portions
 * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.modules.looks;

import java.util.*;
import javax.swing.event.ChangeListener;
import org.netbeans.modules.looks.RegistryBridge;
import org.netbeans.modules.looks.SelectorListener;

import org.openide.ErrorManager;
import org.openide.util.enum.*;

/** Given name of context searches in the namespace for Looks/LookSelectors.
 * Subclasses may change the algorithm for finding the looks by overriding
 * the {@link #namesFor(java.lang.Object) namesFor( object )} method.
 * 

* Default implementation is based on the inheritance hierarchy (including * interfaces) of the represented object's class. * * @author Petr Hrebejk, Jaroslav Tulach */ public interface NamespaceLookProvider { /** Defines the list of names that should be searched for a given * represented object. *

* Subclasses are allowed to provide different implementation which can * base the naming based on for example public ID * for org.w3c.dom.Document. *

* Default implementation of NamespaceLook uses the inheritance hierarchy * of the represented object to locate the Looks/LookSelectors. I.e. this * method returns Enumeration of names composed of the represented object's * class and it's superclasses and all interfaces (and superinterfaces) * implemented by the represented object's class. *

* The {@link org.netbeans.spi.looks.Selectors#defaultTypes() Looks.defaultTypes()} and * {@link org.netbeans.spi.looks.Selectors#namespaceTypes(java.lang.String) Looks.namespaceTypes(String)} * use the this class. * * @param obj the represented object * @return enumeration of Strings * @see org.netbeans.spi.looks.Selectors#defaultTypes() * @see org.netbeans.spi.looks.Selectors#namespaceTypes(java.lang.String) * @since Made non abstract in version 0.2 */ public Enumeration getNamesForKey( Object obj ); /** Returns key for given object. Make sure you return the same key for * given object during whole lifecycle of the LookSelector. * @param representedObject The represented object we want to find key for. * @return Key for given represented object. Returning null * instead of a key will result in returning empty Enumeration * from the LookSelector. */ public Object getKeyForObject( Object representedObject ); public void addChangeListener( ChangeListener listener ) throws TooManyListenersException; }

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.