コード例 #1
0
ファイル: TextContent.java プロジェクト: adamhoward/isis
  public void insert(final CursorPosition cursorAt, final String characters) {
    Assert.assertNotNull(cursorAt);

    final BlockToLineMapping block = findBlockFor(cursorAt.getLine());

    Assert.assertNotNull("failed to get block for line " + cursorAt.getLine(), block);

    block.textBlock.insert(block.line, cursorAt.getCharacter(), characters);
  }
コード例 #2
0
 @Programmatic
 @Override
 public <T> List<T> allMatches(final Class<T> type, final T pattern, long... range) {
   Assert.assertTrue(
       "pattern not compatible with type", type.isAssignableFrom(pattern.getClass()));
   return allMatches(new QueryFindByPattern<T>(type, pattern, range));
 }
コード例 #3
0
  @Override
  public void build(final View view, final Axes axes) {
    Assert.assertEquals(view.getView(), view);

    final ActionContent actionContent = ((ActionContent) view.getContent());
    if (view.getSubviews().length == 0) {
      initialBuild(view, actionContent);
    } else {
      updateBuild(view, actionContent);
    }
  }
コード例 #4
0
  @Override
  public void build(final View view, final Axes axes) {
    Assert.assertEquals("ensure the view is the complete decorated view", view.getView(), view);

    final Content content = view.getContent();
    final ObjectAdapter object = ((ObjectContent) content).getObject();

    LOG.debug("build view " + view + " for " + object);

    final ObjectSpecification spec = object.getSpecification();
    final Filter<ObjectAssociation> filter =
        ObjectAssociationFilters.dynamicallyVisible(
            IsisContext.getAuthenticationSession(), object, where);
    final List<ObjectAssociation> flds = spec.getAssociations(filter);

    if (view.getSubviews().length == 0) {
      initialBuild(view, axes, object, flds);
    } else {
      updateBuild(view, axes, object, flds);
    }
  }
コード例 #5
0
  private ObjectSpecification loadSpecificationForSubstitutedClass(final Class<?> type) {
    Assert.assertNotNull(type);
    final String typeName = type.getName();

    final SpecificationCacheDefault specificationCache = getCache();
    synchronized (specificationCache) {
      final ObjectSpecification spec = specificationCache.get(typeName);
      if (spec != null) {
        return spec;
      }
      final ObjectSpecification specification = createSpecification(type);
      if (specification == null) {
        throw new IsisException("Failed to create specification for class " + typeName);
      }

      // put into the cache prior to introspecting, to prevent
      // infinite loops
      specificationCache.cache(typeName, specification);

      introspectIfRequired(specification);

      return specification;
    }
  }
コード例 #6
0
ファイル: ViewRequirement.java プロジェクト: coffeefoam/isis
 public ViewRequirement(final Content content, int status) {
   Assert.assertNotNull(content);
   this.content = content;
   this.status = status;
   status = CLOSED;
 }