use of com.webobjects.appserver._private.WOConstantValueAssociation in project wonder-slim by undur.
the class AjaxToggleLink method processAssociations.
protected static NSDictionary<String, WOAssociation> processAssociations(NSDictionary<String, WOAssociation> associations) {
NSMutableDictionary<String, WOAssociation> mutableAssociations = (NSMutableDictionary<String, WOAssociation>) associations;
mutableAssociations.setObjectForKey(new WOConstantValueAssociation("javascript:void(0)"), "href");
return mutableAssociations;
}
use of com.webobjects.appserver._private.WOConstantValueAssociation in project wonder-slim by undur.
the class NotTagProcessor method createDeclaration.
@Override
public WODeclaration createDeclaration(String elementName, String elementType, NSMutableDictionary associations) {
String newElementType = "ERXWOConditional";
if (associations.objectForKey("negate") != null) {
throw new IllegalArgumentException("You already specified a binding for 'negate' of " + associations.objectForKey("negate") + " on a wo:not.");
}
associations.setObjectForKey(new WOConstantValueAssociation(Boolean.TRUE), "negate");
return super.createDeclaration(elementName, newElementType, associations);
}
use of com.webobjects.appserver._private.WOConstantValueAssociation in project wonder-slim by undur.
the class WOHelperFunctionParser method prettyDeclaration.
protected String prettyDeclaration(WODeclaration declaration) {
StringBuilder declarationStr = new StringBuilder();
if (declaration == null) {
declarationStr.append("[none]");
} else {
declarationStr.append("Component Type = " + declaration.type());
declarationStr.append(", Bindings = { ");
Enumeration keyEnum = declaration.associations().keyEnumerator();
while (keyEnum.hasMoreElements()) {
String key = (String) keyEnum.nextElement();
Object assoc = declaration.associations().objectForKey(key);
if (assoc instanceof WOKeyValueAssociation) {
declarationStr.append(key + "=" + ((WOKeyValueAssociation) assoc).keyPath());
} else if (assoc instanceof WOConstantValueAssociation) {
declarationStr.append(key + "='" + ((WOConstantValueAssociation) assoc).valueInComponent(null) + "'");
} else {
declarationStr.append(key + "=" + assoc);
}
if (keyEnum.hasMoreElements()) {
declarationStr.append(", ");
}
}
declarationStr.append(" }");
}
return declarationStr.toString();
}
use of com.webobjects.appserver._private.WOConstantValueAssociation in project wonder-slim by undur.
the class AjaxTabbedPanel method findTabs.
/**
* Looks through the child components to locate the AjaxTabbedPanelTabs that are controlled by this panel.
* Tabs without an explicit id attributed are assigned a calculated one.
*
* @param template the graph of elements passed to the constructor.
*/
private void findTabs(WODynamicGroup template) {
if (template == null || template.childrenElements() == null)
return;
NSArray children = template.childrenElements();
for (int i = 0; i < children.count(); i++) {
WOElement child = (WOElement) children.objectAtIndex(i);
if (child instanceof AjaxTabbedPanelTab) {
AjaxTabbedPanelTab childTab = (AjaxTabbedPanelTab) child;
// The tabs need to have an id attribute so we assign one if needed
if (childTab.id() == null) {
childTab.setParentId(id);
childTab.setTabNumber(new WOConstantValueAssociation("_pane_" + tabs.count()));
}
tabs.addObject(childTab);
} else if (child instanceof WODynamicGroup) {
findTabs((WODynamicGroup) child);
}
}
}
use of com.webobjects.appserver._private.WOConstantValueAssociation in project wonder-slim by undur.
the class AjaxInPlaceEditTemplate method processAssociations.
protected static NSDictionary processAssociations(NSDictionary associations) {
NSMutableDictionary mutableAssociations = (NSMutableDictionary) associations;
mutableAssociations.setObjectForKey(new WOConstantValueAssociation("edit"), "templateName");
return mutableAssociations;
}
Aggregations