public boolean showData( final TableModel rawTableModel ) { if ( rawTableModel == null ) { // User must have hit cancel return true; } LibSwingUtil.centerDialogInParent( this ); table.setModel( rawTableModel ); setVisible( true ); return false; } }
protected void performInitialResize() { pack(); LibSwingUtil.centerDialogInParent( this ); }
public void reinitComponents() { contentPane.removeAll(); final JPanel contentPanel = new JPanel( new FlowLayout( FlowLayout.CENTER ) ); contentPanel.add( message ); contentPane.add( contentPanel, BorderLayout.CENTER ); final JPanel progressPanel = new JPanel( new FlowLayout( FlowLayout.CENTER ) ); progressPanel.add( progressBar ); contentPane.add( progressPanel, BorderLayout.NORTH ); if ( showCancelButton ) { final JPanel buttonPanel = new JPanel( new FlowLayout( FlowLayout.CENTER, PADDING, PADDING ) ); final JButton cancelButton = new JButton( new CancelActionListener() ); buttonPanel.add( cancelButton ); contentPane.add( buttonPanel, BorderLayout.SOUTH ); } contentPane.invalidate(); pack(); // Since the parent dialog has not yet been centered, we will just center on the screen LibSwingUtil.centerDialogInParent( this ); }
private void initialize( final MasterReport report ) { if ( report == null ) { throw new NullPointerException(); } masterReport = report; messages = new ResourceBundleSupport( Locale.getDefault(), SwingPreviewModule.BUNDLE_NAME, ObjectUtilities .getClassLoader( PreviewParametersDialog.class ) ); confirmAction = new OkAction(); setTitle( messages.getString( "PreviewParametersDialog.Title" ) ); setDefaultCloseOperation( JDialog.DISPOSE_ON_CLOSE ); final JPanel contentPane = new JPanel(); contentPane.setLayout( new BorderLayout() ); contentPane.add( createParametersPanel(), BorderLayout.CENTER ); contentPane.add( createButtonsPanel(), BorderLayout.SOUTH ); setContentPane( contentPane ); final InputMap inputMap = contentPane.getInputMap(); final ActionMap actionMap = contentPane.getActionMap(); inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ), "confirm" ); // NON-NLS inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0 ), "cancel" ); // NON-NLS actionMap.put( "confirm", new OkAction() ); // NON-NLS actionMap.put( "cancel", new CancelAction() ); // NON-NLS setModal( true ); pack(); LibSwingUtil.centerDialogInParent( this ); }
LibSwingUtil.centerDialogInParent( progressDialog ); progressDialog.setOnlyPagination( true ); progressDialog.setVisible( true );
LibSwingUtil.centerDialogInParent( progressDialog ); progressDialog.setOnlyPagination( true ); progressDialog.setVisible( true );
public static Integer showInputDialog( final Component parent, final int icon, final String title, final String message, final int initialValue, final boolean bounded ) { final NumericInputDialog dialog = createDialog( parent ); if ( title != null ) { dialog.setTitle( title ); } if ( message != null ) { dialog.setMessage( message ); } dialog.setIcon( createDefaultIcon( icon ) ); dialog.setInputValue( new Integer( initialValue ) ); dialog.setSliderVisible( false ); dialog.setBoundedRange( bounded ); dialog.pack(); LibSwingUtil.centerDialogInParent( dialog ); dialog.setVisible( true ); if ( dialog.isConfirmed() ) { return dialog.getInputValue(); } return null; }
defaultDialog.adjustSize(); defaultDialog.setModal( true ); LibSwingUtil.centerDialogInParent( defaultDialog ); defaultDialog.setVisible( true );
public static Integer showSliderDialog( final Component parent, final int icon, final String title, final String message, final int minimum, final int maximum, final int initialValue ) { final NumericInputDialog dialog = createDialog( parent ); if ( title != null ) { dialog.setTitle( title ); } if ( message != null ) { dialog.setMessage( message ); } dialog.setIcon( createDefaultIcon( icon ) ); dialog.setMinimum( minimum ); dialog.setMaximum( maximum ); dialog.setInputValue( new Integer( initialValue ) ); dialog.setBoundedRange( true ); dialog.setTextInputVisible( false ); dialog.pack(); LibSwingUtil.centerDialogInParent( dialog ); dialog.setVisible( true ); if ( dialog.isConfirmed() ) { return dialog.getInputValue(); } return null; }
public static Integer showInputDialog( final Component parent, final int icon, final String title, final String message, final int minimum, final int maximum, final int initialValue, final boolean bounded ) { final NumericInputDialog dialog = createDialog( parent ); if ( title != null ) { dialog.setTitle( title ); } if ( message != null ) { dialog.setMessage( message ); } dialog.setIcon( createDefaultIcon( icon ) ); dialog.setMinimum( minimum ); dialog.setMaximum( maximum ); dialog.setInputValue( new Integer( initialValue ) ); dialog.setBoundedRange( bounded ); dialog.setPaintTicks( true ); dialog.pack(); LibSwingUtil.centerDialogInParent( dialog ); dialog.setVisible( true ); if ( dialog.isConfirmed() ) { return dialog.getInputValue(); } return null; }
formValidator.handleValidate(); setModal( true ); LibSwingUtil.centerDialogInParent( this ); setVisible( true ); if ( isConfirmed() == false ) {
/** * Initializes the dialog (Non-GUI stuff). */ private void initConstructor() { updateRunnable = new ScreenUpdateRunnable(); messages = new Messages( getLocale(), SwingCommonModule.BUNDLE_NAME, ObjectUtilities .getClassLoader( SwingCommonModule.class ) ); initialize(); addWindowListener( new ToFrontHandler() ); setOutputText( messages.getString( "progress-dialog.perform-output" ) ); //$NON-NLS-1$ setLayoutText( messages.getString( "progress-dialog.prepare-layout" ) ); //$NON-NLS-1$ lastActivity = -1; lastMaxRow = -1; lastPage = -1; this.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE ); pack(); LibSwingUtil.centerDialogInParent( this ); }
LibSwingUtil.centerDialogInParent( dialog ); final PageDefinition definition = dialog.performSetup( report.getPageDefinition() ); if ( dialog.isConfirmed() == false ) {