@Nullable @Override public String getTitle() { final String name = getName(); return ( name != null ) ? ResourceBundleTools.getString( _res, name + ".title", null ) : null; }
@Nullable @Override public String getDescription() { final String name = getName(); return ( name != null ) ? ResourceBundleTools.getString( _res, name + ".description", null ) : null; }
/** * Add button to content pane using the specified button properties. * * @param res Resource bundle to get button label and tooltip from. * @param key Resource key, name, and action command to use. * @param listener Action listener to perform button action. * * @return Button component. */ @NotNull public JButton addButton( @NotNull final ResourceBundle res, @NotNull final String key, @NotNull final ActionListener listener ) { final JButton result; result = new JButton( ' ' + ResourceBundleTools.getString( res, key, key ) + ' ' ); result.setName( key ); result.setActionCommand( key ); result.addActionListener( listener ); final String tooltip = ResourceBundleTools.getString( res, key + "Tip", null ); if ( tooltip != null ) { result.setToolTipText( tooltip ); } addButton( result ); return result; }
setActionCommand( key ); setName( ResourceBundleTools.getString( bundle, key, key ) ); setDefaultIcon(); setShortDescription( ResourceBundleTools.getString( bundle, key + "Tip", null ) ); setAcceleratorKey( ResourceBundleTools.getString( bundle, key + "KeyStroke", null ) ); setMnemonicKey( ResourceBundleTools.getString( bundle, key + "Mnemonic", null ) );
/** * Constructs a new quick find panel that operates on the given table * row sorter. * * @param locale Locale to use. * @param sorter Table row sorter to perform quick find on. */ public QuickFindPanel( final Locale locale, final DefaultRowSorter<?,?> sorter ) { _sorter = sorter; _originalRowFilter = ( sorter != null ) ? sorter.getRowFilter() : null; _timer = new Timer( 500, this ); _timer.setRepeats( false ); final JLabel label = new JLabel( ResourceBundleTools.getString( locale, QuickFindPanel.class, "findLabel" ) ); _label = label; final JTextField field = new KeyConsumingTextField( 20 ); _field = field; setLayout( new FlowLayout( FlowLayout.RIGHT ) ); add( label ); add( field ); final Document document = field.getDocument(); document.addDocumentListener( this ); field.addActionListener( this ); }
/** * Construct dialog. * * @param owner Parent component for this dialog. * @param modalityType Modality type for this dialog. * @param locale Locale to use for internationalized messages. * @param buttons Buttons to include in dialog. */ public StandardDialog( @Nullable final Window owner, @NotNull final ModalityType modalityType, @NotNull final Locale locale, final int buttons ) { super( owner, modalityType ); setLocale( locale ); _res = ResourceBundleTools.getBundleHierarchy( getClass(), locale ); _applied = false; _cancelled = false; setLocale( locale ); setDefaultCloseOperation( JDialog.DO_NOTHING_ON_CLOSE ); setTitle( ResourceBundleTools.getString( _res, "title", null ) ); final StandardContentPane contentPane = new StandardContentPane( new JPanel( new BorderLayout() ) ); addButtons( contentPane, buttons ); super.setContentPane( contentPane ); if ( _okButton != null ) { final JRootPane rootPane = contentPane.getRootPane(); rootPane.setDefaultButton( _okButton ); } enableEvents( WindowEvent.WINDOW_EVENT_MASK | ComponentEvent.COMPONENT_EVENT_MASK ); }
result = ResourceBundleTools.getString( _res, d.isDirectory() ? "folder" : type, _res.getString( "unknownType" ) ); break;
/** * Set default icon for action. */ protected void setDefaultIcon() { final ResourceBundle bundle = _bundle; final String key = getActionCommand(); final String iconPath = ResourceBundleTools.getString( bundle, key + "Icon", null ); if ( iconPath != null ) { final int iconSize = ResourceBundleTools.getInt( bundle, key + "IconSize", -1 ); final int iconWidth = ResourceBundleTools.getInt( bundle, key + "IconWidth", iconSize ); final int iconHeight = ResourceBundleTools.getInt( bundle, key + "IconHeight", iconSize ); setSmallIcon( iconPath, iconWidth, iconHeight ); } }
final JRadioButton[] radios = new JRadioButton[ values.length ]; final String valuePattern = ResourceBundleTools.getString( res, resourceKey + ".value", null ); final MessageFormat valueFormat = ( valuePattern != null ) ? new MessageFormat( valuePattern, locale ) : null;