/** * 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(); }
@Override protected Dockable getDockable() { return representative.getElement().asDockable(); }
private Dockable getDockable(){ if( source == null ){ return null; } return source.getElement().asDockable(); }
@Override public String toString(){ Dockable dockable = component.getElement().asDockable(); if( dockable == null ) return getClass().getSimpleName() + "@[component=" + component + "]"; else return getClass().getSimpleName() + "@[dockable title=" + dockable.getTitleText() + "]"; } }
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 changed( DockElement item ){ Dockable dockable = item.asDockable(); if( dockable != null && items.contains( dockable )){ setDisabled( dockable, isDisabled( dockable ) ); } } };
public void changed( DockElement item ){ Dockable dockable = item.asDockable(); if( dockable != null && items.contains( dockable )){ setDisabled( dockable, isDisabled( dockable ) ); } } };
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 boolean isDisabled( DockElement item ){ Dockable dockable = item.asDockable(); if( dockable != null && dockable instanceof CommonDockable ){ return !((CommonDockable)dockable).getDockable().isEnabled( EnableableItem.SELF ); } return false; }
public boolean isDisabled( DockElement item ){ Dockable dockable = item.asDockable(); if( dockable instanceof CommonDockable ){ return !((CommonDockable)dockable).getDockable().isEnabled( EnableableItem.SELF ); } return false; }
/** * 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 changed( DockElement item ){ Dockable dockable = item.asDockable(); if( dockable != null && dockables.contains( dockable )){ setDisabled( dockable, getValue().isDisabled( dockable, action ) ); } }
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 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 ); }