Examples of URLProvider


Examples of net.sf.myjaut.URLProvider

        super(createDummyFrameForRightIcon(iconFileName));
        JPanel root = new JPanel();
        root.setLayout(new BorderLayout());
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        try {
            JLabel image = new JLabel(new ImageIcon(new URLProvider(imageFileName).getImage()));
            image.setBorder(new EmptyBorder(0,0,0,0));
            root.add(image, BorderLayout.CENTER);
            progress = new JProgressBar(0, 100);
            progress.setString(label);
            progress.setStringPainted(true);
View Full Code Here

Examples of net.sf.myjaut.URLProvider

    }

    private static JFrame createDummyFrameForRightIcon(final String iconFileName) {
        try {
            JFrame frame = new JFrame();
            frame.setIconImage(new URLProvider(iconFileName).getImage());
            return frame;
        }
        catch (HeadlessException exc) {
            throw new IllegalStateException(exc);
        }
View Full Code Here

Examples of net.sf.myjaut.URLProvider

    }

    private String getVersion(String file, String type) throws VersionProvisionException {
        Properties properties = new Properties();
        try {
            properties.load(new URLProvider(file).getStream());
            return properties.getProperty(type);
        }
        catch (MalformedURLException exc) {
            throw new VersionProvisionException(exc);
        }
View Full Code Here

Examples of net.sf.myjaut.URLProvider

   
    public List<Locale> getLocales() {
        List<Locale> result = new LinkedList<Locale>();
        BufferedReader br;
        try {
            br = new URLProvider(LOCALES_FILE, LOCALES_DIR).getBufferedReader();
            while (br.ready())
                result.add(new Locale(br.readLine()));
        }
        catch (IOException exc) {
            // This shouldn't happen: languages config file should be in JAR.
View Full Code Here

Examples of net.sf.myjaut.URLProvider

        ButtonGroup group = new ButtonGroup();
        for (final Locale language : i18nManager.getLocales()) {
            JMenuItem mnuItem = new JRadioButtonMenuItem(i18nManager.getLocaleName(language), i18nManager.getCurrentLocale().equals(language));
            mnuItem.setMnemonic(i18nManager.getLocaleName(language).charAt(0));
            try {
                mnuItem.setIcon(new ImageIcon(new URLProvider("icons/flags/" + language + ".gif").getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH)));
            }
            catch (IOException exc) {
                // This shouldn't happen: icons are in JAR.
            }
            mnuItem.addActionListener(new ActionListener() {
View Full Code Here

Examples of net.sf.myjaut.URLProvider

import net.sf.myjaut.cmd.DelayedCommand;

public class SoundPlayer {
    public void play(String soundFile) throws CannotPlaySoundException {
        try {
            final AudioClip newAudioClip = java.applet.Applet.newAudioClip(new URLProvider(soundFile).getURL());
            new DelayedCommand<Exception>(new Command<Exception>() {
                public void execute() {
                        newAudioClip.play();
                }
            }, null).execute();
View Full Code Here

Examples of net.sf.myjaut.URLProvider

            public void handle(Node node, XmlHandler<Exception> xh) throws Exception {
                emailByLocale.put(locales.getLast(), node.getTextContent());
            }
        });
        try {
            new XmlHandler<Exception>(new URLProvider(LOCALES_CATALOG_FILE, LOCALES_DIR).getStream(), templates).execute();
        }
        catch (MalformedURLException exc) {
            throw new IllegalStateException();
        }
        catch (IOException exc) {
View Full Code Here

Examples of net.sf.myjaut.URLProvider

    public void setMessage(String key) {
        this.key = key;
        // TODO fix label vs. message size
        try {
            Image image = new URLProvider(imagePath).getImage();
            imageLabel.setIcon(i18n.getValue(key) != null
                    ? new ImageIcon(image)
                    : null);
        }
        catch (IOException exc) {
View Full Code Here

Examples of org.apache.struts2.components.UrlProvider

        // JAVASCRIPT ?
        if (action.startsWith("javascript:"))
            return action;

        // Init URL Provider
        UrlProvider urlProvider = new ComponentUrlProvider(this, parameters);
        urlProvider.setHttpServletRequest(request);
        urlProvider.setHttpServletResponse(response);
        urlProvider.setUrlRenderer(urlRenderer);
      urlProvider.setPortletUrlType(urlType);
        urlProvider.setAction(action);
        // render URL
        StringWriter sw = new StringWriter();
        urlRenderer.beforeRenderUrl(urlProvider);
        urlRenderer.renderUrl(sw, urlProvider);
        String url = sw.toString();
View Full Code Here

Examples of org.apache.struts2.components.UrlProvider

        // JAVASCRIPT ?
        if (actionName.startsWith("javascript:"))
            return actionName;

        // Init URL Provider
        UrlProvider urlProvider = new ComponentUrlProvider(this, params);
        urlProvider.setHttpServletRequest(request);
        urlProvider.setHttpServletResponse(response);
        urlProvider.setUrlRenderer(urlRenderer);
      // urlProvider.setPortletUrlType(urlType);
        urlProvider.setAction(actionName);
        // render URL
        StringWriter sw = new StringWriter();
        urlRenderer.beforeRenderUrl(urlProvider);
        urlRenderer.renderUrl(sw, urlProvider);
        String url = sw.toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.