public Window getWindow() { if ( parent != null ) { return LibSwingUtil.getWindowAncestor( parent ); } return null; }
public Window getWindow() { return LibSwingUtil.getWindowAncestor( PreviewPane.this ); }
protected BasicTextPropertyEditorDialog createTextEditorDialog() { final Window window = LibSwingUtil.getWindowAncestor( PropertyCellEditorWithEllipsis.this ); final BasicTextPropertyEditorDialog editorDialog; if ( window instanceof Frame ) { editorDialog = new BasicTextPropertyEditorDialog( (Frame) window ); } else if ( window instanceof Dialog ) { editorDialog = new BasicTextPropertyEditorDialog( (Dialog) window ); } else { editorDialog = new BasicTextPropertyEditorDialog(); } return editorDialog; }
private static NumericInputDialog createDialog( final Component parent ) { if ( parent != null ) { final Window window = LibSwingUtil.getWindowAncestor( parent ); if ( window instanceof Dialog ) { return new NumericInputDialog( (Dialog) window, true ); } if ( window instanceof Frame ) { return new NumericInputDialog( (Frame) window, true ); } } final NumericInputDialog dialog = new NumericInputDialog(); dialog.setModal( true ); return dialog; }
/** * Invoked when an action occurs. */ public void actionPerformed( final ActionEvent e ) { if ( propertyEditor == null ) { return; } if ( propertyEditor.supportsCustomEditor() ) { final Window window = LibSwingUtil.getWindowAncestor( PropertyCellEditorWithEllipsis.this ); final CustomPropertyEditorDialog editorDialog; if ( window instanceof Frame ) { editorDialog = new CustomPropertyEditorDialog( (Frame) window ); } else if ( window instanceof Dialog ) { editorDialog = new CustomPropertyEditorDialog( (Dialog) window ); } else { editorDialog = new CustomPropertyEditorDialog(); } if ( editorDialog.performEdit( propertyEditor ) ) { textField.setText( propertyEditor.getAsText() ); stopCellEditing(); } } else { final BasicTextPropertyEditorDialog editorDialog = createTextEditorDialog(); if ( editorDialog.performEdit( propertyEditor ) ) { textField.setText( propertyEditor.getAsText() ); stopCellEditing(); } } } }
final Window window = LibSwingUtil.getWindowAncestor( parent ); final ExceptionDialog defaultDialog; if ( window instanceof Frame ) {
/** * Invoked when an action occurs. */ public void actionPerformed( final ActionEvent e ) { if ( getArrayType() == null ) { return; } final Object value = getArray(); final Window window = LibSwingUtil.getWindowAncestor( ArrayCellEditor.this ); final ArrayCellEditorDialog editorDialog; if ( window instanceof Frame ) { editorDialog = new ArrayCellEditorDialog( (Frame) window ); } else if ( window instanceof Dialog ) { editorDialog = new ArrayCellEditorDialog( (Dialog) window ); } else { editorDialog = new ArrayCellEditorDialog(); } final Object o = editorDialog.editArray ( value, getArrayType(), propertyEditorType ); if ( o != null ) { // update array = o; stopCellEditing(); } else { cancelCellEditing(); } } }
public boolean configure( final PreviewPane reportPane ) { if ( aboutFrame == null ) { final String title = getDisplayName(); // look where we have been added ... final Window w = LibSwingUtil.getWindowAncestor( reportPane ); if ( w instanceof Frame ) { aboutFrame = new AboutDialog( (Frame) w, title, ClassicEngineInfo.getInstance() ); } else if ( w instanceof Dialog ) { aboutFrame = new AboutDialog( (Dialog) w, title, ClassicEngineInfo.getInstance() ); } else { aboutFrame = new AboutDialog( title, ClassicEngineInfo.getInstance() ); } aboutFrame.pack(); LibSwingUtil.centerFrameOnScreen( aboutFrame ); } aboutFrame.setVisible( true ); aboutFrame.requestFocus(); return true; }
/** * Invoked when an action occurs. */ public void actionPerformed( final ActionEvent e ) { if ( fieldSelectorDialog == null ) { final Window w = LibSwingUtil.getWindowAncestor( parent ); if ( w instanceof Frame ) { this.fieldSelectorDialog = new FieldSelectorDialog( (Frame) w ); LibSwingUtil.positionDialogRelativeToParent( this.fieldSelectorDialog, 0.5, 0.5 ); } else if ( w instanceof Dialog ) { this.fieldSelectorDialog = new FieldSelectorDialog( (Dialog) w ); LibSwingUtil.positionDialogRelativeToParent( this.fieldSelectorDialog, 0.5, 0.5 ); } else { this.fieldSelectorDialog = new FieldSelectorDialog(); LibSwingUtil.positionDialogRelativeToParent( this.fieldSelectorDialog, 0.5, 0.5 ); } } final FieldDefinition[] fields = fieldDefinitionSource.getFields(); if ( fields != null ) { this.fieldSelectorDialog.setFields( fields ); } fieldSelectorDialog.setFocusReturn( focusReturn ); fieldSelectorDialog.removePropertyChangeListener ( FieldSelectorDialog.SELECTED_DEFINITION_PROPERTY, selectorUpdateHandler ); fieldSelectorDialog.setSelectedDefinition( null ); fieldSelectorDialog.addPropertyChangeListener( FieldSelectorDialog.SELECTED_DEFINITION_PROPERTY, selectorUpdateHandler ); fieldSelectorDialog.setVisible( true ); }