public class DraggablesAcceptedByDroppable extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
DRAG_NAME_IDENTIFIER |
| Constructor and Description |
|---|
DraggablesAcceptedByDroppable(String... names)
Create a
DraggablesAcceptedByDroppable object |
| Modifier and Type | Method and Description |
|---|---|
void |
addName(String name)
Add a name to the current names
|
boolean |
equals(Object other) |
String |
getId()
Each collection of names has a unique id.
|
String |
getJsAcceptCheckerFunctionName()
A Javascript function is used to check the names of accepted droppables against the
name of a certain draggable.
|
void |
removeName(String name)
Remove a name.
|
void |
renderJsDropAcceptFunction(org.apache.wicket.markup.head.IHeaderResponse response)
Create a JavaScript function that checks the names against the
name of the function's argument.
|
int |
size()
How many names are currently accepted
|
public static final String DRAG_NAME_IDENTIFIER
public DraggablesAcceptedByDroppable(String... names)
DraggablesAcceptedByDroppable objectnames - An Array of names of droppable objects.
Duplicate names are eliminated null values are ignored.public void addName(String name)
name - The name of a droppable object.
Duplicate types are eliminated null values are ignored.public void removeName(String name)
name - The name to be removedpublic int size()
public String getId()
public String getJsAcceptCheckerFunctionName()
public void renderJsDropAcceptFunction(org.apache.wicket.markup.head.IHeaderResponse response)
var someFunctionName = function(candidate) {
var accepted = ['droppableA','droppableB'];
for (var i = 0; i < accepted.length; i++)
if (accepted[i] == jQuery(candidate).attr('dragClass')
return true;
return false;
}
response - Copyright © 2015. All rights reserved.