Package com.alee.utils.reflection

Examples of com.alee.utils.reflection.JarStructure


        // Creating structure using any of classes contained inside jar
        progress.setText ( "Creating source files structure..." );
        final List<String> extensions = Arrays.asList ( ".java", ".png", ".gif", ".jpg", ".txt", ".xml" );
        final List<String> packages = Arrays.asList ( "com/alee", "licenses" );
        final JarStructure jarStructure = ReflectUtils.getJarStructure ( ExamplesManager.class, extensions, packages, listener );

        // Updating some of package icons
        jarStructure.setPackageIcon ( WebLookAndFeelDemo.class.getPackage (), new ImageIcon ( WebLookAndFeel.getImages ().get ( 0 ) ) );
        for ( final ExampleGroup exampleGroup : getExampleGroups () )
        {
            jarStructure.setClassIcon ( exampleGroup.getClass (), ( ImageIcon ) exampleGroup.getGroupIcon () );
        }

        return jarStructure;
    }
View Full Code Here


                    jarFile = FileUtils.downloadFile ( jarUrl.toString (), File.createTempFile ( "jar_file", ".tmp" ), listener );
                }

                // Creating
                final JarEntry jarEntry = new JarEntry ( JarEntryType.jarEntry, jarFile.getName () );
                final JarStructure jarStructure = new JarStructure ( jarEntry );
                jarStructure.setJarLocation ( jarFile.getAbsolutePath () );

                // Reading all entries and parsing them into structure
                final ZipInputStream zip = new ZipInputStream ( jarUrl.openStream () );
                ZipEntry zipEntry;
                while ( ( zipEntry = zip.getNextEntry () ) != null )
View Full Code Here

    private Component createLibrariesTab ()
    {
        try
        {
            // Parsing jar structure
            final JarStructure structure = ReflectUtils.getJarStructure ( getClass () );

            // Retrieving required files
            final JarEntry licensesFolder = structure.getRoot ().getChildByName ( "licenses" );
            final JarEntry librariesDataFile = licensesFolder.getChildByName ( "libraries.data" );

            // Retrieving additional data for used libraries
            final String librariesDataText = FileUtils.readToString ( structure.getEntryInputStream ( librariesDataFile ) );
            final Map<String, String> librariesData = parseUrls ( librariesDataText );

            // Parsing available libraries info
            final WebPanel librariesPanel = new WebPanel ( new VerticalFlowLayout ( 0, 5 ) );
            librariesPanel.setMargin ( 5 );
            for ( final JarEntry child : licensesFolder.getChilds () )
            {
                if ( child.getName ().endsWith ( ".txt" ) )
                {
                    final String data = librariesData.get ( child.getName () );
                    final int i = data.indexOf ( LIBRARY_DATA_SEPARATOR );
                    final String name = data.substring ( 0, i );
                    final String url = data.substring ( i + LIBRARY_DATA_SEPARATOR.length () );

                    final WebLabel nameLabel = new WebLabel ( name );
                    SwingUtils.setBoldFont ( nameLabel );

                    // Library license file
                    final WebLinkLabel fileLink = new WebLinkLabel ( child.getName () );
                    fileLink.setLink ( new Runnable ()
                    {
                        @Override
                        public void run ()
                        {
                            try
                            {
                                final String license = FileUtils.readToString ( structure.getEntryInputStream ( child ) );
                                final WebPopup licensePopup = new WebPopup ();
                                final WebTextArea textArea = new WebTextArea ( license );
                                textArea.setEditable ( false );
                                licensePopup.add ( new WebScrollPane ( textArea, false ) );
                                licensePopup.showPopupAsModal ( fileLink, true, true );
View Full Code Here

TOP

Related Classes of com.alee.utils.reflection.JarStructure

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.