/** * Defines an <code>Action</code> object with a default description string and default icon. */ private OKAction() { putValue( Action.NAME, Messages.getInstance().getString( "OK" ) ); }
/** * Defines an <code>Action</code> object with a default description string and default icon. */ private CancelAction() { putValue( Action.NAME, Messages.getInstance().getString( "CANCEL" ) ); }
protected void init() { addPropertyChangeListener( "action", new ActionUpdateHandler() ); putClientProperty( "JButton.buttonType", "square" ); putClientProperty( "JComponent.sizeVariant", "small" ); setHorizontalTextPosition( JButton.CENTER ); setVerticalTextPosition( JButton.BOTTOM ); revalidateAction(); }
protected void init() { setMargin( new Insets( 0, 0, 0, 0 ) ); addMouseListener( new HoveringButtonHandler() ); setBorderPainted( false ); setContentAreaFilled( false ); putClientProperty( "JButton.buttonType", "square" ); putClientProperty( "JComponent.sizeVariant", "small" ); } }
/** * Invoked when an action occurs. */ public void actionPerformed( final ActionEvent e ) { if ( validateInputs( true ) ) { setConfirmed( true ); dispose(); } } }
protected void performInitialResize() { pack(); LibSwingUtil.centerDialogInParent( this ); }
/** * Invoked when the mouse enters a component. */ public void mouseEntered( final MouseEvent e ) { if ( updateContentAreaFilled ) { setContentAreaFilled( true ); } setBorderPainted( true ); }
/** * Creates a new keyed combobox model for the given keys and values. Keys and values must have the same number of * items. * * @param keys the keys * @param values the values */ public KeyedComboBoxModel( final K[] keys, final V[] values ) { this(); setData( keys, values ); }
/** * Returns the singleton instance of the Info-Object. * * @return te info object for this library. */ public static synchronized ProjectInformation getInstance() { if ( instance == null ) { instance = new LibSwingInfo(); instance.initialize(); } return instance; }
/** * Creates a button with no set text or icon. */ public ToolbarButton() { init(); }
/** * Creates a button with text. * * @param text the text of the button */ public BorderlessButton( final String text ) { super( text ); init(); }
/** * Invoked when the target of the listener has changed its state. * * @param e a ChangeEvent object */ public void stateChanged( final ChangeEvent e ) { fireChangeEvent(); } }
/** * Creates a new modal dialog. */ protected CommonDialog() { setModal( true ); }
/** * Set the selected item. The implementation of this method should notify all registered * <code>ListDataListener</code>s that the contents have changed. * * @param anItem the list object to select or <code>null</code> to clear the selection */ public final void setSelectedItem( final Object anItem ) { //noinspection unchecked setSelectedValue( (V) anItem ); }
public static void setQuitAction( final Action quitAction ) { MacOSXIntegration.quitAction = quitAction; init(); } }
/** * Creates a button with an icon. * * @param icon the Icon image to display on the button */ public ToolbarButton( final Icon icon ) { super( icon ); init(); }
/** * Creates a button where properties are taken from the <code>Action</code> supplied. * * @param a the <code>Action</code> used to specify the new button * @since 1.3 */ public BorderlessButton( final Action a ) { super( a ); init(); }
/** * Creates a button with text. * * @param text the text of the button */ public ToolbarButton( final String text ) { super( text ); init(); }
/** * Creates a button with initial text and an icon. * * @param text the text of the button * @param icon the Icon image to display on the button */ public BorderlessButton( final String text, final Icon icon ) { super( text, icon ); init(); }
/** * Creates a button where properties are taken from the <code>Action</code> supplied. * * @param a the <code>Action</code> used to specify the new button * @since 1.3 */ public ToolbarButton( final Action a ) { super( a ); init(); }