Package org.apache.pivot.util

Examples of org.apache.pivot.util.Resources


            public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
                try {
                    if (count == 2) {
                        TrackData trackData = (TrackData) tracksTableView.getSelectedRow();
                        BXMLSerializer wtkxSerializer = new BXMLSerializer();
                        EditTrackWindow window = (EditTrackWindow) wtkxSerializer.readObject(getClass().getResource("EditTrackWindow.bxml"),new Resources(resources, EditTrackWindow.class.getName()));
                        window.open(getDisplay(), getWindow(), trackData.track);
                        return true;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
View Full Code Here


            public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
                try {
                    if (count == 2) {
                        Release release = (Release) releaseResultsTableView.getSelectedRow();
                        BXMLSerializer wtkxSerializer = new BXMLSerializer();
                        EditReleaseWindow window = (EditReleaseWindow) wtkxSerializer.readObject(getClass().getResource("EditReleaseWindow.bxml"),new Resources(resources,EditReleaseWindow.class.getName()));
                        window.open(getDisplay(), getWindow(), release);
                        return true;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
View Full Code Here

        crudSearchButton.getButtonPressListeners().add(new ButtonPressListener() {
             @Override
             public void buttonPressed(Button button) {
                 try {
                     BXMLSerializer wtkxSerializer = new BXMLSerializer();
                     SMDCRUDSearchWindow window = (SMDCRUDSearchWindow) wtkxSerializer.readObject(getClass().getResource("SMDCRUDSearchWindow.bxml"),new Resources(resources,SMDCRUDSearchWindow.class.getName()));
                     window.open(getDisplay(), getWindow());
                 } catch (IOException e) {
                     throw new RuntimeException(e);
                 } catch (SerializationException e) {
                     throw new RuntimeException(e);
                 }
             }
         });

        listViewButton.getButtonPressListeners().add(new ButtonPressListener() {
             @Override
             public void buttonPressed(Button button) {
                 try {
                     BXMLSerializer wtkxSerializer = new BXMLSerializer();
                     SMDListViewWindow window = (SMDListViewWindow) wtkxSerializer.readObject(getClass().getResource("SMDListViewWindow.bxml"),new Resources(resources,SMDListViewWindow.class.getName()));
                     window.open(getDisplay(), getWindow());
                 } catch (IOException e) {
                     throw new RuntimeException(e);
                 } catch (SerializationException e) {
                     throw new RuntimeException(e);
                 }
             }
         });

        preferencesButton.getButtonPressListeners().add(new ButtonPressListener() {
             @Override
             public void buttonPressed(Button button) {
                 try {
                     BXMLSerializer wtkxSerializer = new BXMLSerializer();
                     SMDPreferencesWindow window = (SMDPreferencesWindow) wtkxSerializer.readObject(getClass().getResource("SMDPreferencesWindow.bxml"),new Resources(resources,SMDPreferencesWindow.class.getName()));
                     window.open(getDisplay(), getWindow());
                 } catch (IOException e) {
                     throw new RuntimeException(e);
                 } catch (SerializationException e) {
                     throw new RuntimeException(e);
View Full Code Here

        String language = properties.get(LANGUAGE_PROPERTY_NAME);
        if (language != null) {
            Locale.setDefault(new Locale(language));
        }
        PropertiesModule.init(properties);
        Resources resources = new Resources(SMDApplicationWindow.class.getName());
        BXMLSerializer wtkxSerializer = new BXMLSerializer();
        window = (SMDApplicationWindow) wtkxSerializer.readObject(getClass().getResource("SMDApplicationWindow.bxml"), resources);
        window.open(display);
    }
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

                    String variableValue = JSON.get(namespace, src);
                    src = variableValue;
                }
            }

            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

    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;

                    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 (!Character.isUpperCase(attribute.localName.charAt(0))) {
                                throw new SerializationException("Instance property setters are not"
                                    + " supported for " + WTKX_PREFIX + ":" + INCLUDE_TAG
                                    + " " + " tag.");
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().name());
        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().name());
        testString();

    }
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.