private void InitProtocols()
        {
            List <KeyValueIconTriple <Protocol, string> > protocols = new List <KeyValueIconTriple <Protocol, string> >();
            ProtocolFactory p = ProtocolFactory.get();

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.ftp, Protocol.Type.sftp, Protocol.Type.dav))).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.s3, Protocol.Type.swift, Protocol.Type.azure, Protocol.Type.b2,
                                                                Protocol.Type.googlestorage))).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.dropbox, Protocol.Type.box, Protocol.Type.onedrive, Protocol.Type.googledrive, Protocol.Type.nextcloud, Protocol.Type.owncloud, Protocol.Type.dracoon, Protocol.Type.brick)))
                     .toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.file))).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new ProfileProtocolPredicate()).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }
            protocols.Add(new KeyValueIconTriple <Protocol, string>(null,
                                                                    LocaleFactory.localizedString("More Options", "Bookmark") + '\u2026', null));

            View.PopulateProtocols(protocols);
        }
Exemple #2
0
        private void InitProtocols()
        {
            List <KeyValueIconTriple <Protocol, string> > protocols = new List <KeyValueIconTriple <Protocol, string> >();
            ProtocolFactory p = ProtocolFactory.get();

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.ftp, Protocol.Type.sftp, Protocol.Type.dav))).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.s3, Protocol.Type.swift, Protocol.Type.azure, Protocol.Type.b2,
                                                                Protocol.Type.dracoon,
                                                                Protocol.Type.googlestorage))).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.dropbox, Protocol.Type.onedrive, Protocol.Type.googledrive, Protocol.Type.nextcloud)))
                     .toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new DefaultProtocolPredicate(
                                                     EnumSet.of(Protocol.Type.file))).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            foreach (Protocol protocol in p.find(new ProfileProtocolPredicate()).toArray(new Protocol[] { }))
            {
                protocols.Add(new KeyValueIconTriple <Protocol, string>(protocol, protocol.getDescription(),
                                                                        protocol.disk()));
            }

            View.PopulateProtocols(protocols);
        }