Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Element


                        out.writeUTF( value );
                    }
                }
                else if( property instanceof ElementHandle<?> )
                {
                    final Element child = ( (ElementHandle<?>) property ).content();
                   
                    if( child != null )
                    {
                        out.writeByte( 1 );
                        out.writeUTF( property.name() );
View Full Code Here


                @Override
                protected void paint( final org.eclipse.swt.widgets.Event event,
                                      final Object object )
                {
                    final TableItem item = (TableItem) event.item;
                    final Element element = ( (TableRow) item.getData() ).element();

                    if( property( element ).enabled() )
                    {
                        final boolean value = getPropertyValueAsBoolean( element );
                       
View Full Code Here

public class OpenSplitFormDialogActionHandler extends SapphireActionHandler
{
    @Override
    protected Object run( final Presentation context )
    {
        final Element element = context.part().getLocalModelElement();
       
        final SapphireDialog dialog = new SapphireDialog
        (
            ( (FormComponentPresentation) context ).shell(), element,
            DefinitionLoader.context( IGallery.class ).sdef( "GalleryEditor" ).dialog( "SplitFormDialog" )
View Full Code Here

        {
            if( super.computeEnablementState() == true )
            {
                if( getSelectedElements().size() == 1 && TablePropertyEditorPresentation.this.tableViewer.getComparator() == null )
                {
                    final Element modelElement = getSelectedElement();
                    return ( list().indexOf( modelElement ) > 0 );
                }
            }
           
            return false;
View Full Code Here

        }

        @Override
        protected final Object executeTablePropertyEditorAction( final Presentation context )
        {
            final Element element = getSelectedElement();

            list().moveUp( element );
            TablePropertyEditorPresentation.this.tableViewer.reveal( findTableRow( element ) );
           
            return null;
View Full Code Here

        {
            if( super.computeEnablementState() == true )
            {
                if( getSelectedElements().size() == 1 && TablePropertyEditorPresentation.this.tableViewer.getComparator() == null )
                {
                    final Element modelElement = getSelectedElement();
                    final ElementList<?> list = list();
                    return ( list.indexOf( modelElement ) < ( list.size() - 1 ) );
                }
            }
           
View Full Code Here

        }
   
        @Override
        protected final Object executeTablePropertyEditorAction( final Presentation context )
        {
            final Element element = getSelectedElement();

            list().moveDown( element );
            TablePropertyEditorPresentation.this.tableViewer.reveal( findTableRow( element ) );
           
            return null;
View Full Code Here

    {
        final SoftReference<Element> cachedModelRef = cache.get( key );
       
        if( cachedModelRef != null )
        {
            final Element model = cachedModelRef.get();
           
            if( model != null )
            {
                final Resource resource = model.resource();
               
                if( resource == null || ! resource.isOutOfDate() )
                {
                    return model;
                }
View Full Code Here

{
    @Test
   
    public void testPartFunctionInPartContext()
    {
        final Element element = Element.TYPE.instantiate();
       
        try
        {
            final DefinitionLoader.Reference<DialogDef> definition = DefinitionLoader.sdef( PartFunctionTests.class ).dialog();
            final SapphirePart part = new DialogPart();
           
            try
            {
                part.init( null, element, definition.resolve(), Collections.<String,String>emptyMap() );
                part.initialize();
               
                testForExpectedValue( new PartFunctionContext( part, element ), "${ Part }", part );
            }
            finally
            {
                part.dispose();
            }
        }
        finally
        {
            element.dispose();
        }
    }
View Full Code Here

    {
        final TestElement element = TestElement.TYPE.instantiate();
       
        try
        {
            final Element entry = element.getList().insert();
            final FunctionContext context = new ModelElementFunctionContext( entry );
            final FunctionResult fr = ExpressionLanguageParser.parse( "${ This.Index }" ).evaluate( context );
           
            try
            {
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.Element

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.