Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.Element


  public void addConnection(DiagramConnectionPart connPart) {
    if (getDiagramConnectionModel(connPart) != null) {
      return;
    }
   
    Element endpoint1 = connPart.getEndpoint1();
    Element endpoint2 = connPart.getEndpoint2();
    DiagramNodePart nodePart1 = getSapphirePart().getDiagramNodePart(endpoint1);
    DiagramNodePart nodePart2 = getSapphirePart().getDiagramNodePart(endpoint2);
    if (nodePart1 != null && nodePart2 != null) {
      DiagramConnectionPresentation connPresentation = new DiagramConnectionPresentation(connPart, getPresentation(),
          getPresentation().shell(),
View Full Code Here


      //connPart.removeAllBendpoints();
    }
  }
 
  public void updateConnectionEndpoint(DiagramConnectionPart connPart) {
    Element endpoint1 = connPart.getEndpoint1();
    Element endpoint2 = connPart.getEndpoint2();
    DiagramNodePart nodePart1 = getSapphirePart().getDiagramNodePart(endpoint1);
    DiagramNodePart nodePart2 = getSapphirePart().getDiagramNodePart(endpoint2);

    DiagramConnectionModel connectionModel = getDiagramConnectionModel(connPart);
    DiagramNodePart oldPart1 = connectionModel == null ? null : connectionModel.getSourceNode().getModelPart();
View Full Code Here

        return false;
    }
   
    protected boolean check( final MasterDetailsContentNodePart node )
    {
        final Element element = node.getModelElement();
       
        if( element.parent() instanceof ElementList && ! element.parent().definition().isReadOnly() )
        {
            final ISapphirePart parentPart = node.parent();
           
            if( parentPart != null && parentPart instanceof MasterDetailsContentNodePart )
            {
View Full Code Here

    @Override
    public void init( final SapphireAction action, final ActionHandlerDef def )
    {
        super.init( action, def );
       
        final Element element = ( (MasterDetailsContentNodePart) getPart() ).getLocalModelElement();
       
        final Listener listener = new FilteredListener<PropertyContentEvent>()
        {
            @Override
            protected void handleTypedEvent( final PropertyContentEvent event )
            {
                refreshVisibility();
            }
        };
       
        element.attach( listener, ModelPath.ALL_DESCENDENTS );

        refreshVisibility();
       
        attach
        (
            new Listener()
            {
                @Override
                public void handle( final Event event )
                {
                    if( event instanceof DisposeEvent )
                    {
                        element.detach( listener, ModelPath.ALL_DESCENDENTS );
                    }
                }
            }
        );
    }
View Full Code Here

    @Override
    protected void init()
    {
        super.init();
       
        final Element element = getModelElement();
        final WizardDef def = definition();
       
        this.imageFunctionResult = initExpression
        (
            def.getImage().content(),
View Full Code Here

    }

    private void refreshVisibility()
    {
        final MasterDetailsContentNodePart node = (MasterDetailsContentNodePart) getPart();
        final Element element = node.getLocalModelElement();
        final Resource resource = element.resource();
       
        setVisible( resource instanceof XmlResource && ( (XmlResource) resource ).getXmlElement() != null );
    }
View Full Code Here

    @Override
    protected Object run( final Presentation context )
    {
        final MasterDetailsContentNodePart node = (MasterDetailsContentNodePart) getPart();
        final Element element = node.getLocalModelElement();
       
        element.adapt( SourceEditorService.class ).show( element, null );
       
        return null;
    }
View Full Code Here

    @Override
    @SuppressWarnings( "unchecked" )
    protected Object run( final Presentation context )
    {
        final MasterDetailsContentNodePart node = (MasterDetailsContentNodePart) getPart();
        final Element element = node.getModelElement();
        final ElementList<Element> list = (ElementList<Element>) element.parent();
       
        list.moveDown( element );
       
        return null;
    }
View Full Code Here

    {
        boolean enabled = super.computeEnabledState();
       
        if( enabled )
        {
            final Element element = getModelElement();
            final ElementList<?> list = (ElementList<?>) element.parent();
            enabled = ( list.indexOf( element ) < ( list.size() - 1 ) );
        }
       
        return enabled;
    }
View Full Code Here

public final class OutlineNodeDeleteActionHandlerCondition extends OutlineNodeListMemberActionHandlerCondition
{
    @Override
    protected boolean check( final MasterDetailsContentNodePart node )
    {
        final Element element = node.getModelElement();
        final Property property = element.parent();

        if( property != null && ! property.definition().isReadOnly() )
        {
            if( super.check( node ) )
            {
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.