public void actionsAdded( DockActionSource source, int firstIndex, int lastIndex ) { for( int i = firstIndex; i <= lastIndex; i++ ){ DockAction action = source.getDockAction( i ); actions.add( i, action ); action.bind( dockable ); } }
public void actionsAdded( DockActionSource source, int firstIndex, int lastIndex ) { for( int i = firstIndex; i<=lastIndex; i++ ){ DockAction action = source.getDockAction( i ); ActionItem item = new ActionItem(); item.action = action; actions.add( i, item ); MenuViewItem<JComponent> handler = handlerFor( action ); if( handler != null ){ action.bind( dockable ); handler.bind(); item.handler = handler; item.bind(); } } reput(); }
private void createView(){ if( bound && controller != null ){ if( dockable == null ){ throw new IllegalStateException( "trying to bind the item without knowing its dockable" ); } action.bind( dockable ); view = action.createView( TOOLBAR, controller.getActionViewConverter(), dockable ); if( view != null ){ updateOrientation(); view.bind(); content.add( view.getItem() ); JComponent item = view.getItem(); for( MouseInputListener listener : mouseListeners ){ item.addMouseListener( listener ); item.addMouseMotionListener( listener ); } } } }
public void actionsAdded( DockActionSource source, int firstIndex, int lastIndex ) { for( int i = firstIndex; i <= lastIndex; i++ ){ DockAction action = source.getDockAction( i ); ActionItem entry = new ActionItem(); entry.action = action; if( dockable.getController() != null ){ BasicTitleViewItem<JComponent> item = createItemFor( action, dockable ); entry.item = item; if( item != null ){ action.bind( dockable ); item.bind(); item.setOrientation( orientation ); item.setForeground( getForeground() ); item.setBackground( getBackground() ); } } actions.add( i, entry ); } visibleActions = actions.size(); resetVisibleActions(); revalidate(); } public void actionsRemoved( DockActionSource source, int firstIndex, int lastIndex ) {
public void actionsAdded( DockActionSource source, int firstIndex, int lastIndex ) { for( int i = firstIndex; i <= lastIndex; i++ ){ DockAction action = source.getDockAction( i ); ActionItem entry = new ActionItem(); entry.action = action; if( dockable.getController() != null ){ BasicTitleViewItem<JComponent> item = createItemFor( action, dockable ); entry.item = item; if( item != null ){ action.bind( dockable ); item.bind(); item.setOrientation( orientation ); item.setForeground( getForeground() ); item.setBackground( getBackground() ); } } actions.add( i, entry ); } visibleActions = actions.size(); resetVisibleActions(); revalidate(); } public void actionsRemoved( DockActionSource source, int firstIndex, int lastIndex ) {
@Override public void bind() { super.bind(); source.addDockActionSourceListener( sourceListener ); for( int i = 0, n = source.getDockActionCount(); i<n; i++ ){ DockAction action = source.getDockAction( i ); ActionItem item = new ActionItem(); item.action = action; actions.add( item ); MenuViewItem<JComponent> handler = handlerFor( action ); if( handler != null ){ item.handler = handler; item.bind(); item.action.bind( dockable ); handler.bind(); if( handler.getItem() != null ){ menu.add( handler.getItem() ); } } } }
BasicTitleViewItem<JComponent> item = createItemFor( action, dockable ); if( item != null ){ action.bind( dockable ); item.bind(); actionItem.item = item;
BasicTitleViewItem<JComponent> item = createItemFor( action, dockable ); if( item != null ){ action.bind( dockable ); item.bind(); actionItem.item = item;