com.japisoft.xmlpad.helper
Class HelperManager

java.lang.Object
  extended bycom.japisoft.xmlpad.helper.HelperManager

public class HelperManager
extends java.lang.Object

Here the main class for activating an helper. An helper will provide a content assistant for special key or caracters sequence

Version:
1.0
Author:
JAPISoft

Constructor Summary
HelperManager(XMLContainer container)
           
 
Method Summary
 boolean activateContentAssistant(SimpleNode currentNode, java.lang.String title, boolean insertBefore, int offset, java.lang.String activatorString)
           
 void addHelperHandler(AbstractHelperHandler handler)
          Add an handler managing a content assistant part
 void dispose()
           
 AbstractHelperHandler getHelperHandler(int index)
           
 AbstractHelperHandler getHelperHandler(java.lang.String name)
           
 int getHelperHandlerCount()
           
 boolean isEnabled()
           
 void removeHelperHandler(AbstractHelperHandler handler)
          Remove an handler managing a content assistant part
 boolean removeHelperHandler(java.lang.String name)
          Remove an helper handler for a name
 void resetHandlers(java.util.ArrayList handlers, boolean appendMode)
          Update all the handlers
 void setEnabled(boolean enabled)
          Activate or disable the helper.
 void setEnabled(java.lang.String name, boolean enabled)
          Disabled/Enabled an handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelperManager

public HelperManager(XMLContainer container)
Method Detail

dispose

public void dispose()

activateContentAssistant

public boolean activateContentAssistant(SimpleNode currentNode,
                                        java.lang.String title,
                                        boolean insertBefore,
                                        int offset,
                                        java.lang.String activatorString)
Parameters:
currentNode - the current node
title - a Title for the assistant
insertBefore - true if the added part must be inserted before. This is useful when activating an helper by a shortkey
offset - The current location
activatorString - The element added by the user like '<'
Returns:
true if a content assistant is shown

setEnabled

public void setEnabled(boolean enabled)
Activate or disable the helper. It means you can stop with this property all the content assistant

Parameters:
enabled - false for disabling the helper

isEnabled

public boolean isEnabled()
Returns:
the status of the helper manager. Theorically it should return true most of the time

resetHandlers

public void resetHandlers(java.util.ArrayList handlers,
                          boolean appendMode)
Update all the handlers

Parameters:
handlers - List of helpers for the content assistant
appendMode - Decide to maintain the current assistants or not

addHelperHandler

public void addHelperHandler(AbstractHelperHandler handler)
Add an handler managing a content assistant part


removeHelperHandler

public void removeHelperHandler(AbstractHelperHandler handler)
Remove an handler managing a content assistant part


removeHelperHandler

public boolean removeHelperHandler(java.lang.String name)
Remove an helper handler for a name

Returns:
true if the operation is a success

getHelperHandlerCount

public int getHelperHandlerCount()
Returns:
the available helper handler

getHelperHandler

public AbstractHelperHandler getHelperHandler(int index)
Returns:
the available helper handler by index starting from 0

getHelperHandler

public AbstractHelperHandler getHelperHandler(java.lang.String name)
Returns:
the available helper handler by name

setEnabled

public void setEnabled(java.lang.String name,
                       boolean enabled)
Disabled/Enabled an handler



Copyright © 2006 JAPISoft. All Rights Reserved.