private void initInputListener( DockController controller ){
controller.getKeyboardController().addListener( new KeyboardListener(){
public boolean keyPressed( DockElement element, KeyEvent event ) {
if( element instanceof CommonDockable ){
CDockable source = ((CommonDockable)element).getDockable();
CDockableAccess access = accesses.get( source );
if( access != null ){
if( access.getKeyboardListener().keyPressed( source, event ))
return true;
}
return listenerCollection.getKeyboardListener().keyPressed( source, event );
}
return false;
}
public boolean keyReleased( DockElement element, KeyEvent event ) {
if( element instanceof CommonDockable ){
CDockable source = ((CommonDockable)element).getDockable();
CDockableAccess access = accesses.get( source );
if( access != null ){
if( access.getKeyboardListener().keyReleased( source, event ))
return true;
}
return listenerCollection.getKeyboardListener().keyReleased( source, event );
}
return false;
}
public boolean keyTyped( DockElement element, KeyEvent event ) {
if( element instanceof CommonDockable ){
CDockable source = ((CommonDockable)element).getDockable();
CDockableAccess access = accesses.get( source );
if( access != null ){
if( access.getKeyboardListener().keyTyped( source, event ))
return true;
}
return listenerCollection.getKeyboardListener().keyTyped( source, event );
}
return false;
}
public DockElement getTreeLocation() {
return null;
}
});
controller.getDoubleClickController().addListener( new DoubleClickListener(){
public boolean process( Dockable dockable, MouseEvent event ) {
if( dockable instanceof CommonDockable ){
CDockable source = ((CommonDockable)dockable).getDockable();
CDockableAccess access = accesses.get( source );
if( access != null ){
if( access.getDoubleClickListener().clicked( source, event ))
return true;
}