/** * Updates the text of the {@link #getView() view}. * @param selection the selected item, ignored by the default implementation */ protected void updateText( DropDownViewItem selection ){ if( text == null ) getView().setText( getAction().getText( getDockable() ) ); else getView().setText( text ); }
/** * Updates the text of the {@link #getView() view}. * @param selection the selected item, ignored by the default implementation */ protected void updateText( DropDownViewItem selection ){ if( text == null ) getView().setText( getAction().getText( getDockable() ) ); else getView().setText( text ); }
/** * Updates the tooltip of the {@link #getView() view}. * @param selection the selected item, ignored by the default implementation */ protected void updateTooltip( DropDownViewItem selection ){ if( selection == null || !selection.isTriggerable( true ) ){ String tooltip = getAction().getTooltipText( getDockable() ); if( tooltip == null ) tooltip = super.tooltip; if( tooltip == null ) tooltip = getAction().getText( getDockable() ); if( tooltip == null ) tooltip = super.text; getView().setTooltip( tooltip ); } else{ String tooltip = super.tooltip; if( tooltip == null ) tooltip = getAction().getTooltipText( getDockable() ); if( tooltip == null ) tooltip = super.text; if( tooltip == null ) tooltip = getAction().getText( getDockable() ); getView().setTooltip( tooltip ); } } }
/** * Updates the tooltip of the {@link #getView() view}. * @param selection the selected item, ignored by the default implementation */ protected void updateTooltip( DropDownViewItem selection ){ if( selection == null || !selection.isTriggerable( true ) ){ String tooltip = getAction().getTooltipText( getDockable() ); if( tooltip == null ) tooltip = super.tooltip; if( tooltip == null ) tooltip = getAction().getText( getDockable() ); if( tooltip == null ) tooltip = super.text; getView().setTooltip( tooltip ); } else{ String tooltip = super.tooltip; if( tooltip == null ) tooltip = getAction().getTooltipText( getDockable() ); if( tooltip == null ) tooltip = super.text; if( tooltip == null ) tooltip = getAction().getText( getDockable() ); getView().setTooltip( tooltip ); } } }
public void bind(){ action.bind( dockable ); DockActionSource source = action.getSubActions( dockable ); menuAction = new SimpleMenuAction( source ); handler = new MenuMenuHandler( menuAction, dockable, ViewTarget.DROP_DOWN ); menuAction.setText( action.getText( dockable ) ); menuAction.setTooltip( action.getTooltipText( dockable ) ); menuAction.setEnabled( action.isEnabled( dockable ) ); for( ActionContentModifier modifier : action.getIconContexts( dockable )){ menuAction.setIcon( modifier, action.getIcon( dockable, modifier ) ); } handler.bind(); handler.addChildrenActionListener( menuListener ); action.addDockActionListener( listener ); }
public void bind(){ action.bind( dockable ); DockActionSource source = action.getSubActions( dockable ); menuAction = new SimpleMenuAction( source ); handler = new MenuMenuHandler( menuAction, dockable, ViewTarget.DROP_DOWN ); menuAction.setText( action.getText( dockable ) ); menuAction.setTooltip( action.getTooltipText( dockable ) ); menuAction.setEnabled( action.isEnabled( dockable ) ); for( ActionContentModifier modifier : action.getIconContexts( dockable )){ menuAction.setIcon( modifier, action.getIcon( dockable, modifier ) ); } handler.bind(); handler.addChildrenActionListener( menuListener ); action.addDockActionListener( listener ); }