Refine search
@Override public void modifyText( ModifyEvent arg0 ) { // Now set the combo's shell.getDisplay().asyncExec( new Runnable() { @Override public void run() { setComboBoxes(); } } ); } } );
/** * build icon cell */ protected void buildIconCell() { Image icon = Display.getCurrent().getSystemImage( SWT.ICON_INFORMATION ); this.iconLabel = new Label( this.dialog, SWT.NONE ); this.iconLabel.setImage( icon ); GridData grdData = new GridData(); grdData.horizontalIndent = DEFAULT_INDENT; grdData.verticalIndent = DEFAULT_INDENT; this.iconLabel.setLayoutData( grdData ); }
@Override public void pluginAdded( Object serviceObject ) { previousShowTrans = false; // hack to get the tree to reload Display.getDefault().asyncExec( new Runnable() { @Override public void run() { refreshCoreObjects(); } } ); }
public boolean threadMessageBox( final String message, final String text, boolean allowCancel, int type ) { final boolean[] result = new boolean[1]; Display.getDefault().syncExec( new Runnable() { public void run() { result[0] = SpoonFactory.getInstance().messageBox( message, text, true, Const.INFO ); } } ); return result[0]; }
public void run() { if ( display != null && !display.isDisposed() ) { display.asyncExec( new Runnable() { public void run() { refreshViewAndLog(); } } ); } } };
public String open() { Shell parent = getParent(); Display display = parent.getDisplay(); new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN | ( modal ? SWT.APPLICATION_MODAL | SWT.SHEET : SWT.NONE ) ); props.setLook( shell ); shell.setImage( GUIResource.getInstance().getImageLogoSmall() ); wDesc.setLayoutData( fdDesc ); wOK = new Button( shell, SWT.PUSH ); wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); wCancel = new Button( shell, SWT.PUSH ); if ( !display.readAndDispatch() ) { display.sleep();
public int open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX ); props.setLook( shell ); formLayout.marginHeight = 15; shell.setLayout( formLayout ); Image image = display.getSystemImage( SWT.ICON_WARNING ); wcMessage.setLayout( new GridLayout() ); wcMessage.setLayoutData( fdcMessage ); Button wbNo = new Button( shell, SWT.PUSH ); wbNo.setText( BaseMessages.getString( PKG, "System.Button.No" ) ); wbNo.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent selectionEvent ) { quit( SWT.NO ); if ( !display.readAndDispatch() ) { display.sleep();
public void open() { display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); formLayout.marginHeight = Const.FORM_MARGIN; shell.setText( BaseMessages.getString( PKG, "RepositoryImportDialog.Title" ) ); shell.setImage( GUIResource.getInstance().getImageSpoon() ); shell.setLayout( formLayout ); wLabel = new Label( shell, SWT.LEFT ); props.setLook( wLabel ); wClose = new Button( shell, SWT.PUSH ); wClose.setText( BaseMessages.getString( PKG, "System.Button.Close" ) ); wLogging = new Text( shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL ); props.setLook( wLabel ); display.asyncExec( new Runnable() { public void run() { while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep();
public void open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.SHEET | SWT.RESIZE ); shell.setImage( GUIResource.getInstance().getImageSpoon() ); props.setLook( shell ); Label wlImage = new Label( shell, SWT.NONE ); wlImage.setImage( GUIResource.getInstance().getImageWarning32() ); FormData fdWarnImage = new FormData(); fdWarnImage.left = new FormAttachment( 0, 15 ); fdWarnImage.top = new FormAttachment( 0, 15 ); fdWarnImage.height = 32; fdWarnImage.width = 32; wlImage.setLayoutData( fdWarnImage ); props.setLook( wlImage ); fdMessage.left = new FormAttachment( wlImage, 15, SWT.RIGHT ); Button spacer = new Button( shell, SWT.NONE ); spacer.setLayoutData( fdSpacer ); spacer.setVisible( false ); props.setLook( spacer ); if ( !display.readAndDispatch() ) { display.sleep();
public void open() { shell = new Shell( parentShell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); shell.setImage( GUIResource.getInstance().getImageSpoon() ); formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); shell.setText( dialogTitle ); wClose = new Button( shell, SWT.PUSH ); wClose.setText( BaseMessages.getString( PKG, "System.Button.Close" ) ); wClose.addListener( SWT.Selection, new Listener() { public void handleEvent( Event e ) { close(); while ( !shell.isDisposed() ) { if ( !shell.getDisplay().readAndDispatch() ) { shell.getDisplay().sleep();
private void open( final Display display ) { shell.pack(); if ( width > 0 ) { final int height = shell.computeSize( width, SWT.DEFAULT ).y; // for some reason the actual width and minimum width are smaller than what is requested - add the // SHELL_WIDTH_OFFSET to get the desired size shell.setMinimumSize( width + SHELL_WIDTH_OFFSET, height ); shell.setSize( width + SHELL_WIDTH_OFFSET, height ); } shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } }
protected void openDialog() { shell.pack(); // Set the focus on the OK button wOK.setFocus(); Rectangle shellBounds = getParent().getBounds(); Point dialogSize = shell.getSize(); shell.setLocation( shellBounds.x + ( shellBounds.width - dialogSize.x ) / 2, shellBounds.y + ( shellBounds.height - dialogSize.y ) / 2 ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } }
public String open() { shell.layout(); shell.open(); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed( ShellEvent e ) { cancel(); } } ); while ( !shell.isDisposed() ) { if ( !shell.getDisplay().readAndDispatch() ) { shell.getDisplay().sleep(); } } return formula; }
Display display = Display.getDefault(); Shell dialogShell = new Shell(display, SWT.APPLICATION_MODAL); // populate dialogShell dialogShell.open(); while (!dialogShell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } }
Display display = shell.getDisplay(); if ( !( display == null || display.isDisposed() ) ) { display.asyncExec( new Runnable() { @Override public void run() {
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.open(); DirectoryDialog dialog = new DirectoryDialog(shell); dialog.setFilterPath("c:\\"); // Windows specific System.out.println("RESULT=" + dialog.open()); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
public static void main( String[] args ) { Display display = new Display( ); try { KettleEnvironment.init(); PropsUI.init( display, Props.TYPE_PROPERTIES_SPOON ); KettleLogStore .init( PropsUI.getInstance().getMaxNrLinesInLog(), PropsUI.getInstance().getMaxLogLineTimeoutMinutes() ); } catch ( KettleException e ) { e.printStackTrace(); } KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.SPOON ); Shell shell = new Shell( display, SWT.DIALOG_TRIM ); shell.open(); CapabilityManagerDialog capabilityManagerDialog = new CapabilityManagerDialog( shell ); capabilityManagerDialog.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } }
protected void setComboBoxes() { shell.getDisplay().syncExec( new Runnable() { public void run() { if ( inputFields != null ) { String[] fieldNames = inputFields.getFieldNames(); wParent.setItems( fieldNames ); wChild.setItems( fieldNames ); } } } ); }
@Override protected void configureShell( Shell shell ) { super.configureShell( shell ); shell.setBackground( shell.getDisplay().getSystemColor( DIALOG_COLOR ) ); shell.setBackgroundMode( SWT.INHERIT_FORCE ); } };
@Override public void modifyText( ModifyEvent modifyEvent ) { ExecutorService executorService = ExecutorUtil.getExecutor(); final String runConfiguration = jobMeta.environmentSubstitute( wRunConfiguration.getText() ); executorService.submit( () -> { List<Object> items = Arrays.asList( runConfiguration, false ); try { ExtensionPointHandler.callExtensionPoint( Spoon.getInstance().getLog(), KettleExtensionPoint .RunConfigurationSelection.id, items ); } catch ( KettleException ignored ) { // Ignore errors } display.asyncExec( () -> { if ( (Boolean) items.get( IS_PENTAHO ) ) { wWaitingToFinish.setSelection( false ); wWaitingToFinish.setEnabled( false ); } else { wWaitingToFinish.setEnabled( true ); } } ); } ); } }