Package com.mucommander.commons.file.connection

Examples of com.mucommander.commons.file.connection.ConnectionHandler


            public int getSize() {
                return connections.size();
            }

            public Object getElementAt(int i) {
                ConnectionHandler connHandler = connections.get(i);

                // Show login (but not password) in the URL
                // Note: realm returned by ConnectionHandler does not contain credentials
                FileURL clonedRealm = (FileURL)connHandler.getRealm().clone();
                Credentials loginCredentials = new Credentials(connHandler.getCredentials().getLogin(), "");
                clonedRealm.setCredentials(loginCredentials);

                return clonedRealm.toString(true)
                        +" ("+Translator.get(connHandler.isLocked()?"server_connections_dialog.connection_busy":"server_connections_dialog.connection_idle")+")";
            }
        });

        // Only one list index can be selected at a time
        connectionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
View Full Code Here


        // Disconnects the selected connection
        if(source==disconnectButton) {
            int selectedIndex = connectionList.getSelectedIndex();

            if(selectedIndex>=0 && selectedIndex<connections.size()) {
                final ConnectionHandler connHandler = connections.get(selectedIndex);

                // Close connection in a separate thread as I/O can lock.
                // Todo: Add a confirmation dialog if the connection is active as it will stop whatever the connection is currently doing
                new Thread(){
                    @Override
                    public void run() {
                        connHandler.closeConnection();
                    }
                }.start();

                // Remove connection from the list
                connections.remove(selectedIndex);
View Full Code Here

TOP

Related Classes of com.mucommander.commons.file.connection.ConnectionHandler

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.