Package org.apache.pivot.util

Examples of org.apache.pivot.util.Resources


                    + " tag.");
            }

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

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

            String mimeType = null;
            if (element.properties.containsKey(INCLUDE_MIME_TYPE_ATTRIBUTE)) {
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.getString("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

        final FileBrowserSheet fileBrowserSheet = (FileBrowserSheet)component;
        fileBrowserSheet.setMinimumPreferredWidth(360);
        fileBrowserSheet.setMinimumPreferredHeight(180);

        // Load the sheet content
        Resources resources;
        try {
            resources = new Resources(getClass().getName());
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        } catch (SerializationException exception) {
            throw new RuntimeException(exception);
        }
View Full Code Here

        String language = properties.get(LANGUAGE_PROPERTY_NAME);
        if (language != null) {
            Locale.setDefault(new Locale(language));
        }

        Resources resources = new Resources(StockTrackerWindow.class.getName());
        WTKXSerializer wtkxSerializer = new WTKXSerializer(resources);
        window = (StockTrackerWindow)wtkxSerializer.readObject(this, "stock_tracker_window.wtkx");
        window.open(display);
    }
View Full Code Here

        EventLogger eventLogger = (EventLogger)component;

        eventLogger.getEventLoggerListeners().add(this);

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

public class ResolveTest implements Application {
    private Window window = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        Resources resources = new Resources(getClass().getName());
        WTKXSerializer wtkxSerializer = new WTKXSerializer(resources);
        window = (Window)wtkxSerializer.readObject(this, "resolve_test.wtkx");
        window.open(display);
    }
View Full Code Here

public class BindableTest implements Application {
    private BindableWindow window = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer(new Resources(BindableWindow.class.getName()));
        window = (BindableWindow)wtkxSerializer.readObject(this, "bindable_test.wtkx");
        window.open(display);
    }
View Full Code Here

    public void install(Component component) {
        super.install(component);

        final FileBrowser fileBrowser = (FileBrowser)component;

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

                if (element.type == Element.Type.INCLUDE) {
                    // Process attributes looking for src, resources, and static property
                    // setters only
                    String src = null;
                    Resources resources = this.resources;
                    boolean inline = false;

                    for (Attribute attribute : element.attributes) {
                        if (attribute.localName.equals(INCLUDE_SRC_ATTRIBUTE)) {
                            src = attribute.value;
                        } else if (attribute.localName.equals(INCLUDE_RESOURCES_ATTRIBUTE)) {
                            resources = new Resources(resources, attribute.value);
                        } else if (attribute.localName.equals(INCLUDE_INLINE_ATTRIBUTE)) {
                            inline = Boolean.parseBoolean(attribute.value);
                        } else {
                            if (!Character.isUpperCase(attribute.localName.charAt(0))) {
                                throw new SerializationException("Instance property setters are not"
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.