com.ephox.editlive.ephoxaction.filter
Class EnableInTagFilter

java.lang.Object
  extended by com.ephox.editlive.ephoxaction.filter.EnableInTagFilter
All Implemented Interfaces:
EventListener, EnabledFilter

public class EnableInTagFilter
extends Object
implements EnabledFilter, EventListener

Automatically enables and disables when the cursor is inside (or has selected) the given tag.

NOTE: Must be manually registered as a listener on EventBroadcaster.

Since:
7.5

Constructor Summary
EnableInTagFilter(String tagName)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a property change listener which must be notified when the enabled state of this filter changes.
 String getTagName()
           
 boolean isEnabled()
          Calculate whether or not this filter will allow the action to be enabled.
 void raiseEvent(TextEvent event)
          Method used to listen for events raised by EditLive!.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnableInTagFilter

public EnableInTagFilter(String tagName)
Method Detail

getTagName

public String getTagName()

isEnabled

public boolean isEnabled()
Description copied from interface: EnabledFilter
Calculate whether or not this filter will allow the action to be enabled. If any EnabledFilter for an action returns false the action is disabled.

Specified by:
isEnabled in interface EnabledFilter
Returns:
true if this filter allows the action to be enabled, otherwise returns false.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: EnabledFilter
Add a property change listener which must be notified when the enabled state of this filter changes.

Specified by:
addPropertyChangeListener in interface EnabledFilter
Parameters:
listener - the listener to add.

raiseEvent

public void raiseEvent(TextEvent event)
Description copied from interface: EventListener
Method used to listen for events raised by EditLive!.

Specified by:
raiseEvent in interface EventListener
Parameters:
event - TextEvent to be parsed.

Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved.