protected void confirmDialog( String title, String msg, String ok ) throws Exception { MessageDialog confirmDialog = new MessageDialog( getShell(), title, null, msg, MessageDialog.NONE, new String[] { ok }, 0 ) { @Override protected Point getInitialSize() { return new Point( DIALOG_WIDTH, DIALOG_HEIGHT ); } @Override protected void configureShell( Shell shell ) { super.configureShell( shell ); shell.setBackground( shell.getDisplay().getSystemColor( DIALOG_COLOR ) ); shell.setBackgroundMode( SWT.INHERIT_FORCE ); } }; confirmDialog.open(); }
public static void showDatabaseExistsDialog( Shell parent, DatabaseMeta databaseMeta ) { String title = BaseMessages.getString( PKG, "DatabaseDialog.DatabaseNameExists.Title" ); String message = BaseMessages.getString( PKG, "DatabaseDialog.DatabaseNameExists", databaseMeta.getName() ); String okButton = BaseMessages.getString( PKG, "System.Button.OK" ); MessageDialog dialog = new MessageDialog( parent, title, null, message, MessageDialog.ERROR, new String[] { okButton }, 0 ); dialog.open(); }
protected void showUnsupportedConnectionMessageBox( DatabaseInterface dbi ) { String title = BaseMessages.getString( PKG, "TableOutput.UnsupportedConnection.DialogTitle" ); String message = dbi.getUnsupportedTableOutputMessage(); String close = BaseMessages.getString( PKG, "System.Button.Close" ); MessageDialog dialog = new MessageDialog( shell, title, GUIResource.getInstance().getImageSpoon(), message, MessageDialog.WARNING, new String[] { close }, 0 ); dialog.open(); }
protected void confirmDialog( Callable<Void> callback, String title, String msg, String yes, String no ) throws Exception { MessageDialog confirmDialog = new MessageDialog( getShell(), title, null, msg, MessageDialog.NONE, new String[] { yes, no }, 0 ) { @Override protected Point getInitialSize() { return new Point( DIALOG_WIDTH, DIALOG_HEIGHT ); } @Override protected void configureShell( Shell shell ) { super.configureShell( shell ); shell.setBackground( shell.getDisplay().getSystemColor( DIALOG_COLOR ) ); shell.setBackgroundMode( SWT.INHERIT_FORCE ); } }; int result = confirmDialog.open(); if ( result == 0 ) { try { callback.call(); } catch ( Exception e ) { if ( mainController == null || !mainController.handleLostRepository( e ) ) { messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); messageBox.setMessage( BaseMessages.getString( PKG, e.getLocalizedMessage() ) ); messageBox.open(); } } } }
BaseMessages.getString( PKG, "BaseStepDialog.Cancel" ), }, 0 ); MessageDialog.setDefaultImage( GUIResource.getInstance().getImageSpoon() ); int idx = md.open(); choice = idx & 0xFF;
0 ); MessageDialog.setDefaultImage( GUIResource.getInstance().getImageSpoon() ); int idx = md.open(); choice = idx & 0xFF;
public void ok() { getInfo(); if ( !partitionSchema.getName().equals( originalSchema.getName() ) ) { if ( DialogUtils.objectWithTheSameNameExists( partitionSchema, existingSchemas ) ) { String title = BaseMessages.getString( PKG, "PartitionSchemaDialog.PartitionSchemaNameExists.Title" ); String message = BaseMessages.getString( PKG, "PartitionSchemaDialog.PartitionSchemaNameExists", partitionSchema.getName() ); String okButton = BaseMessages.getString( PKG, "System.Button.OK" ); MessageDialog dialog = new MessageDialog( shell, title, null, message, MessageDialog.ERROR, new String[] { okButton }, 0 ); dialog.open(); return; } } originalSchema.setName( partitionSchema.getName() ); originalSchema.setPartitionIDs( partitionSchema.getPartitionIDs() ); originalSchema.setDynamicallyDefined( wDynamic.getSelection() ); originalSchema.setNumberOfPartitionsPerSlave( wNumber.getText() ); originalSchema.setChanged(); ok = true; dispose(); }
getFieldsChoiceDialogProvider.provide( tableView.getShell(), keys.size(), row.size() ); int idx = getFieldsChoiceDialog.open(); choice = idx & 0xFF;
BaseMessages.getString( PKG, "TransSaveProgressDialog.UnableToSave.DialogMessage" ), MessageDialog.ERROR, new String[] { BaseMessages.getString( PKG, "TransSaveProgressDialog.UnableToSave.Close" ) }, 0 ); errorDialog.open(); retval = false; } catch ( InterruptedException e ) {
BaseMessages.getString( PKG, "BaseStepDialog.Cancel" ), }, 0 ); MessageDialog.setDefaultImage( GUIResource.getInstance().getImageSpoon() ); int idx = md.open(); choice = idx & 0xFF;
new MessageDialog( shell, title, null, message, MessageDialog.ERROR, new String[] { okButton }, 0 ); dialog.open(); return;
public void ok() { getInfo(); if ( !slaveServer.getName().equals( originalServer.getName() ) ) { if ( DialogUtils.objectWithTheSameNameExists( slaveServer, existingServers ) ) { String title = BaseMessages.getString( PKG, "SlaveServerDialog.SlaveServerNameExists.Title" ); String message = BaseMessages.getString( PKG, "SlaveServerDialog.SlaveServerNameExists", slaveServer.getName() ); String okButton = BaseMessages.getString( PKG, "System.Button.OK" ); MessageDialog dialog = new MessageDialog( shell, title, null, message, MessageDialog.ERROR, new String[] { okButton }, 0 ); dialog.open(); return; } } originalServer.setName( slaveServer.getName() ); originalServer.setHostname( slaveServer.getHostname() ); originalServer.setPort( slaveServer.getPort() ); originalServer.setWebAppName( slaveServer.getWebAppName() ); originalServer.setUsername( slaveServer.getUsername() ); originalServer.setPassword( slaveServer.getPassword() ); originalServer.setProxyHostname( slaveServer.getProxyHostname() ); originalServer.setProxyPort( slaveServer.getProxyPort() ); originalServer.setNonProxyHosts( slaveServer.getNonProxyHosts() ); originalServer.setMaster( slaveServer.isMaster() ); originalServer.setSslMode( slaveServer.isSslMode() ); originalServer.setChanged(); ok = true; dispose(); }
@Override public int open() { // Override Window#open() to allow for non-interactive testing. if (fIsTesting) { deleteContent = true; return Window.OK; } return super.open(); }
@Override public void run() { String title= ActionMessages.AddGetterSetterAction_QueryDialog_title; MessageDialog dialog= new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, buttonLabels, 0); result[0]= dialog.open(); } });
public static void showMessage(String msg, int msgType) { MessageDialog dialog = new MessageDialog(getShell(), "Vili", null, msg, msgType, new String[] { IDialogConstants.OK_LABEL }, 0); dialog.open(); }
private boolean isPerformRevert() { Shell shell= viewer.getControl().getShell(); MessageDialog dialog= new MessageDialog(shell, TextEditorMessages.SpellingConfigurationBlock_error_title, null, TextEditorMessages.SpellingConfigurationBlock_error_message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1); return dialog.open() == 0; }
private void showRestartDialog() { if (0 == MessageDialog.open(MessageDialog.CONFIRM, mainPage.getShell(), PreferencesMessages.WizardPreferencesImportRestartDialog_title, PreferencesMessages.WizardPreferencesImportRestartDialog_message, SWT.NONE, PreferencesMessages.WizardPreferencesImportRestartDialog_restart, IDialogConstants.CANCEL_LABEL)) { Display.getDefault().asyncExec(() -> { PlatformUI.getWorkbench().restart(); }); } }
private boolean isPerformRevert() { Shell shell= viewer.getControl().getShell(); MessageDialog dialog= new MessageDialog(shell, TextEditorMessages.SpellingConfigurationBlock_error_title, null, TextEditorMessages.SpellingConfigurationBlock_error_message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1); return dialog.open() == 0; }
@Override protected void run(IWorkbenchPage page, IPerspectiveDescriptor persp) { String message = NLS.bind(WorkbenchMessages.ResetPerspective_message, persp.getLabel() ); MessageDialog d = new MessageDialog(getWindow().getShell(), WorkbenchMessages.ResetPerspective_title, null, message, MessageDialog.QUESTION, 0, IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL); if (d.open() == 0) { page.resetPerspective(); } }
@Override public int open() { create(); Button b = getButton(defaultButtonIndex); b.setFocus(); b.getShell().setDefaultButton(b); return super.open(); }