Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt
package org.litesoft.aokeyhole.swing.mains.mementobeans;

import java.io.*;
import java.util.*;

import org.litesoft.aokeyhole.objects.factories.*;
import org.litesoft.aokeyhole.objects.factories.mementobean.*;
import org.litesoft.aokeyhole.persist.*;
import org.litesoft.aokeyhole.swing.*;
import org.litesoft.aokeyhole.toolkit.*;

public abstract class AbstractMementoBeanSwingMain extends AbstractSwingMain
{
    private static PropertyMetaDataDefinitionAccessor DEFINITIONS = MementoBeanPropertyMetaDataDefinitionAccessor.INSTANCE;

    public static final SubSystemFactory SSF = new SubSystemFactoryImpl( DEFINITIONS, IdentifierValidatorStrictCamel.INSTANCE, //
                                                                         new ObjectFactoryImpl( DEFINITIONS, IdentifierValidatorStrictCamel.INSTANCE, //
                                                                                                new AttributeFactoryImpl( DEFINITIONS, //
                                                                                                                          IdentifierValidatorStrictCamel.INSTANCE ) ) );

    protected AbstractMementoBeanSwingMain( String[] pDirectoryPackagePairs, boolean pReadOnly )
            throws IOException
    {
        super( SSF, new SwingEditViewPanelFactory(), pReadOnly, createPersistables( pDirectoryPackagePairs ) );
    }

    private static SubSystemPersister[] createPersistables( String[] pDirectoryPackagePairs )
            throws IOException
    {
        if ( pDirectoryPackagePairs.length == 0 )
        {
            throw new IllegalArgumentException( "No directory package pair(s) provided on the command line!" );
        }
        if ( (pDirectoryPackagePairs.length & 1) == 1 ) // Odd? == ! Pairs
        {
            throw new IllegalArgumentException( "Directory package pair(s) not paired on the command line!" );
        }
        List<SubSystemPersister> rv = new ArrayList<SubSystemPersister>();
        for ( int i = 0; i < pDirectoryPackagePairs.length; )
        {
            String zDirectory = pDirectoryPackagePairs[i++];
            String zPackage = pDirectoryPackagePairs[i++];
            rv.add( new DirectoryPackageSubSystemPersister( zDirectory, zPackage ) );
        }
        return rv.toArray( new SubSystemPersister[rv.size()] );
    }
}

Commits for litesoft/trunk/Java/KeyHole/src/org/litesoft/aokeyhole/swing/mains/mementobeans/AbstractMementoBeanSwingMain.java

Diff revisions: vs.
Revision Author Commited Message
821 Diff Diff GeorgeS picture GeorgeS Sun 19 Aug, 2012 00:08:41 +0000
817 Diff Diff GeorgeS picture GeorgeS Sat 18 Aug, 2012 17:57:19 +0000
816 Diff Diff GeorgeS picture GeorgeS Sat 18 Aug, 2012 17:56:47 +0000
815 Diff Diff GeorgeS picture GeorgeS Sat 18 Aug, 2012 17:54:14 +0000
814 Diff Diff GeorgeS picture GeorgeS Sat 18 Aug, 2012 17:52:17 +0000
788 Diff Diff GeorgeS picture GeorgeS Sun 05 Aug, 2012 22:58:50 +0000

!

787 Diff Diff GeorgeS picture GeorgeS Mon 30 Jul, 2012 03:00:12 +0000
785 GeorgeS picture GeorgeS Sun 22 Jul, 2012 03:27:33 +0000

!