public void actionsAdded( DockActionSource source, int firstIndex, int lastIndex ){ fireAdded( firstIndex, lastIndex ); }
public void actionsRemoved( DockActionSource source, int firstIndex, int lastIndex ){ fireRemoved( firstIndex, lastIndex ); } }
/** * Sets the action-source of this {@link Dockable}. Other elements which * used {@link #getGlobalActionOffers()} will be informed about this change. * @param source The new source, may be <code>null</code> */ public void setActionOffers( DockActionSource source ){ this.source = source; globalSource.update(); }
/** * Updates the list of actions known to this source. */ public void update(){ int oldSize = getDockActionCount(); if( source != null ){ source.removeDockActionSourceListener( listener ); source = null; } if( oldSize > 0 ) fireRemoved( 0, oldSize-1 ); DockController controller = dockable.getController(); if( controller != null ) source = controller.listOffers( dockable ); if( source != null && !listeners.isEmpty() ){ source.addDockActionSourceListener( listener ); } int newSize = getDockActionCount(); if( newSize > 0 ){ fireAdded( 0, newSize-1 ); } }
globalSource = new HierarchyDockActionSource( this ); globalSource.bind();
/** * Updates the list of actions known to this source. */ public void update(){ int oldSize = getDockActionCount(); if( source != null ){ source.removeDockActionSourceListener( listener ); source = null; } if( oldSize > 0 ) fireRemoved( 0, oldSize-1 ); DockController controller = dockable.getController(); if( controller != null ) source = controller.listOffers( dockable ); if( source != null && !listeners.isEmpty() ){ source.addDockActionSourceListener( listener ); } int newSize = getDockActionCount(); if( newSize > 0 ){ fireAdded( 0, newSize-1 ); } }
globalSource = new HierarchyDockActionSource(this); globalSource.bind();
globalSource = new HierarchyDockActionSource(this); globalSource.bind();
/** * Creates a new source. * @param dockable the Dockable to observe */ public HierarchyDockActionSource( Dockable dockable ){ this.dockable = dockable; update(); }
public void actionsRemoved( DockActionSource source, int firstIndex, int lastIndex ){ fireRemoved( firstIndex, lastIndex ); } }
public void actionsAdded( DockActionSource source, int firstIndex, int lastIndex ){ fireAdded( firstIndex, lastIndex ); }
/** * Creates a new source. * @param dockable the Dockable to observe */ public HierarchyDockActionSource( Dockable dockable ){ this.dockable = dockable; update(); }
public void hierarchyChanged( DockHierarchyEvent event ){ update(); }
public void hierarchyChanged( DockHierarchyEvent event ){ update(); }
public void controllerChanged( DockHierarchyEvent event ){ update(); } public void hierarchyChanged( DockHierarchyEvent event ){
public void controllerChanged( DockHierarchyEvent event ){ update(); } public void hierarchyChanged( DockHierarchyEvent event ){
/** * Ensures that this source observes its Dockable. */ public void bind(){ if( bound == 0 ){ dockable.addDockHierarchyListener( listener ); update(); } bound++; }
/** * Ensures that this source observes its Dockable. */ public void bind(){ if( bound == 0 ){ dockable.addDockHierarchyListener( listener ); update(); } bound++; }