Package org.eclipse.sapphire.ui.forms

Source Code of org.eclipse.sapphire.ui.forms.FormPart

/******************************************************************************
* Copyright (c) 2014 Oracle
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*    Konstantin Komissarchik - initial implementation and ongoing maintenance
******************************************************************************/

package org.eclipse.sapphire.ui.forms;

import org.eclipse.sapphire.Element;
import org.eclipse.sapphire.ui.def.PartDef;
import org.eclipse.sapphire.ui.forms.swt.FormComponentPresentation;
import org.eclipse.sapphire.ui.forms.swt.SwtPresentation;
import org.eclipse.sapphire.ui.forms.swt.internal.FormPresentation;
import org.eclipse.sapphire.util.ListFactory;
import org.eclipse.swt.widgets.Composite;

/**
* @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
*/

public class FormPart extends ContainerPart<FormComponentPart>
{
    protected Children initChildren()
    {
        return new Children()
        {
            @Override
            protected void init( final ListFactory<FormComponentPart> childPartsListFactory )
            {
                final Element element = getLocalModelElement();
               
                for( final PartDef childPartDef : definition().getContent() )
                {
                    childPartsListFactory.add( (FormComponentPart) createWithoutInit( FormPart.this, element, childPartDef, FormPart.this.params ) );
                }
            }
        };
    }
   
    @Override
    public FormDef definition()
    {
        return (FormDef) super.definition();
    }
   
    @Override
    public FormComponentPresentation createPresentation( final SwtPresentation parent, final Composite composite )
    {
        return new FormPresentation( this, parent, composite );
    }
   
}
TOP

Related Classes of org.eclipse.sapphire.ui.forms.FormPart

TOP
Copyright © 2018 www.massapi.com. 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.