[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-cvs
Subject:    [ jEdit-commits ] SF.net SVN: jedit:[18887] plugins/SideKick/trunk
From:       shlomy () users ! sourceforge ! net
Date:       2010-10-30 6:34:43
Message-ID: E1PC51X-0002E0-PT () sfp-svn-3 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 18887
          http://jedit.svn.sourceforge.net/jedit/?rev=18887&view=rev
Author:   shlomy
Date:     2010-10-30 06:34:43 +0000 (Sat, 30 Oct 2010)

Log Message:
-----------
Toolbar:
- Added an option to use a single icon instead of an icon for each tree node along \
                the path in a single-combo mode.
- Reorganized the option pane to group the toolbar options visually.

Modified Paths:
--------------
    plugins/SideKick/trunk/SideKick.props
    plugins/SideKick/trunk/sidekick/SideKickOptionPane.java
    plugins/SideKick/trunk/sidekick/SideKickToolBar.java

Modified: plugins/SideKick/trunk/SideKick.props
===================================================================
--- plugins/SideKick/trunk/SideKick.props	2010-10-29 22:46:46 UTC (rev 18886)
+++ plugins/SideKick/trunk/SideKick.props	2010-10-30 06:34:43 UTC (rev 18887)
@@ -96,10 +96,13 @@
 options.sidekick.scrollToVisible.label=Scroll to make selection visible as much as \
possible  options.sidekick.scrollToVisible=true
 
-options.sidekick.showToolBar.label=Show the assets in a combo-box (inside a toolbar)
+options.sidekick.toolBar.label=Toolbar options
+options.sidekick.showToolBar.label=Show the toolbar (buffer structure in \
combo-boxes)  sidekick.showToolBar=false
 options.sidekick.splitCombo.label=Use a separate combo-box for each level of the \
tree  sidekick.splitCombo=false
+options.sidekick.singleIconInCombo.label=In single combo-box mode, hide icons of \
parent nodes +sidekick.singleIconInCombo=true
 
 # Default parse on buffer change switch
 sidekick.buffer-change-parse=true

Modified: plugins/SideKick/trunk/sidekick/SideKickOptionPane.java
===================================================================
--- plugins/SideKick/trunk/sidekick/SideKickOptionPane.java	2010-10-29 22:46:46 UTC \
                (rev 18886)
+++ plugins/SideKick/trunk/sidekick/SideKickOptionPane.java	2010-10-30 06:34:43 UTC \
(rev 18887) @@ -36,6 +36,7 @@
 {
 	public static final String SHOW_TOOL_BAR = "sidekick.showToolBar";
 	public static final String SPLIT_COMBO = "sidekick.splitCombo";
+	public static final String SINGLE_ICON_IN_COMBO = "sidekick.singleIconInCombo";
 
 	//{{{ SideKickOptionPane constructor
 	public SideKickOptionPane()
@@ -46,12 +47,22 @@
 	//{{{ _init() method
 	protected void _init()
 	{
-		addComponent(showToolBar = new JCheckBox(jEdit.getProperty(
-			"options.sidekick.showToolBar.label")));
+		JPanel toolbarPanel = new JPanel(new GridLayout(0, 1));
+		toolbarPanel.setBorder(new TitledBorder(jEdit.getProperty(
+			"options.sidekick.toolBar.label")));
+		addComponent(toolbarPanel);
+		showToolBar = new JCheckBox(jEdit.getProperty(
+			"options.sidekick.showToolBar.label"));
 		showToolBar.setSelected(jEdit.getBooleanProperty(SHOW_TOOL_BAR));
-		addComponent(splitCombo = new JCheckBox(jEdit.getProperty(
-			"options.sidekick.splitCombo.label")));
+		toolbarPanel.add(showToolBar);
+		splitCombo = new JCheckBox(jEdit.getProperty(
+			"options.sidekick.splitCombo.label"));
 		splitCombo.setSelected(jEdit.getBooleanProperty(SPLIT_COMBO));
+		toolbarPanel.add(splitCombo);
+		singleIconInCombo = new JCheckBox(jEdit.getProperty(
+			"options.sidekick.singleIconInCombo.label"));
+		singleIconInCombo.setSelected(jEdit.getBooleanProperty(SINGLE_ICON_IN_COMBO));
+		toolbarPanel.add(singleIconInCombo);
 		addComponent(showToolTips = new JCheckBox(jEdit.getProperty(
 			"options.sidekick.showToolTips.label")));
 		showToolTips.setSelected(jEdit.getBooleanProperty(
@@ -221,6 +232,7 @@
 		SideKick.setFollowCaret(treeFollowsCaret.isSelected());
 		jEdit.setBooleanProperty(SHOW_TOOL_BAR, showToolBar.isSelected());
 		jEdit.setBooleanProperty(SPLIT_COMBO, splitCombo.isSelected());
+		jEdit.setBooleanProperty(SINGLE_ICON_IN_COMBO, singleIconInCombo.isSelected());
 		jEdit.setBooleanProperty("sidekick.showToolTips", showToolTips.isSelected());
 		jEdit.setBooleanProperty("sidekick.showStatusWindow", \
showStatusWindow.isSelected());  jEdit.setBooleanProperty("sidekick.scrollToVisible", \
scrollToVisible.isSelected()); @@ -258,6 +270,7 @@
 	private JCheckBox autoCompletePopupGetFocus;
 	private JCheckBox showToolBar;
 	private JCheckBox splitCombo;
+	private JCheckBox singleIconInCombo;
 	private JCheckBox showToolTips;
 	private JCheckBox showStatusWindow;
 	private JTextField acceptChars;

Modified: plugins/SideKick/trunk/sidekick/SideKickToolBar.java
===================================================================
--- plugins/SideKick/trunk/sidekick/SideKickToolBar.java	2010-10-29 22:46:46 UTC (rev \
                18886)
+++ plugins/SideKick/trunk/sidekick/SideKickToolBar.java	2010-10-30 06:34:43 UTC (rev \
18887) @@ -49,6 +49,7 @@
 	private JPanel splitComboPanel;
 	private ArrayList<JComboBox> combos;
 	private ComboCellRenderer renderer;
+	private boolean singleIconInCombo;
 
 	public SideKickToolBar(View view)
 	{
@@ -63,6 +64,8 @@
 			createSplitComboPanel();
 		else
 			createSingleCombo();
+		singleIconInCombo = jEdit.getBooleanProperty(
+			SideKickOptionPane.SINGLE_ICON_IN_COMBO);
 		followCaret = SideKick.isFollowCaret();
 		update();
 		delayMs = jEdit.getIntegerProperty("sidekick.toolBarUpdateDelay", 200);
@@ -108,6 +111,16 @@
 			}
 			update();
 		}
+		else if (! splitCombo)
+		{
+			boolean newSingleIconInCombo = jEdit.getBooleanProperty(
+					SideKickOptionPane.SINGLE_ICON_IN_COMBO);
+			if (newSingleIconInCombo != singleIconInCombo)
+			{
+				singleIconInCombo = newSingleIconInCombo;
+				update();
+			}
+		}
 		delayMs = jEdit.getIntegerProperty("sidekick.toolBarUpdateDelay", 200);
 		boolean newFollowCaret = SideKick.isFollowCaret();
 		if (newFollowCaret != followCaret)
@@ -203,6 +216,8 @@
 
 	private void removeSingleCombo()
 	{
+		if (combo == null)
+			return;
 		remove(combo);
 		combo = null;
 	}
@@ -265,6 +280,8 @@
 
 	private void removeSplitComboPanel()
 	{
+		if (combos == null)
+			return;
 		for (JComboBox c: combos)
 			splitComboPanel.remove(c);
 		combos = null;
@@ -405,7 +422,7 @@
 		}
 	}
 
-	private static class NodeWrapper
+	private class NodeWrapper
 	{
 		public NodeWrapper parent;
 		public String str;
@@ -470,13 +487,31 @@
 		{
 			return (asset != null);
 		}
+		public void addParentLabel(JPanel p, Icon childIcon)
+		{
+			if (parent != null)
+				parent.addParentLabel(p, childIcon);
+			JLabel l = new JLabel();
+			l.setText(str);
+			if (singleIconInCombo)
+			{
+				if ((parent == null) && (childIcon != null))
+					l.setIcon(childIcon);
+			}
+			else
+			{
+				if (icon != null)
+					l.setIcon(icon);
+			}
+			p.add(l);
+		}
 		public void addLabel(JPanel p)
 		{
 			if (parent != null)
-				parent.addLabel(p);
+				parent.addParentLabel(p, icon);
 			JLabel l = new JLabel();
 			l.setText(str);
-			if (icon != null)
+			if ((icon != null) && ((! singleIconInCombo) || (parent == null)))
 				l.setIcon(icon);
 			p.add(l);
 		}


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic