Compiere 3.1

org.compiere.util
Class CContext

java.lang.Object
  extended by org.compiere.util.Ctx
      extended by org.compiere.util.CContext
All Implemented Interfaces:
Serializable, Map<String,String>, Evaluatee
Direct Known Subclasses:
GWTServerContext

public class CContext
extends Ctx

Typed Context

Version:
$Id$
Author:
Jorg Janke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.compiere.util.Ctx
log, m_map
 
Constructor Summary
CContext()
          Context
CContext(Map<String,String> map)
          Context
CContext(Set<Map.Entry<String,String>> set)
          Context
CContext(String stringRepresentation)
          Context
 
Method Summary
 void addWindow(int windowNo, Map<String,String> map)
          Add Window Context
 void clear()
          Clear values
 boolean containsKey(String key)
          Contains Key
 boolean containsValue(Object value)
          Contains Value
 Set<Map.Entry<String,String>> entrySet()
          Entry Set of all windows
 String getContext(int windowNo, String context, boolean onlyWindow)
          Get Value of Context for Window.
 String[] getEntireContext()
          Get Entire Context as String Array
protected  Map<String,String> getMap()
          Entry Set of all windows
 Map<String,String> getMap(int windowNo)
          Get Map with spaces as null
 Map<String,String> getMap(int windowNo, boolean convertNullToEmptyString)
          Get Context for Window as Map
 boolean isEmpty()
          Is Empty
 Set<String> keySet()
          Key Set
 void removeAllWindows()
           
 void removeWindow(int windowNo)
          Remove context for Window (i.e. delete it)
 void setContext(int windowNo, Map<String,String> addContext)
          Add Map elements to context
 void setContext(int windowNo, String context, String value)
          Set Context for Window to Value
 Collection<String> values()
          Values
 
Methods inherited from class org.compiere.util.Ctx
containsKey, copyContext, deletePreference, get_ValueAsString, get, getAD_Client_ID, getAD_Client_ID, getAD_Org_ID, getAD_Org_ID, getAD_Org_ID, getAD_Role_ID, getAD_User_ID, getContext, getContext, getContext, getContextAsInt, getContextAsInt, getContextAsInt, getContextAsTime, getContextAsTime, getCtx, getPrinterName, getStdPrecision, getUITheme, isActive, isAutoCommit, isAutoCommit, isAutoNew, isAutoNew, isProcessed, isProcessing, isShowAdvanced, isSOTrx, isSOTrx, load, put, putAll, remove, setAD_Client_ID, setAD_Org_ID, setAD_Role_ID, setAD_User_ID, setAutoCommit, setAutoCommit, setAutoNew, setAutoNew, setContext, setContext, setContext, setContext, setContext, setContext, setContext, setContext, setIsSOTrx, setIsSOTrx, setPrinterName, setShowAdvanced, setStdPrecision, setUITheme, size, toString, toStringShort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

CContext

public CContext()
Context


CContext

public CContext(Map<String,String> map)
Context

Parameters:
map - map

CContext

public CContext(String stringRepresentation)
Context

Parameters:
stringRepresentation -

CContext

public CContext(Set<Map.Entry<String,String>> set)
Context

Parameters:
set - set of Map entries with key and value
Method Detail

getMap

public Map<String,String> getMap(int windowNo)
Get Map with spaces as null

Overrides:
getMap in class Ctx
Parameters:
windowNo - window no
Returns:
map

getMap

public Map<String,String> getMap(int windowNo,
                                 boolean convertNullToEmptyString)
Get Context for Window as Map

Overrides:
getMap in class Ctx
Parameters:
windowNo - window
Returns:
map

removeWindow

public void removeWindow(int windowNo)
Remove context for Window (i.e. delete it)

Overrides:
removeWindow in class Ctx
Parameters:
WindowNo - window

removeAllWindows

public void removeAllWindows()

addWindow

public void addWindow(int windowNo,
                      Map<String,String> map)
Add Window Context

Parameters:
windowNo - window
map - map

clear

public void clear()
Clear values

Specified by:
clear in interface Map<String,String>
Overrides:
clear in class Ctx
See Also:
Map.clear()

getEntireContext

public String[] getEntireContext()
Get Entire Context as String Array

Overrides:
getEntireContext in class Ctx
Returns:
string array

containsKey

public boolean containsKey(String key)
Contains Key

Parameters:
key - key
Returns:
true if contains key

containsValue

public boolean containsValue(Object value)
Contains Value

Specified by:
containsValue in interface Map<String,String>
Overrides:
containsValue in class Ctx
Parameters:
value -
Returns:

getMap

protected Map<String,String> getMap()
Entry Set of all windows

Overrides:
getMap in class Ctx
Returns:
entry set

entrySet

public Set<Map.Entry<String,String>> entrySet()
Entry Set of all windows

Specified by:
entrySet in interface Map<String,String>
Overrides:
entrySet in class Ctx
Returns:
entry set

isEmpty

public boolean isEmpty()
Is Empty

Specified by:
isEmpty in interface Map<String,String>
Overrides:
isEmpty in class Ctx
Returns:
true if all empty

keySet

public Set<String> keySet()
Key Set

Specified by:
keySet in interface Map<String,String>
Overrides:
keySet in class Ctx
Returns:

values

public Collection<String> values()
Values

Specified by:
values in interface Map<String,String>
Overrides:
values in class Ctx
Returns:
all values

setContext

public void setContext(int windowNo,
                       String context,
                       String value)
Set Context for Window to Value

Overrides:
setContext in class Ctx
Parameters:
windowNo - window no
context - context key
value - context value

getContext

public String getContext(int windowNo,
                         String context,
                         boolean onlyWindow)
Get Value of Context for Window. if not found global context if available and enabled

Overrides:
getContext in class Ctx
Parameters:
windowNo - window
context - context key
onlyWindow - if true, no defaults are used unless explicitly asked for
Returns:
value or ""

setContext

public void setContext(int windowNo,
                       Map<String,String> addContext)
Add Map elements to context

Overrides:
setContext in class Ctx
Parameters:
WindowNo - window
addContext - new context

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.