/** * Gets the {@link DockAction} which is handled by this model. This method may return <code>null</code> * because not every button actually is connected to a {@link DockAction}. * @return the action or <code>null</code> */ public DockAction getAction(){ if( trigger == null ){ return null; } return trigger.getAction(); }
/** * Gets the {@link Dockable} for which the button is shown. This method may return <code>null</code> * because not every button is connected to a {@link Dockable}. * @return the dockable or <code>null</code> */ public Dockable getDockable(){ if( trigger == null ){ return null; } return trigger.getDockable(); }
/** * Called when the left mouse button has been pressed and released within * the {@link #getOwner() owner} and when this model is {@link #isEnabled() enabled}. */ protected void trigger(){ if( trigger != null ){ trigger.triggered(); } for( BasicButtonModelListener listener : listeners() ){ listener.triggered(); } }