/** Create the default toolbar representation of an array of actions. * Null items in the array will add a separator to the toolbar. * * @param actions actions to show in the generated toolbar * @return a toolbar instance displaying them */ public static JToolBar createToolbarPresenter(SystemAction[] actions) { JToolBar p = new JToolBar(); for (SystemAction action : actions) { if (action == null) { p.addSeparator(); } else if (action instanceof Presenter.Toolbar) { p.add(((Presenter.Toolbar) action).getToolbarPresenter()); } } return p; }
Object obj = cookies[i].instanceCreate(); if (obj instanceof Presenter.Toolbar) { obj = ((Presenter.Toolbar)obj).getToolbarPresenter();
private Component convertToComponent(final Object obj) { Component retVal = null; if (obj instanceof Component) { retVal = (Component)obj; } else { if (obj instanceof Presenter.Toolbar) { retVal = ((Presenter.Toolbar)obj).getToolbarPresenter(); if (obj instanceof JButton) { // tune the presenter a bit ((JButton)obj).setBorderPainted(false); } } else if (obj instanceof Action) { Action a = (Action) obj; JButton button = new JButton(); Actions.connect(button, a); retVal = button; } } return retVal; }
/** Create the default toolbar representation of an array of actions. * Null items in the array will add a separator to the toolbar. * * @param actions actions to show in the generated toolbar * @return a toolbar instance displaying them */ public static JToolBar createToolbarPresenter (SystemAction[] actions) { JToolBar p = new JToolBar (); int i, k = actions.length; for (i = 0; i < k; i++) { if (actions [i] == null) p.addSeparator(); else if (actions [i] instanceof Presenter.Toolbar) p.add (((Presenter.Toolbar)actions [i]).getToolbarPresenter ()); } return p; }
/** Create the default toolbar representation of an array of actions. * Null items in the array will add a separator to the toolbar. * * @param actions actions to show in the generated toolbar * @return a toolbar instance displaying them */ public static JToolBar createToolbarPresenter (SystemAction[] actions) { JToolBar p = new JToolBar (); int i, k = actions.length; for (i = 0; i < k; i++) { if (actions [i] == null) p.addSeparator(); else if (actions [i] instanceof Presenter.Toolbar) p.add (((Presenter.Toolbar)actions [i]).getToolbarPresenter ()); } return p; }
/** Create the default toolbar representation of an array of actions. * Null items in the array will add a separator to the toolbar. * * @param actions actions to show in the generated toolbar * @return a toolbar instance displaying them */ public static JToolBar createToolbarPresenter(SystemAction[] actions) { JToolBar p = new JToolBar(); for (SystemAction action : actions) { if (action == null) { p.addSeparator(); } else if (action instanceof Presenter.Toolbar) { p.add(((Presenter.Toolbar) action).getToolbarPresenter()); } } return p; }
/** Create the default toolbar representation of an array of actions. * Null items in the array will add a separator to the toolbar. * * @param actions actions to show in the generated toolbar * @return a toolbar instance displaying them */ public static JToolBar createToolbarPresenter(SystemAction[] actions) { JToolBar p = new JToolBar(); for (SystemAction action : actions) { if (action == null) { p.addSeparator(); } else if (action instanceof Presenter.Toolbar) { p.add(((Presenter.Toolbar) action).getToolbarPresenter()); } } return p; }
/** Create the default toolbar representation of an array of actions. * Null items in the array will add a separator to the toolbar. * * @param actions actions to show in the generated toolbar * @return a toolbar instance displaying them */ public static JToolBar createToolbarPresenter(SystemAction[] actions) { JToolBar p = new JToolBar(); for (SystemAction action : actions) { if (action == null) { p.addSeparator(); } else if (action instanceof Presenter.Toolbar) { p.add(((Presenter.Toolbar) action).getToolbarPresenter()); } } return p; }