1
2
3
4
5
6
7
8
9
10
11
12
13 package com/eviware/soapui/package-summary.html">> com.eviware.soapui;
14
15 import java.awt.Color;
16 import java.awt.Insets;
17
18 import javax.swing.UIManager;
19 import javax.swing.plaf.ColorUIResource;
20
21 import com.eviware.soapui.settings.UISettings;
22 import com.eviware.soapui.ui.desktop.DesktopRegistry;
23 import com.eviware.soapui.ui.desktop.standalone.StandaloneDesktopFactory;
24 import com.jgoodies.looks.plastic.PlasticXPLookAndFeel;
25 import com.jgoodies.looks.plastic.theme.SkyBluer;
26
27 public class StandaloneSoapUICore extends SwingSoapUICore
28 {
29
30 public StandaloneSoapUICore( boolean init )
31 {
32 super();
33
34 if( init )
35 init( DEFAULT_SETTINGS_FILE );
36 }
37
38 public StandaloneSoapUICore( String settingsFile )
39 {
40 super( null, settingsFile );
41 }
42
43 public void prepareUI()
44 {
45 super.prepareUI();
46
47 initSoapUILookAndFeel();
48 DesktopRegistry.getInstance().addDesktop( SoapUI.DEFAULT_DESKTOP, new StandaloneDesktopFactory() );
49 }
50
51 public void initSoapUILookAndFeel()
52 {
53 try
54 {
55 if( getSettings().getBoolean( UISettings.NATIVE_LAF ))
56 {
57 javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
58 }
59 else
60 {
61 SoapUITheme theme = new SoapUITheme();
62
63 PlasticXPLookAndFeel.setCurrentTheme( theme );
64 PlasticXPLookAndFeel.setTabStyle( "Metal" );
65
66 UIManager.setLookAndFeel( new PlasticXPLookAndFeel() );
67 UIManager.put( "TabbedPane.tabAreaInsets", new Insets( 3, 2, 0, 0 ) );
68 UIManager.put( "TabbedPane.unselectedBackground", new Color( 220, 220, 220 ) );
69 UIManager.put( "TabbedPane.selected", new Color( 240, 240, 240 ) );
70
71 PlasticXPLookAndFeel.setPlasticTheme( theme );
72 }
73 }
74 catch( Throwable e )
75 {
76 System.err.println( "Error initializing PlasticXPLookAndFeel; " + e.getMessage() );
77 }
78 }
79
80 /***
81 * Adapted theme for soapUI Look and Feel
82 *
83 * @author ole.matzura
84 */
85
86 public static class SoapUITheme extends SkyBluer
87 {
88 public static final Color BACKGROUND_COLOR = new Color( 240, 240, 240 );
89
90 public ColorUIResource getControl()
91 {
92 return new ColorUIResource( BACKGROUND_COLOR );
93 }
94
95 public ColorUIResource getMenuBackground()
96 {
97 return getControl();
98 }
99
100 public ColorUIResource getMenuItemBackground()
101 {
102 return new ColorUIResource( new Color( 248, 248, 248 ) );
103 }
104 }
105 }