Search in sources :

Example 1 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService 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 "vsphere";
        }

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

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

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

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

        @Override
        public int priority() {
            return 9000;
        }
    };
    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 2 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService 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 "http";
        }

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

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(true), 80, "/", AuthenticationType.AUTHENTICATION_OPTIONAL, null);
        }
    };
    FileProtocolService service2 = new FileProtocolService() {

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

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

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

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

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

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

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return HTTPPanel.class;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    service2Registration = context.registerService(FileProtocolService.class, service2, 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 3 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService 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 "ovirt";
        }

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

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

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

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

        @Override
        public int priority() {
            return 7000;
        }
    };
    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 4 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService 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 "gdrive";
        }

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

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(), 21, "/", AuthenticationType.NO_AUTHENTICATION, new Credentials("anonymous", "anonymous_coward@mucommander.com"));
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

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

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

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

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return GoogleDrivePanel.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) Credentials(com.mucommander.commons.file.Credentials) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Example 5 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService 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 "dropbox";
        }

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

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(), 21, "/", AuthenticationType.NO_AUTHENTICATION, new Credentials("anonymous", "anonymous_coward@mucommander.com"));
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

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

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

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

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return DropboxPanel.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) Credentials(com.mucommander.commons.file.Credentials) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Aggregations

FileProtocolService (com.mucommander.commons.file.osgi.FileProtocolService)13 DefaultSchemeHandler (com.mucommander.commons.file.DefaultSchemeHandler)12 DefaultSchemeParser (com.mucommander.commons.file.DefaultSchemeParser)12 ProtocolPanelProvider (com.mucommander.protocol.ui.ProtocolPanelProvider)12 ServerPanelListener (com.mucommander.protocol.ui.ServerPanelListener)12 JFrame (javax.swing.JFrame)12 Credentials (com.mucommander.commons.file.Credentials)4 FileURL (com.mucommander.commons.file.FileURL)1 CoreService (com.mucommander.os.api.CoreService)1 FileEditorServiceTracker (com.mucommander.osgi.FileEditorServiceTracker)1 FileViewerServiceTracker (com.mucommander.osgi.FileViewerServiceTracker)1 OperatingSystemServiceTracker (com.mucommander.osgi.OperatingSystemServiceTracker)1 TranslationTracker (com.mucommander.text.TranslationTracker)1 ProtocolPanelProviderTracker (com.mucommander.ui.main.osgi.ProtocolPanelProviderTracker)1