Search in sources :

Example 6 with IResource

use of org.whole.lang.resources.IResource in project whole by wholeplatform.

the class XsdResourceFactory method createResource.

@Override
public IResource createResource(String uri) {
    Resource resource = (Resource) super.createResource(uri);
    resource.setNamespace(SchemaUtils.calculateNamespace(uri));
    resource.setName(SchemaUtils.calculateName(uri));
    resource.setVersion("1.0");
    resource.setResourcePersistenceKit(XsdPersistenceKit.instance());
    return resource;
}
Also used : Resource(org.whole.lang.resources.Resource) IResource(org.whole.lang.resources.IResource)

Example 7 with IResource

use of org.whole.lang.resources.IResource in project whole by wholeplatform.

the class XsdRegistry method schemas.

public Collection<Schema> schemas() {
    Collection<IResource> resources = getResources(true, new Comparator<IResource>() {

        public int compare(IResource s1, IResource s2) {
            return s1.getNamespace().compareTo(s2.getNamespace());
        }
    });
    List<Schema> schemas = new ArrayList<Schema>(resources.size());
    for (IResource resource : resources) schemas.add(resource.<Schema>getEntity());
    return Collections.unmodifiableList(schemas);
}
Also used : Schema(org.whole.lang.xsd.model.Schema) ArrayList(java.util.ArrayList) IResource(org.whole.lang.resources.IResource)

Aggregations

IResource (org.whole.lang.resources.IResource)7 Resource (org.whole.lang.resources.Resource)4 ArrayList (java.util.ArrayList)2 GuardedAction (org.whole.lang.actions.model.GuardedAction)2 LanguageActionFactory (org.whole.lang.actions.model.LanguageActionFactory)2 URI (org.whole.lang.actions.model.URI)2 HashMap (java.util.HashMap)1 ESelectionService (org.eclipse.e4.ui.workbench.modeling.ESelectionService)1 IAction (org.eclipse.jface.action.IAction)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IBindingManager (org.whole.lang.bindings.IBindingManager)1 WholeIllegalArgumentException (org.whole.lang.exceptions.WholeIllegalArgumentException)1 CompoundResourceRegistry (org.whole.lang.resources.CompoundResourceRegistry)1 IUpdatableAction (org.whole.lang.ui.actions.IUpdatableAction)1 Schema (org.whole.lang.xsd.model.Schema)1