public void actionTextChanged( StandardDockAction action, Set<Dockable> dockables ){ if( dockables.contains( getDockable() )) update(); }
public void actionTooltipTextChanged( StandardDockAction action, Set<Dockable> dockables ){ if( dockables.contains( getDockable() )) update(); }
public void actionRepresentativeChanged( StandardDockAction action, Set<Dockable> dockables ){ if( dockables.contains( getDockable() )) update(); }
public void actionIconChanged( StandardDockAction action, ActionContentModifier modifier, Set<Dockable> dockables ){ if( dockables.contains( getDockable() )) update(); }
public void showTextChanged( ButtonContentFilter filter, Dockable dockable, DockAction action ){ if( (action == null || action == getAction()) && (dockable == null || dockable == getDockable())){ buttonView.updateText(); } } };
public void actionEnabledChanged( StandardDockAction action, Set<Dockable> dockables ){ Dockable dockable = getDockable(); if( dockables.contains( dockable )) getModel().setEnabled( action.isEnabled( dockable ) ); }
private void ensureDropDownIcon(){ if( dropDownIcon == null ){ dropDownIcon = new DropDownIcon(); if( isBound() ){ dropDownIcon.init( getDockable(), getAction(), this ); dropDownIcon.setController( getDockable().getController() ); } } }
@Override protected void valueChanged( ButtonContentFilter oldValue, ButtonContentFilter newValue ){ if( isBound() ){ if( oldValue != null ){ oldValue.removeListener( buttonContentFilterListener ); oldValue.uninstall( getDockable(), getAction() ); } if( newValue != null ){ newValue.addListener( buttonContentFilterListener ); newValue.install( getDockable(), getAction() ); } } buttonView.updateText(); } };
/** * Adds an action into the list of all known actions. * @param index the location of the action * @param action the new action */ private void add( int index, DockAction action ){ Dockable dockable = getDockable(); actions.add( index, action ); DropDownViewItem item = action.createView( ViewTarget.DROP_DOWN, dockable.getController().getActionViewConverter(), dockable ); if( item != null ){ DropDownItemHandle entry = new DropDownItemHandle( action, item, dockable, getAction() ); entry.bind(); items.put( action, entry ); if( item.getItem() != null ){ menu.add( item.getItem() ); } } }
/** * Updates the text that is shown by the button, respects the {@link BasicDropDownButtonHandler#buttonContentFilter}. */ public void updateText(){ if( buttonContentFilter.getValue().showText( getDockable(), getAction() )){ getModel().setText( text ); } else{ getModel().setText( null ); } }
public void unbind(){ DropDownAction action = getAction(); Dockable dockable = getDockable();
public void bind(){ DropDownAction action = getAction(); Dockable dockable = getDockable(); dropDownIcon.init( getDockable(), getAction(), this );