Package org.netbeans.modules.php.twig.editor.parsing

Examples of org.netbeans.modules.php.twig.editor.parsing.TwigParserResult$Block


            String pageName = componentClassResolver.resolvePageClassNameToPageName(pageClass);


            final Page page = this.pageCache.get(pageName);

            final Block block = page.getRootElement().getBlock(
                    contribution.getBlockId());

            result.add(block);
        }
        return result;
View Full Code Here


        return overrideSource.hasDisplayBlock(datatype) || masterSource.hasDisplayBlock(datatype);
    }

    public Block getDisplayBlock(String datatype)
    {
        Block result = overrideSource.getDisplayBlock(datatype);

        if (result == null)
            result = masterSource.getDisplayBlock(datatype);

        if (result == null)
View Full Code Here

        return result;
    }

    public Block getEditBlock(String datatype)
    {
        Block result = overrideSource.getEditBlock(datatype);

        if (result == null)
            result = masterSource.getEditBlock(datatype);

        if (result == null)
View Full Code Here

    }

    @Test
    public void false_test_renders_else_block()
    {
        Block block = mockBlock();

        replay();

        If component = new If();
View Full Code Here

    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        TypeCoercer coercer = mockTypeCoercer();
        Block block = mockBlock();
        Logger logger = mockLogger();

        Instantiator ins = newInstantiator(component, model);

        train_getLogger(model, logger);
View Full Code Here

    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        TypeCoercer coercer = mockTypeCoercer();
        Block block1 = mockBlock();
        Block block2 = mockBlock();
        Logger logger = mockLogger();

        train_getLogger(model, logger);

        Instantiator ins = newInstantiator(component, model);
View Full Code Here

    }


    public Block getBlockForColumn()
    {
        Block override = overrides.getOverrideBlock(columnModel.getId() + "Header");

        if (override != null) return override;

        return standardHeader;
    }
View Full Code Here

     * Invoked from subclasses to do the rendering. The subclass controls the naming convention for locating an
     * overriding Block parameter (it is the name of the property possibly suffixed with a value).
     */
    protected Object renderPropertyValue(MarkupWriter writer, String overrideBlockId)
    {
        Block override = overrides.getOverrideBlock(overrideBlockId);

        if (override != null) return override;

        String datatype = model.getDataType();

View Full Code Here

public class TwigStructureScanner implements StructureScanner {

    @Override
    public List<? extends StructureItem> scan( ParserResult info ) {
        TwigParserResult result = (TwigParserResult)info;
        List<TwigParserResult.Block> blocks = new ArrayList<TwigParserResult.Block>();
        List<TwigStructureItem> items = new ArrayList<TwigStructureItem>();
       
        for ( TwigParserResult.Block item : result.getBlocks() ) {
            if ( CharSequenceUtilities.equals( item.getDescription(), "block" ) || CharSequenceUtilities.equals( item.getDescription(), "*inline-block" ) ) {
                blocks.add( item );
            }
        }
       
        boolean isTopLevel = false;
       
        for ( TwigParserResult.Block item : blocks ) {
           
            isTopLevel = true;
           
            for ( TwigParserResult.Block check : blocks ) {
               
                if ( item.getOffset() > check.getOffset() &&
                     item.getOffset() + item.getLength() < check.getOffset() + check.getLength()
                ) {
                    isTopLevel = false;
                    break;
                }
               
            }
           
            if ( isTopLevel ) {
                items.add( new TwigStructureItem( result.getSnapshot(), item, blocks ) );
            }
           
        }

        return items;
View Full Code Here

    }

    @Override
    public Map<String, List<OffsetRange>> folds( ParserResult info ) {
       
        TwigParserResult result = (TwigParserResult)info;
        List<OffsetRange> ranges = new ArrayList<OffsetRange>();
       
        for ( TwigParserResult.Block block : result.getBlocks() ) {

            ranges.add( new OffsetRange(
                    block.getOffset(), block.getOffset() + block.getLength()
            ) );
           
View Full Code Here

TOP

Related Classes of org.netbeans.modules.php.twig.editor.parsing.TwigParserResult$Block

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.