| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package docrobot; |
| 20 |
|
| 21 |
import java.awt.Component; |
| 22 |
import java.util.Map; |
| 23 |
|
| 24 |
import javax.swing.*; |
| 25 |
import javax.swing.plaf.ComponentUI; |
| 26 |
|
| 27 |
import org.fest.swing.core.BasicRobot; |
| 28 |
import org.fest.swing.core.Robot; |
| 29 |
import org.pushingpixels.substance.api.SubstanceLookAndFeel; |
| 30 |
import org.pushingpixels.substance.api.SubstanceSkin; |
| 31 |
import org.pushingpixels.substance.api.skin.SkinInfo; |
| 32 |
import org.pushingpixels.substance.swingx.SubstanceErrorPaneUI; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public class ErrorPaneRunner { |
| 40 |
public static class MyErrorPaneUI extends SubstanceErrorPaneUI { |
| 41 |
public static ComponentUI createUI(JComponent c) { |
| 42 |
return new MyErrorPaneUI(); |
| 43 |
} |
| 44 |
|
| 45 |
@Override |
| 46 |
public JDialog getErrorDialog(Component owner) { |
| 47 |
JDialog result = super.getErrorDialog(owner); |
| 48 |
result.setModal(false); |
| 49 |
return result; |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
public static void main(String[] args) throws Exception { |
| 61 |
JFrame.setDefaultLookAndFeelDecorated(true); |
| 62 |
UIManager.put("ErrorPaneUI", MyErrorPaneUI.class.getName()); |
| 63 |
|
| 64 |
String subfolder = "errorpane"; |
| 65 |
Map<String, SkinInfo> skins = SubstanceLookAndFeel.getAllSkins(); |
| 66 |
Robot robot = BasicRobot.robotWithNewAwtHierarchy(); |
| 67 |
for (Map.Entry<String, SkinInfo> skinEntry : skins.entrySet()) { |
| 68 |
String key = skinEntry.getKey(); |
| 69 |
String normalized = key.toLowerCase().replaceAll(" ", ""); |
| 70 |
new ErrorPaneRobot((SubstanceSkin) Class.forName( |
| 71 |
skinEntry.getValue().getClassName()).newInstance(), |
| 72 |
"C:/jprojects/substance-swingx/www/images/" + subfolder |
| 73 |
+ "/" + normalized, robot).run(); |
| 74 |
} |
| 75 |
} |
| 76 |
} |