Really useful software project management and source code hosting.    tell me more...
BROWSE: projects / users / groups
Public clone: git://codaset.com/jens-riboe/droidatscreen.git
star_disabled Dashboard Source Tickets Wiki Blog Network


Really Useful Social coding!

Codaset is an open system, so you can browse and search through all the open source projects, and check out what your friends are coding. Follow them, befriend them, and fork their code; quickly and easily.
Every single open source project you create is free, so come on and use Codaset at no cost. Your first private or semi-private project is also free. Read more about what it costs after that.
100755 1.918 kb text/plain native file history
 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.ribomation.droidAtScreen.cmd;

import com.ribomation.droidAtScreen.Application;

import javax.swing.*;
import java.util.Set;
import java.util.TreeSet;

/**
 * DESCRIPTION
 *
 * @user jens
 * @date 2010-jan-18 10:35:20
 */
public class LookAndFeelCommand extends Command {
    public LookAndFeelCommand() {
        setLabel("Set Look&Feel");
        setTooltip("Let you choose which Look&Feel to use.");
//        setIcon("quit_16x16");
//        setMnemonic('Q');
    }

    @Override
    protected void doExecute(final Application app) {
        final String lafName = (String) JOptionPane.showInputDialog(app.getAppFrame(),
                "Choose a Look&Feel",
                "Look&Feel",
                JOptionPane.QUESTION_MESSAGE,
                null,
                toNames(UIManager.getInstalledLookAndFeels()),
                UIManager.getLookAndFeel().getName());
        if (lafName == null) return;

        Runnable task = new Runnable() {
            public void run() {
                try {
                    UIManager.setLookAndFeel( findClassName(lafName) );
                    SwingUtilities.updateComponentTreeUI(app.getAppFrame());
                    app.getAppFrame().pack();
                } catch (Exception e) {}
            }
        };
        SwingUtilities.invokeLater(task);
    }

    protected String[] toNames(UIManager.LookAndFeelInfo[] info) {
        Set<String> names = new TreeSet<String>();
        for (UIManager.LookAndFeelInfo i : info) {
            names.add( i.getName() );
        }
        return names.toArray(new String[names.size()]);
    }

    protected String findClassName(String lafName) {
        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if (info.getName().equals(lafName)) {
                return info.getClassName();
            }
        }
        return null;
    }

}