From: <sh...@us...> - 2008-08-15 11:47:47
|
Revision: 13325 http://jedit.svn.sourceforge.net/jedit/?rev=13325&view=rev Author: shlomy Date: 2008-08-15 11:47:44 +0000 (Fri, 15 Aug 2008) Log Message: ----------- Added an option pane for selecting the theme. Modified Paths: -------------- plugins/DockingFramesPlugin/trunk/DockingFramesPlugin.props plugins/DockingFramesPlugin/trunk/src/dockingFrames/DfWindowManager.java Modified: plugins/DockingFramesPlugin/trunk/DockingFramesPlugin.props =================================================================== --- plugins/DockingFramesPlugin/trunk/DockingFramesPlugin.props 2008-08-15 10:25:01 UTC (rev 13324) +++ plugins/DockingFramesPlugin/trunk/DockingFramesPlugin.props 2008-08-15 11:47:44 UTC (rev 13325) @@ -14,4 +14,12 @@ plugin.dockingFrames.Plugin.depend.0=jdk 1.5 plugin.dockingFrames.Plugin.depend.1=jedit 04.03.15.00 +# Options +plugin.dockingFrames.Plugin.option-pane=dockingFrames +options.dockingFrames.label=DockingFramesPlugin +options.dockingFrames.code=new dockingFrames.DfOptionPane(); +# Option pane labels +options.dockingFrames.theme.label=Dock theme: + + Modified: plugins/DockingFramesPlugin/trunk/src/dockingFrames/DfWindowManager.java =================================================================== --- plugins/DockingFramesPlugin/trunk/src/dockingFrames/DfWindowManager.java 2008-08-15 10:25:01 UTC (rev 13324) +++ plugins/DockingFramesPlugin/trunk/src/dockingFrames/DfWindowManager.java 2008-08-15 11:47:44 UTC (rev 13325) @@ -17,9 +17,9 @@ import org.gjt.sp.jedit.gui.DockableWindowFactory; import org.gjt.sp.jedit.gui.DockableWindowManager; -import bibliothek.extension.gui.dock.theme.EclipseTheme; import bibliothek.gui.DockController; import bibliothek.gui.DockStation; +import bibliothek.gui.DockUI; import bibliothek.gui.Dockable; import bibliothek.gui.dock.DefaultDockable; import bibliothek.gui.dock.SplitDockStation; @@ -27,6 +27,7 @@ import bibliothek.gui.dock.dockable.DefaultDockableFactory; import bibliothek.gui.dock.layout.PredefinedDockSituation; import bibliothek.gui.dock.station.split.SplitDockPathProperty; +import bibliothek.gui.dock.themes.ThemeFactory; import bibliothek.util.xml.XElement; import bibliothek.util.xml.XIO; @@ -47,6 +48,7 @@ private Factory factory; private JPanel mainPanel; private PredefinedDockSituation situation; + private String theme; public DfWindowManager(View view, DockableWindowFactory instance, ViewConfig config) { @@ -55,7 +57,7 @@ situation = new PredefinedDockSituation(); stations = new HashMap<String, DockStation>(); controller = new DockController(); - controller.setTheme(new EclipseTheme()); + setTheme(DfOptionPane.getThemeName()); center = new SplitDockStation(); stations.put(CENTER, center); add(center.getComponent(), BorderLayout.CENTER); @@ -70,6 +72,16 @@ PerspectiveManager.setPerspectiveDirty(true); } + private void setTheme(String name) { + ThemeFactory[] themes = DockUI.getDefaultDockUI().getThemes(); + for (ThemeFactory t: themes) { + if (t.getName().equals(name)) { + controller.setTheme(t.create()); + theme = name; + break; + } + } + } public PredefinedDockSituation getDockSituation() { return situation; } @@ -183,6 +195,14 @@ } @Override + protected void propertiesChanged() { + super.propertiesChanged(); + String selectedTheme = DfOptionPane.getThemeName(); + if (! selectedTheme.equals(theme)) + setTheme(selectedTheme); + } + + @Override public void setMainPanel(JPanel panel) { mainPanel = panel; JEditDockable d = new JEditDockable(MAIN, MAIN, panel); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |