/** * Searches all registered {@link DockElementRepresentative} whose element is <code>element</code>. * @param element the element whose {@link DockElementRepresentative} are searched * @return the representatives, may include <code>element</code> as well */ public DockElementRepresentative[] getRepresentatives( DockElement element ){ List<DockElementRepresentative> result = new ArrayList<DockElementRepresentative>(); for( DockElementRepresentative representative : componentToDockElements.values() ){ if( representative.getElement() == element ){ result.add( representative ); } } return result.toArray( new DockElementRepresentative[ result.size() ] ); }
/** * Creates a new listener * @param representative the element which will be observed */ public MouseRepresentativeListener( Listener parent, DockElementRepresentative representative ){ this.parent = parent; this.representative = representative; if( representative instanceof DockTitle ) title = (DockTitle)representative; dockable = representative.getElement().asDockable(); }
private Dockable getDockable(){ if( source == null ){ return null; } return source.getElement().asDockable(); }
/** * Creates a new listener * @param representative the element which will be observed */ public MouseRepresentativeListener( DockElementRepresentative representative ){ this.representative = representative; if( representative instanceof DockTitle ) title = (DockTitle)representative; dockable = representative.getElement().asDockable(); }
@Override protected Dockable getDockable() { return representative.getElement().asDockable(); }
@Override protected Dockable getDockable() { return representative.getElement().asDockable(); }
public void representativeRemoved( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ ComponentObserver observer = listeners.remove( representative ); if( observer != null ){ representative.removeMouseInputListener( observer ); } } }
public void representativeRemoved( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ ComponentObserver observer = listeners.remove( representative ); if( observer != null ){ representative.removeMouseInputListener( observer ); } } }
public void representativeRemoved( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ MouseRepresentativeListener listener = listeners.remove( representative ); if( listener != null ){ representative.removeMouseInputListener( listener ); } if( listener == lastActiveListener ){ lastActiveListener = null; } } }
public void representativeRemoved( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ MouseRepresentativeListener listener = listeners.remove( representative ); if( listener != null ){ representative.removeMouseInputListener( listener ); } } } }
/** * Gets the {@link Dockable} which receives the focus through this request. * @return the dockable or <code>null</code> */ public Dockable getDockable(){ DockElementRepresentative source = request.getSource(); if( source == null ){ return null; } return source.getElement().asDockable(); }
/** * Gets the {@link Dockable} which receives the focus through this request. * @return the dockable or <code>null</code> */ public Dockable getDockable(){ DockElementRepresentative source = request.getSource(); if( source == null ){ return null; } return source.getElement().asDockable(); }
public void representativeAdded( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ ComponentObserver observer = new ComponentObserver( representative ); listeners.put( representative, observer ); representative.addMouseInputListener( observer ); } }
public void representativeAdded( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ MouseRepresentativeListener listener = new MouseRepresentativeListener( this, representative ); listeners.put( representative, listener ); representative.addMouseInputListener( listener ); } } public void representativeRemoved( DockController controller,
public void representativeAdded( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ ComponentObserver observer = new ComponentObserver( representative ); listeners.put( representative, observer ); representative.addMouseInputListener( observer ); } }
public void representativeAdded( DockController controller, DockElementRepresentative representative ) { if( representative.getElement().asDockable() != null ){ MouseRepresentativeListener listener = new MouseRepresentativeListener( representative ); listeners.put( representative, listener ); representative.addMouseInputListener( listener ); } } public void representativeRemoved( DockController controller,
public void run(){ DockElementRepresentative element = getDockable( component, event ); if( element != null ){ Dockable dock = element.getElement().asDockable(); if( dock != null ){ controller.setFocusedDockable( new DefaultFocusRequest( dock, component, false, ensureFocus, element.shouldTransfersFocus() )); } } } });
public void run(){ DockElementRepresentative element = getDockable( component, event ); if( element != null ){ Dockable dock = element.getElement().asDockable(); if( dock != null ){ controller.setFocusedDockable( new DefaultFocusRequest( dock, component, false, ensureFocus, element.shouldTransfersFocus() )); } } } });
@Override public void setFocusedDockable( FocusRequest request ){ if( request.getSource() != null ){ Dockable focusedDockable = request.getSource().getElement().asDockable(); CLocationModeManager states = owner.getLocationManager(); if( states != null && !states.isOnTransaction() && focusedDockable != null ){ states.ensureNotHidden( focusedDockable ); } } super.setFocusedDockable( request ); }
@Override public void setFocusedDockable( FocusRequest request ){ if( request.getSource() != null ){ Dockable focusedDockable = request.getSource().getElement().asDockable(); CLocationModeManager states = owner.getLocationManager(); if( states != null && !states.isOnTransaction() && focusedDockable != null ){ states.ensureNotHidden( focusedDockable ); } } super.setFocusedDockable( request ); }