public class ResourcesContainer
extends AbstractContainer
Container
implementation representing a resource ResourceOrigin
.
Uses the Resource
as itemId.
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_PROPERTY_ID |
static String |
DIRECTORY_PROPERTY_ID |
static String |
EDITABLE_PROPERTY_ID |
static String |
FORMAT_PROPERTY_ID |
static String |
ORIGIN_NAME_PROPERTY_ID |
static String |
OVERRIDING_PROPERTY_ID |
static Object |
RESOURCE_NAME |
static String |
RESOURCE_PATH |
static String |
ROOT_DIRECTORY |
Constructor and Description |
---|
ResourcesContainer(info.magnolia.resourceloader.ResourceOrigin origin,
List<String> moduleNames) |
Modifier and Type | Method and Description |
---|---|
boolean |
addContainerProperty(Object propertyId,
Class<?> type,
Object defaultValue) |
Object |
addItem() |
Item |
addItem(Object itemId) |
Object |
addItemAfter(Object previousItemId) |
Item |
addItemAfter(Object previousItemId,
Object newItemId) |
Object |
addItemAt(int index) |
Item |
addItemAt(int index,
Object newItemId) |
void |
addItemSetChangeListener(ItemSetChangeListener listener) |
void |
addListener(ItemSetChangeListener listener) |
boolean |
areChildrenAllowed(Object itemId) |
boolean |
containsId(Object itemId) |
protected void |
doCollapse(Object itemId) |
protected void |
doExpand(Object itemId) |
Object |
firstItemId() |
List<String> |
getChildren(Object itemId) |
<any> |
getContainerProperty(Object itemId,
Object propertyId) |
Collection<String> |
getContainerPropertyIds() |
Object |
getIdByIndex(int index) |
Item |
getItem(Object itemId) |
Collection<String> |
getItemIds() |
List<String> |
getItemIds(int startIndex,
int numberOfItems) |
String |
getParent(Object itemId) |
Class<?> |
getType(Object propertyId) |
boolean |
hasChildren(Object itemId) |
int |
indexOfId(Object itemId) |
boolean |
isCollapsed(Object itemId) |
boolean |
isFirstId(Object itemId) |
boolean |
isLastId(Object itemId) |
protected static boolean |
isOverriding(info.magnolia.resourceloader.layered.LayeredResource resource) |
boolean |
isRoot(Object itemId) |
Object |
lastItemId() |
static Item |
newItem(info.magnolia.resourceloader.Resource resource) |
Object |
nextItemId(Object itemId) |
Object |
prevItemId(Object itemId) |
void |
refresh() |
boolean |
removeAllItems() |
boolean |
removeContainerProperty(Object propertyId) |
boolean |
removeItem(Object itemId) |
void |
removeItemSetChangeListener(ItemSetChangeListener listener) |
void |
removeListener(ItemSetChangeListener listener) |
Collection<String> |
rootItemIds() |
boolean |
setChildrenAllowed(Object itemId,
boolean areChildrenAllowed) |
void |
setClasspathResourcesFiltered(boolean classpathResourcesFiltered)
Sets whether or not classpath resources should be tentatively filtered based on their registered magnolia modules.
|
void |
setCollapsed(Object itemId,
boolean collapsed) |
boolean |
setParent(Object itemId,
Object newParentId) |
protected void |
showRootsOnly() |
int |
size() |
public static final Object RESOURCE_NAME
public static final String ORIGIN_NAME_PROPERTY_ID
public static final String CONTENT_PROPERTY_ID
public static final String OVERRIDING_PROPERTY_ID
public static final String RESOURCE_PATH
public static final String FORMAT_PROPERTY_ID
public static final String DIRECTORY_PROPERTY_ID
public static final String EDITABLE_PROPERTY_ID
public static final String ROOT_DIRECTORY
public void setClasspathResourcesFiltered(boolean classpathResourcesFiltered)
classpathResourcesFiltered
- setting this to true
only shows classpath resources whose top-level directory is a registered magnolia module;
setting this to false
shows classpath resources from all classpathUrls (still pre-filtered in ClasspathResourceOrigin).ClasspathResourceOrigin.excludedPackages()
public Item getItem(Object itemId)
public static Item newItem(info.magnolia.resourceloader.Resource resource)
protected static boolean isOverriding(info.magnolia.resourceloader.layered.LayeredResource resource)
public Collection<String> getContainerPropertyIds()
public Collection<String> getItemIds()
public boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException
UnsupportedOperationException
public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException
UnsupportedOperationException
public int size()
public boolean containsId(Object itemId)
public Object firstItemId()
public Object lastItemId()
public boolean isFirstId(Object itemId)
public boolean isLastId(Object itemId)
public int indexOfId(Object itemId)
public Object getIdByIndex(int index)
public Collection<String> rootItemIds()
public boolean areChildrenAllowed(Object itemId)
public boolean isRoot(Object itemId)
public boolean hasChildren(Object itemId)
public void setCollapsed(Object itemId, boolean collapsed)
protected void doExpand(Object itemId)
protected void doCollapse(Object itemId)
public boolean isCollapsed(Object itemId)
protected void showRootsOnly()
public void refresh()
public Item addItem(Object itemId) throws UnsupportedOperationException
UnsupportedOperationException
public Object addItem() throws UnsupportedOperationException
UnsupportedOperationException
public boolean removeItem(Object itemId) throws UnsupportedOperationException
UnsupportedOperationException
public boolean removeAllItems() throws UnsupportedOperationException
UnsupportedOperationException
public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException
UnsupportedOperationException
public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException
UnsupportedOperationException
public Object addItemAt(int index) throws UnsupportedOperationException
UnsupportedOperationException
public Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException
UnsupportedOperationException
public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException
UnsupportedOperationException
public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException
UnsupportedOperationException
public void addItemSetChangeListener(ItemSetChangeListener listener)
public void addListener(ItemSetChangeListener listener)
public void removeItemSetChangeListener(ItemSetChangeListener listener)
public void removeListener(ItemSetChangeListener listener)
Copyright © 2015 Magnolia International Ltd.. All rights reserved.