bibliothek.gui.dock.extension.css.CssNode Maven / Gradle / Ivy
The newest version!
/*
* Bibliothek - DockingFrames
* Library built on Java/Swing, allows the user to "drag and drop"
* panels containing any Swing-Component the developer likes to add.
*
* Copyright (C) 2012 Benjamin Sigg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Benjamin Sigg
* [email protected]
* CH - Switzerland
*/
package bibliothek.gui.dock.extension.css;
/**
* A part of a {@link CssPath}. A {@link CssNode} is mutable, its parent
* {@link CssPath}s should monitor it with a {@link CssNodeListener}.
* In general nodes have to be optimized for use with attached {@link CssNodeListener}s.
* @author Benjamin Sigg
*/
public interface CssNode {
/**
* Gets the name of this node.
* @return the name, not null
*/
public String getName();
/**
* Gets the identifier of this node.
* @return the identifier, may be null
*/
public String getIdentifier();
/**
* Tells whether this node has the class className
* @param className the name of a class
* @return whether this node has className
*/
public boolean hasClass( String className );
/**
* Tells whether this node has the pseudo-class pseudoClass
.
* @param pseudoClass the name of a pseudo-class
* @return whether this node has pseudoClass
*/
public boolean hasPseudoClass( String className );
/**
* Gets a property of this element that can be used by the {@link CssSelector}
* to filter items. The node is completely free when choosing which properties
* exist and what values they have. The properties of {@link CssItem#getProperty(String)} may
* or may not have a representation as property.
* @param key the key of a property
* @return the value of the property or null
if not present
*/
public String getProperty( String key );
/**
* Adds the observer listener
to this node.
* @param listener the new listener, not null
*/
public void addNodeListener( CssNodeListener listener );
/**
* Removes the observer listener
from this node.
* @param listener the listener to remove
*/
public void removeNodeListener( CssNodeListener listener );
}