Package org.jmule.core

Examples of org.jmule.core.JMRunnable


    if ( list.size()== 1)
      result = Utils.showConfirmMessage(getShell(),Localizer._("mainwindow.serverlisttab.serverlist.server_delete_confirm_title"), Localizer._("mainwindow.serverlisttab.serverlist.server_delete_confirm"));
    else
      result = Utils.showConfirmMessage(getShell(),Localizer._("mainwindow.serverlisttab.serverlist.server_delete_confirm_title"), Localizer._("mainwindow.serverlisttab.serverlist.servers_delete_confirm"));
    if (result)
      new JMThread(new JMRunnable() {
        public void JMRun() {
          SWTServerListWrapper.getInstance().removeServer(list);
        }
       
      }).start();
View Full Code Here


  }
 
  private void clearServerList() {
    boolean returnvalue = Utils.showConfirmMessage(getShell(),Localizer._("mainwindow.serverlisttab.serverlist.clear_confirm_title"), Localizer._("mainwindow.serverlisttab.serverlist.clear_confirm"));
    if (returnvalue) {
      new JMThread( new JMRunnable() {
        public void JMRun() {
          SWTServerListWrapper.getInstance().clearServerList();
        }
      }).start();
    }
View Full Code Here

    Utils.setClipBoardText(str);
  }
 
  private void pasteED2KLinks() {
    final String clipboard_content = Utils.getClipboardText();
    new JMThread( new JMRunnable() {
      public void JMRun() {
        List<ED2KServerLink> server_links = ED2KServerLink.extractLinks(clipboard_content);
        for(ED2KServerLink ed2k_link : server_links) {
          try {
            JMuleCoreFactory.getSingleton().getServerManager().newServer(ed2k_link);
View Full Code Here

        if (!is_autoconnect) {
          setUIDisconnected(server);
        }
      }
      public void serverMessage(Server server,final String message) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            server_messages.addText(message);
          }});
      }

      public void autoConnectFailed() {
        if (is_autoconnect) {
          is_autoconnect = false;
          setUIDisconnected(null);
        }
      }

      public void autoConnectStarted() {
        if ( is_autoconnect == false ) {
          is_autoconnect = true;
          setUIConnecting();
        }
      }

      public void isConnecting(Server server) {
        setUIConnecting(server);
      }

      public void serverAdded(final Server server) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            MainWindow.getLogger().fine(Localizer._("mainwindow.logtab.message_server_added",server.getAddress()+":"+server.getPort()));
            server_list.addServer(server);
            server_list_tab.setServerCount(server_manager.getServersCount());
        }});
      }

      public void serverConnectingFailed(Server server, Throwable cause) {
        setUIDisconnected(server);
      }

      public void serverListCleared() {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            MainWindow.getLogger().fine(Localizer._("mainwindow.logtab.message_server_list_cleared"));
            server_list.clear();
            server_list_tab.setServerCount(server_manager.getServersCount());
        }});
      }

      public void serverRemoved(final Server server) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            MainWindow.getLogger().fine(Localizer._("mainwindow.logtab.message_server_removed",server.getAddress()+":"+server.getPort()));
            server_list.removeServer(server);
            server_list_tab.setServerCount(server_manager.getServersCount());
        }});
View Full Code Here

    });
  }
 
  private void setUIConnecting() {
    if (SWTThread.getDisplay().isDisposed()) return ;
    SWTThread.getDisplay().asyncExec(new JMRunnable() {
      public void JMRun() {
        if (!connect_button.isDisposed())
          connect_button.setConnecting();
        if (!status_bar.isDisposed())
          status_bar.setStatusConnecting();
View Full Code Here

    });
  }
 
  private void setUIConnecting(final Server server) {
    if (SWTThread.getDisplay().isDisposed()) return ;
    SWTThread.getDisplay().asyncExec(new JMRunnable() {
      public void JMRun() {
        MainWindow.getLogger().fine(_._("mainwindow.logtab.message_connecting_to",server.getAddress()+":"+server.getPort()));
        if (!connect_button.isDisposed())
          connect_button.setConnecting();
        if (!status_bar.isDisposed())
View Full Code Here

      }});
  }
 
  private void setUIDisconnected(final Server server) {
    if (SWTThread.getDisplay().isDisposed()) return ;
    SWTThread.getDisplay().asyncExec(new JMRunnable() {
      public void JMRun() {
        if (!connect_button.isDisposed())
          connect_button.setDisconnected();
        if (!status_bar.isDisposed())
          status_bar.setStatusDisconnected();
View Full Code Here

      }});
  }
 
  private void setUIConnected(final Server server) {
    if (SWTThread.getDisplay().isDisposed()) return ;
    SWTThread.getDisplay().asyncExec(new JMRunnable() {
      public void JMRun() {
        if (!connect_button.isDisposed())
          connect_button.setConnected();
        if (!status_bar.isDisposed())
          status_bar.setStatusConnected(server);
View Full Code Here

        MainWindow.getLogger().fine(Localizer.getString("mainwindow.logtab.message_connected_to", server.getAddress()+":"+server.getPort()));
      }});
  }
 
  public void startAutoConnect() {
    SWTThread.getDisplay().asyncExec(new JMRunnable() {
      public void JMRun() {
        try {
          server_manager.connect();
        } catch (ServerManagerException e) {
          e.printStackTrace();
View Full Code Here

      }
    });
  }

  public void stopConnecting() {
    SWTThread.getDisplay().asyncExec(new JMRunnable() {
      public void JMRun() {
        if (is_autoconnect) {
          is_autoconnect = false;
          try {
            server_manager.disconnect();
View Full Code Here

TOP

Related Classes of org.jmule.core.JMRunnable

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.