org.drools.guvnor.client.moduleeditor.drools
Class SuggestionCompletionCache

java.lang.Object
  extended by org.drools.guvnor.client.moduleeditor.drools.SuggestionCompletionCache
All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler, RefreshModuleDataModelEvent.Handler

public class SuggestionCompletionCache
extends Object
implements RefreshModuleDataModelEvent.Handler

This utility cache will maintain a cache of suggestion completion engines, as they are somewhat heavy to load. If it needs to be loaded, then it will load, and then call the appropriate action, and keep it in the cache.


Constructor Summary
SuggestionCompletionCache()
           
 
Method Summary
 void applyFactFilter(String packageName, FactTypeFilter filter, com.google.gwt.user.client.Command done)
          Reloads a package and then applies the given filter.
 SuggestionCompletionEngine getEngineFromCache(String packageName)
           
static SuggestionCompletionCache getInstance()
           
 void loadPackage(String packageName, com.google.gwt.user.client.Command done)
          Gets the last version of SCE for a package and then applies any pre-existing filter to it.
 void onRefreshModuleDataModel(RefreshModuleDataModelEvent refreshModuleDataModelEvent)
           
 void refreshPackage(String packageName, com.google.gwt.user.client.Command done)
          Refresh SCE for a specific package removing any filter and retrieving the last version of it.
 void setEventBus(com.google.gwt.event.shared.EventBus eventBus)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuggestionCompletionCache

public SuggestionCompletionCache()
Method Detail

getInstance

public static SuggestionCompletionCache getInstance()

setEventBus

public void setEventBus(com.google.gwt.event.shared.EventBus eventBus)

onRefreshModuleDataModel

public void onRefreshModuleDataModel(RefreshModuleDataModelEvent refreshModuleDataModelEvent)
Specified by:
onRefreshModuleDataModel in interface RefreshModuleDataModelEvent.Handler

getEngineFromCache

public SuggestionCompletionEngine getEngineFromCache(String packageName)

refreshPackage

public void refreshPackage(String packageName,
                           com.google.gwt.user.client.Command done)
Refresh SCE for a specific package removing any filter and retrieving the last version of it.

Parameters:
packageName -
done -

loadPackage

public void loadPackage(String packageName,
                        com.google.gwt.user.client.Command done)
Gets the last version of SCE for a package and then applies any pre-existing filter to it.

Parameters:
packageName -
done -

applyFactFilter

public void applyFactFilter(String packageName,
                            FactTypeFilter filter,
                            com.google.gwt.user.client.Command done)
Reloads a package and then applies the given filter.

Parameters:
packageName - the package name.
filter - the filter.
done - the command to be executed after the filter is applied.


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.