Package org.apache.pivot.util

Examples of org.apache.pivot.util.Resources


            }

            calendarTablePane.getRows().add(calendarRow);
        }

        Resources resources;
        try {
            resources = new Resources(TerraCalendarSkin.class.getName());
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        } catch (SerializationException exception) {
            throw new RuntimeException(exception);
        }
View Full Code Here


        if (location == null) {
            throw new IllegalArgumentException("Cannot find source file \"" + src + "\".");
        }

        Resources resources;
        if (properties.containsKey(RESOURCES_KEY)) {
            resources = new Resources(properties.get(RESOURCES_KEY));
        } else {
            resources = null;
        }

        if (properties.containsKey(STYLESHEET_KEY)) {
View Full Code Here

        if (resourceName == null) {
            throw new IllegalArgumentException("resourceName is null.");
        }

        return readObject(baseType.getResource(resourceName),
            localize ? new Resources(baseType.getName()) : null);
    }
View Full Code Here

                    + " tag.");
            }

            String src = element.properties.get(INCLUDE_SRC_ATTRIBUTE);

            Resources resources = this.resources;
            if (element.properties.containsKey(INCLUDE_RESOURCES_ATTRIBUTE)) {
                resources = new Resources(resources,
                    element.properties.get(INCLUDE_RESOURCES_ATTRIBUTE));
            }

            String mimeType = null;
            if (element.properties.containsKey(INCLUDE_MIME_TYPE_ATTRIBUTE)) {
View Full Code Here

            }

            calendarTablePane.getRows().add(calendarRow);
        }

        Resources resources;
        try {
            resources = new Resources(TerraCalendarSkin.class.getName());
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        } catch (SerializationException exception) {
            throw new RuntimeException(exception);
        }
View Full Code Here

    private Resources parent;
    private Resources main;

    @Before
    public void before() throws Exception {
        parent = new Resources(getClass().getName() + "Parent");
        assertNotNull("From parent", parent.get("parentKeyString"));
        main = new Resources(parent, getClass().getName(), Locale.ENGLISH);
    }
View Full Code Here

    }

    @Test
    public void testConstructors() throws Exception {
        main = new Resources(parent, getClass().getName(), Charset.defaultCharset());
        testString();

        main = new Resources(parent, getClass().getName(), Charset.defaultCharset());
        testString();

        main = new Resources(parent, getClass().getName(), Locale.ENGLISH);
        testString();

        main = new Resources(parent, getClass().getName(), Locale.ENGLISH, Charset.defaultCharset());
        testString();

        main = new Resources(parent, getClass().getName(), Locale.ENGLISH,
            Charset.defaultCharset());
        testString();

    }
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    public void initialize(Resources resources) {
        // Load the add/edit sheet
        try {
            WTKXSerializer wtkxSerializer = new WTKXSerializer(new Resources(ExpenseSheet.class.getName()));
            expenseSheet = (ExpenseSheet)wtkxSerializer.readObject(this, "expense_sheet.wtkx");
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        } catch (SerializationException exception) {
            throw new RuntimeException(exception);
View Full Code Here

            }

            calendarTablePane.getRows().add(calendarRow);
        }

        Resources resources;
        try {
            resources = new Resources(TerraCalendarSkin.class.getName());
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        } catch (SerializationException exception) {
            throw new RuntimeException(exception);
        }
View Full Code Here

        // throw a nice error so the user knows which resource did not load
        URL locationLocal = baseType.getResource(resourceName);
        if (locationLocal == null) {
            throw new IllegalArgumentException("could not find resource \"" + resourceName + "\".");
        }
        return readObject(locationLocal, localize ? new Resources(baseType.getName()) : null);
    }
View Full Code Here

TOP

Related Classes of org.apache.pivot.util.Resources

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.