/** * Adds several actions to this source. * @param actions the new actions */ public void add( DockAction... actions ){ add( new DefaultDockActionSource( actions )); }
/** * Creates a new menu */ public CMenu() { super( null ); menu = new DefaultDockActionSource(); init( new CommonSimpleMenuAction( this, menu )); }
/** * Creates a new menu */ public CMenu() { super( null ); menu = new DefaultDockActionSource(); init( new CommonSimpleMenuAction( this, menu )); }
public DockActionSource getSource( Dockable dockable ) { DockInfo info = getInfo( dockable ); if( info == null ){ return new DefaultDockActionSource( new LocationHint( LocationHint.ACTION_GUARD, LocationHint.RIGHT_OF_ALL ), this ); } else{ return info.getSource(); } }
/** * Creates a new guard * @param controller The controller for which actions are created. */ public ReplaceActionGuard( DockController controller ){ if( controller == null ) throw new IllegalArgumentException( "Controller should not be null" ); action = new ReplaceAction( controller ); source = new DefaultDockActionSource(); source.setHint( new LocationHint( LocationHint.ACTION_GUARD, LocationHint.LEFT )); setVisible( true ); }
public DefaultDockActionSource getDirectActionOffers( Dockable dockable ){ if( fullScreenAction == null ) return null; else { DefaultDockActionSource source = new DefaultDockActionSource(new LocationHint(LocationHint.DIRECT_ACTION, LocationHint.VERY_RIGHT)); source.add(fullScreenAction); return source; } }
public DefaultDockActionSource getDirectActionOffers( Dockable dockable ){ if( fullScreenAction == null ) return null; else { DefaultDockActionSource source = new DefaultDockActionSource(new LocationHint(LocationHint.DIRECT_ACTION, LocationHint.VERY_RIGHT)); source.add(fullScreenAction); return source; } }
/** * Creates a new guard * @param controller The controller for which actions are created. */ public ReplaceActionGuard( DockController controller ){ if( controller == null ) throw new IllegalArgumentException( "Controller should not be null" ); action = new ReplaceAction( controller ); source = new DefaultDockActionSource(); source.setHint( new LocationHint( LocationHint.ACTION_GUARD, LocationHint.LEFT )); setVisible( true ); }
/** * Creates a new DockInfo. * @param dockable the element whose informations are stored * @param key the name of the element */ public DockInfo( Dockable dockable, String key ){ this.dockable = dockable; this.key = key; entryLayout = defaultEntryLayout; source = new DefaultDockActionSource( new LocationHint( LocationHint.ACTION_GUARD, LocationHint.RIGHT_OF_ALL )); hideActionVisible = false; setHideable( defaultHideable ); }
public DockActionSource getIndirectActionOffers( Dockable dockable ){ if( fullScreenAction == null ) return null; DockStation parent = dockable.getDockParent(); if( parent == null ) return null; if( parent instanceof SplitDockStation ) return null; dockable = parent.asDockable(); if( dockable == null ) return null; parent = dockable.getDockParent(); if( parent != this ) return null; DefaultDockActionSource source = new DefaultDockActionSource(fullScreenAction); source.setHint(new LocationHint(LocationHint.INDIRECT_ACTION, LocationHint.VERY_RIGHT)); return source; }
public DockActionSource getIndirectActionOffers( Dockable dockable ){ if( fullScreenAction == null ) return null; DockStation parent = dockable.getDockParent(); if( parent == null ) return null; if( parent instanceof SplitDockStation ) return null; dockable = parent.asDockable(); if( dockable == null ) return null; parent = dockable.getDockParent(); if( parent != this ) return null; DefaultDockActionSource source = new DefaultDockActionSource(fullScreenAction); source.setHint(new LocationHint(LocationHint.INDIRECT_ACTION, LocationHint.VERY_RIGHT)); return source; }
/** * Creates a new panel * @param menu whether a menu should be used or not */ public ButtonPanel( boolean menu ){ setLayout( null ); setOpaque( false ); if( menu ){ menuSource = new DefaultDockActionSource(); menuAction = new SimpleMenuAction( menuSource ); menuIcon = new DockActionIcon( DockUI.OVERFLOW_MENU_ICON, menuAction ){ protected void changed( Icon oldValue, Icon newValue ){ menuAction.setIcon( newValue ); } }; } setFocusable( false ); setFocusTraversalPolicyProvider( true ); setFocusTraversalPolicy( new ContainerOrderFocusTraversalPolicy() ); }
/** * Creates a new panel * @param menu whether a menu should be used or not */ public ButtonPanel( boolean menu ){ setLayout( null ); setOpaque( false ); if( menu ){ menuSource = new DefaultDockActionSource(); menuAction = new SimpleMenuAction( menuSource ); menuIcon = new DockActionIcon( DockUI.OVERFLOW_MENU_ICON, menuAction ){ protected void changed( Icon oldValue, Icon newValue ){ menuAction.setIcon( newValue ); } }; } setFocusable( false ); setFocusTraversalPolicyProvider( true ); setFocusTraversalPolicy( new ContainerOrderFocusTraversalPolicy() ); }
}; DefaultDockActionSource source = new DefaultDockActionSource(); source.add( center ); source.addSeparator();