Announcement Announcement Module
Collapse
No announcement yet.
toolbar buttons with dropdown menu Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • toolbar buttons with dropdown menu

    I'm looking for an implementation of a toolbar button that includes a "drop down" menu. You can find this on lots of recent UI's (like eclipse) for a toolbar action that offers a series of options (like the run command, or the previous searches, etc.).

    What I'm wondering is if anyone has created such a thing for RCP? I'd like to offer a "recent searches" toolbar button using this model.

    If anyone has any pointers, that'd be great!

    Thanks.
    Larry.

  • #2
    I had thought that Jide had gotten theirs from someone else,

    but I can't find out where, at least not at the moment.

    Hmm... I know Santhosh Kumar is doing some stuff with or
    for them or something like that, so I found this link:

    http://www.jroller.com/page/santhosh...tton_for_swing

    If you look at the next several blog posts, he does some other stuff too.

    Comment


    • #3
      Hi Larry

      I am using the Jide Split Button. Of course this is not free you have to buy the Jide component suite.

      I had a few issues with integrating it into Spring. What I ended up doing was creating a JideSplitButtonCommand and overode the call to
      Code:
      createButton(String faceDescriptorId, ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer)
      to return an instanceof JideSplitButton. Not sure if this was the proper way to do this, but it worked.

      Trevor

      Comment


      • #4
        Larry, did you get this working?

        I have a similar need and would prefer to stick with open source solutions.

        Larry, did you get this drop down menu on the toolbar thing working?

        Did you use Santhosh Kumar's solution, or something else?

        If you used Santhosh's solution, how did you link it into Spring? It looks like I'd have to extend Avogadro's number of classes...

        -K

        Comment


        • #5
          FYI, the JideSplitButton is now part of their 'Common Layer' that they've put into open source. The site for that project is https://jide-oss.dev.java.net/.

          I too use the JIDE solution, and it can be a little tricky to integrate into Spring RCP. Here's an example of one way I've done it.

          Code:
          private class StructureCommand extends ActionCommand{
          	private static final String ID = "structureCommand";
          
          	private JideSplitButton structureButton = null;
          		
          	public StructureCommand(){
          		super(ID);
          	}
          		
          	protected void doExecuteCommand() {
          	}
          		
          	public AbstractButton createButton(String arg0, ButtonFactory arg1,
          			CommandButtonConfigurer arg2) {
          		AbstractButton button = createSplitButton();
          		return button;
          	}
          		
          	// Maybe move this to a button factory implementation?
          	private JideSplitButton createSplitButton(){
          		structureButton = new JideSplitButton(getActionAdapter());
          		structureButton.setText(null);
          			
          		CommandGroup.createCommandGroup(
          	    		"structureCommandGroup", 
              			new Object[] {defaultCommand, meshRibbonCommand, ribbonsCommand, 
          	    			strandsCommand, cartoonsCommand,
          	    			rocketsCommand, traceCommand});
          			
          		ButtonGroup group = new ButtonGroup();
          			
          		JMenuItem defaultItem = new JRadioButtonMenuItem(defaultCommand.getActionAdapter());
          		defaultItem.setSelected(true);
          		group.add(defaultItem);
          		structureButton.add(defaultItem);
          			
          		JMenuItem meshRibbon = 
          				new JRadioButtonMenuItem(meshRibbonCommand.getActionAdapter());
          		group.add(meshRibbon);
          		structureButton.add(meshRibbon);
          			
          		JMenuItem ribbons = 
          			new JRadioButtonMenuItem(ribbonsCommand.getActionAdapter());
          		group.add(ribbons);
          		structureButton.add(ribbons);
          			
          		JMenuItem strand = 
          			new JRadioButtonMenuItem(strandsCommand.getActionAdapter());
          		group.add(strand);
          		structureButton.add(strand);
          			
          		JMenuItem cartoon = 
          			new JRadioButtonMenuItem(cartoonsCommand.getActionAdapter());
          		group.add(cartoon);
          		structureButton.add(cartoon);
          			
          		JMenuItem rockets = 
          			new JRadioButtonMenuItem(rocketsCommand.getActionAdapter());
          		group.add(rockets);
          		structureButton.add(rockets);
          			
          		JMenuItem trace = 
          			new JRadioButtonMenuItem(traceCommand.getActionAdapter());
          		group.add(trace);
          		structureButton.add(trace);
          			
          		return structureButton;
          	}
          }
          hope this helps,

          Jonny

          Comment


          • #6
            Thanks, I'll try the JIDE common layer. -K

            Comment

            Working...
            X