Search in sources :

Example 11 with ProtocolPanelProvider

use of com.mucommander.protocol.ui.ProtocolPanelProvider in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService service = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "nfs";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new NFSProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(), 2049, "/", AuthenticationType.NO_AUTHENTICATION, null);
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            return "nfs";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            return new NFSPanel(listener, mainFrame);
        }

        @Override
        public int priority() {
            return 2000;
        }

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return NFSPanel.class;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Example 12 with ProtocolPanelProvider

use of com.mucommander.protocol.ui.ProtocolPanelProvider in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService service = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "sftp";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new SFTPProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(), 22, "/", AuthenticationType.AUTHENTICATION_REQUIRED, null);
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            return "sftp";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            return new SFTPPanel(listener, mainFrame);
        }

        @Override
        public int priority() {
            return 1000;
        }

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return SFTPPanel.class;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Example 13 with ProtocolPanelProvider

use of com.mucommander.protocol.ui.ProtocolPanelProvider in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService service = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "hdfs";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new HDFSProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(true), 8020, "/", AuthenticationType.AUTHENTICATION_OPTIONAL, null);
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            return "hdfs";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            return new HDFSPanel(listener, mainFrame);
        }

        @Override
        public int priority() {
            return Integer.MAX_VALUE;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Example 14 with ProtocolPanelProvider

use of com.mucommander.protocol.ui.ProtocolPanelProvider in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService service = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "smb";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new SMBProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(), -1, "/", AuthenticationType.AUTHENTICATION_REQUIRED, new Credentials("GUEST", "")) {

                @Override
                public FileURL getRealm(FileURL location) {
                    FileURL realm = new FileURL(this);
                    String newPath = location.getPath();
                    // Find first path token (share)
                    int pos = newPath.indexOf('/', 1);
                    newPath = newPath.substring(0, pos == -1 ? newPath.length() : pos + 1);
                    realm.setPath(newPath);
                    realm.setScheme(location.getScheme());
                    realm.setHost(location.getHost());
                    realm.setPort(location.getPort());
                    // Copy properties (if any)
                    realm.importProperties(location);
                    return realm;
                }
            };
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            return "smb";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            return new SMBPanel(listener, mainFrame);
        }

        @Override
        public int priority() {
            return 4000;
        }

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return SMBPanel.class;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : FileURL(com.mucommander.commons.file.FileURL) ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) Credentials(com.mucommander.commons.file.Credentials) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Aggregations

ProtocolPanelProvider (com.mucommander.protocol.ui.ProtocolPanelProvider)14 DefaultSchemeHandler (com.mucommander.commons.file.DefaultSchemeHandler)12 DefaultSchemeParser (com.mucommander.commons.file.DefaultSchemeParser)12 FileProtocolService (com.mucommander.commons.file.osgi.FileProtocolService)12 ServerPanelListener (com.mucommander.protocol.ui.ServerPanelListener)12 JFrame (javax.swing.JFrame)12 Credentials (com.mucommander.commons.file.Credentials)4 BonjourMenu (com.mucommander.bonjour.BonjourMenu)1 BonjourService (com.mucommander.bonjour.BonjourService)1 Bookmark (com.mucommander.bookmark.Bookmark)1 FileURL (com.mucommander.commons.file.FileURL)1 MnemonicHelper (com.mucommander.commons.util.ui.helper.MnemonicHelper)1 MuAction (com.mucommander.ui.action.MuAction)1 ArrayList (java.util.ArrayList)1 Hashtable (java.util.Hashtable)1 Icon (javax.swing.Icon)1 JMenuItem (javax.swing.JMenuItem)1 JPopupMenu (javax.swing.JPopupMenu)1 JSeparator (javax.swing.JSeparator)1