Examples of ConnectionService


Examples of net.sourceforge.jivalo.cnfmgr.service.ConnectionService

        if ( fac != null && fac.equals("net.sourceforge.jivalo.cnfmgr.configuration.PlatformPreferencesFactory") ) {
       
        Object val1 = factory.getBean(ConfigurationPersistentHandler.PERSISTENT_HANDLER_LOOKUP_NAME);
        ServiceManager.put(ConfigurationPersistentHandler.PERSISTENT_HANDLER_LOOKUP_NAME, val1);
       
        ConnectionService val2 = (ConnectionService)factory.getBean(PersistentConnectorImpl.CONNECTION_SERVICE_LOOKUP_NAME);
        net.sourceforge.jivalo.cnfmgr.persistent.impl.J2seResourceConfig conf =
          (net.sourceforge.jivalo.cnfmgr.persistent.impl.J2seResourceConfig)val2.getResource("configurationResourceName");
        if (conf != null ) {
          if ( conf.getUser() == null || conf.getUser().equals("") ) {
            if ( cache.get( envi+"::user" ) != null ) {
              conf.setUser((String)cache.get( envi+"::user" ));
            }
            else {
              conf.setUser(JOptionPane.showInputDialog("User Id"));
              cache.put( envi+"::user" , conf.getUser());
            }
          }
          if ( conf.getPassword() == null || conf.getPassword().equals("") ) {
            if ( cache.get( envi+"::psw" ) != null ) {
              conf.setPassword((String)cache.get( envi+"::psw" ));
            }
            else {
              conf.setPassword(JOptionPane.showInputDialog("Password"));
              cache.put( envi+"::psw" , conf.getPassword());
            }
          }
       
          val2.setResource(conf);
        }
        ServiceManager.put(PersistentConnectorImpl.CONNECTION_SERVICE_LOOKUP_NAME, val2);
        }
        else if ( fac != null && fac.equals("net.sourceforge.jivalo.cnfmgr.configuration.XMLPreferencesFactory") ) {
        Object val1 = factory.getBean(XmlPersistentHandlerConfig.PERSISTENT_HANDLER_CONFIG_LOOKUP_NAME);
View Full Code Here

Examples of net.sourceforge.jivalo.cnfmgr.service.ConnectionService

        if ( fac != null && fac.equals("net.sourceforge.jivalo.cnfmgr.configuration.PlatformPreferencesFactory") ) {
       
        Object val1 = factory.getBean(ConfigurationPersistentHandler.PERSISTENT_HANDLER_LOOKUP_NAME);
        ServiceManager.put(ConfigurationPersistentHandler.PERSISTENT_HANDLER_LOOKUP_NAME, val1);
       
        ConnectionService val2 = (ConnectionService)factory.getBean(PersistentConnectorImpl.CONNECTION_SERVICE_LOOKUP_NAME);
        net.sourceforge.jivalo.cnfmgr.persistent.impl.J2seResourceConfig conf =
          (net.sourceforge.jivalo.cnfmgr.persistent.impl.J2seResourceConfig)val2.getResource("configurationResourceName");
        if (conf != null ) {
          if ( conf.getUser() == null || conf.getUser().equals("") ) {
            if ( cache.get( envi+"::user" ) != null ) {
              conf.setUser((String)cache.get( envi+"::user" ));
            }
            else {
              conf.setUser(JOptionPane.showInputDialog("User Id"));
              cache.put( envi+"::user" , conf.getUser());
            }
          }
          if ( conf.getPassword() == null || conf.getPassword().equals("") ) {
            if ( cache.get( envi+"::psw" ) != null ) {
              conf.setPassword((String)cache.get( envi+"::psw" ));
            }
            else {
              conf.setPassword(JOptionPane.showInputDialog("Password"));
              cache.put( envi+"::psw" , conf.getPassword());
            }
          }
       
          val2.setResource(conf);
        }
        ServiceManager.put(PersistentConnectorImpl.CONNECTION_SERVICE_LOOKUP_NAME, val2);
        }
        else if ( fac != null && fac.equals("net.sourceforge.jivalo.cnfmgr.configuration.XMLPreferencesFactory") ) {
        Object val1 = factory.getBean(XmlPersistentHandlerConfig.PERSISTENT_HANDLER_CONFIG_LOOKUP_NAME);
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

  {   
    if (target == null)
    {
      return false;
    }
    ConnectionService connService = this.diagramPart.service(ConnectionService.class);
    return connService.valid(this.source.getModelPart(), this.target.getModelPart(), this.connDef.getId().content());
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

   *
   * @see org.eclipse.gef.commands.Command#execute()
   */
  public void execute()
  {
    ConnectionService connService = this.diagramPart.service(ConnectionService.class);
    DiagramConnectionPart connection = connService.connect(this.source.getModelPart(), this.target.getModelPart(),
        this.connDef.getId().content());
   
    // activate direct editing after object creation
    if (connection != null && connection.canEditLabel())
    {
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

      nodes.add(new DiagramNodeModel(this, nodePresentation));
    }
  }
 
  private void constructConnections() {
    ConnectionService connService = getSapphirePart().service(ConnectionService.class);
    for (DiagramConnectionPart connPart : connService.list())
    {
      addConnection(connPart);
    }
   
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

    return false;
  }

  private boolean checkSourceReconnection() {
    DiagramConnectionPart connectionPart = this.connection.getModelPart();
    ConnectionService connService = connectionPart.nearest(SapphireDiagramEditorPagePart.class).service(ConnectionService.class);
    if (!connService.valid(newSource.getModelPart(), oldTarget.getModelPart(), connectionPart.getConnectionTypeId()))
      return false;

    return true;
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

    return true;
  }

  private boolean checkTargetReconnection() {
    DiagramConnectionPart connectionPart = this.connection.getModelPart();
    ConnectionService connService = connectionPart.nearest(SapphireDiagramEditorPagePart.class).service(ConnectionService.class);
    if (!connService.valid(oldSource.getModelPart(), newTarget.getModelPart(), connectionPart.getConnectionTypeId()))
      return false;
       
    return true;
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

        return layoutPersistentService;      
    }
       
    public static ConnectionService getConnectionService(SapphireDiagramEditorPagePart diagramPart)
    {
      ConnectionService connectionService =
          diagramPart.service(ConnectionService.class);
     
        return connectionService;      
    }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

{
    @Override
    protected Object run( final Presentation context )
    {
        final SapphireDiagramEditorPagePart page = (SapphireDiagramEditorPagePart) getPart();
        ConnectionService connService = page.service(ConnectionService.class);
       
        int nodes = 0;
        int connections = 0;
        int bendpoints = 0;
       
        for( ISapphirePart selectedPart : page.getSelections() )
        {
            if( selectedPart instanceof DiagramNodePart )
            {
                nodes++;
            }
            else if( selectedPart instanceof DiagramConnectionPart )
            {
                connections++;
                bendpoints += ( (DiagramConnectionPart) selectedPart ).getBendpoints().size();
            }
            else if( selectedPart instanceof SapphireDiagramEditorPagePart )
            {
                nodes = page.getNodes().size();
               
                final List<DiagramConnectionPart> allConnections = connService.list();
               
                connections = allConnections.size();
               
                for( DiagramConnectionPart connection : allConnections )
                {
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.ConnectionService

  {
      context( SapphireDiagramEditorPagePart.class ).setGridVisible(this.architecture.isShowGrid().content());
      context( SapphireDiagramEditorPagePart.class ).setShowGuides(this.architecture.isShowGuides().content());
   
    ElementList<Component> components = this.architecture.getComponents();
    ConnectionService connService = context( SapphireDiagramEditorPagePart.class ).service(ConnectionService.class);
    for (Component component : components)
    {
      DiagramNodePart nodePart = context( SapphireDiagramEditorPagePart.class ).getDiagramNodePart(component);
      if (nodePart != null)
      {
        DiagramNodeBounds bounds = null;
        bounds = new DiagramNodeBounds(component.getPosition().getX().content(),
            component.getPosition().getY().content(), -1, -1,
            false, false);
        nodePart.setNodeBounds(bounds);         
       
        // load the embedded connection layout
        ElementList<ComponentDependency> dependencies = component.getDependencies();
       
        for (ComponentDependency dependency : dependencies)
        {
          DiagramConnectionPart connPart = getConnectionPart(connService, dependency);
          if (connPart != null)
          {           
            ElementList<ConnectionBendpoint> bendpoints = dependency.getConnectionBendpoints();
            if (bendpoints.size() > 0)
            {
              int index = 0;
              for (ConnectionBendpoint bendpoint : bendpoints)
              {
                connPart.addBendpoint(index++, bendpoint.getX().content(),
                    bendpoint.getY().content());
              }             
            }
          }
        }       
      }
    }
   
    // Listen on existing connection parts
    for (DiagramConnectionPart connPart : connService.list())
    {
      connPart.attach(this.connectionPartListener);
    }
   
  }
View Full Code Here
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.