@Override public void widgetSelected(SelectionEvent e) { InputDialog dialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INSERTHEAD), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), "", null); if(dialog.open() == InputDialog.OK){ String value = dialog.getValue(); service.addHead(id, db, key, value); refresh(); } } });
public Object execute(ExecutionEvent event) throws ExecutionException { InputDialog dlg = new InputDialog( HandlerUtil.getActiveShellChecked(event), "Title", "Enter text", "Initial value", null); if (dlg.open() == Window.OK) { // User clicked OK; run perl String input = dlg.getValue(); // TODO:do something with value } return null; }
ChangesView.MAP_FILE_EXT); InputDialog input = new InputDialog(null, title, msg, initial, null); input.setBlockOnOpen(true); if (input.open() == Window.OK) { String mapName = input.getValue(); if ((mapName != null) && (mapName.length() > 0)) { if (!mapName.endsWith(ChangesView.DOT_MAP_FILE_EXT)) {
/** * {@inheritDoc} */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { FormRootEditor editor = (FormRootEditor) HandlerUtil.getActiveEditor(event); Shell shell = HandlerUtil.getActiveShell(event); IInputValidator inputValidator = new IInputValidator() { @Override public String isValid(String newText) { if (StringUtils.isEmpty(newText)) { return "Name of the view is required"; } return null; } }; InputDialog inputDialog = new InputDialog(shell, "Rename View", "Please enter new name for the active view", editor.getPartName(), inputValidator); inputDialog.open(); if (inputDialog.getReturnCode() == Window.OK) { String name = inputDialog.getValue(); editor.updateEditorName(name); } return null; }
dialog.setBlockOnOpen(true); dialog.open(); if (dialog.getReturnCode() == Window.CANCEL) { returnValue[0] = null; } else { returnValue[0] = dialog.getValue();
private void addIgnore() { InputDialog dialog = new InputDialog(getShell(), TeamUIMessages.IgnorePreferencePage_enterPatternShort, TeamUIMessages.IgnorePreferencePage_enterPatternLong, null, null) { @Override protected Control createDialogArea(Composite parent) { Control control = super.createDialogArea(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(control, IHelpContextIds.IGNORE_PREFERENCE_PAGE); return control; } }; dialog.open(); if (dialog.getReturnCode() != Window.OK) return; String pattern = dialog.getValue(); if (pattern.equals("")) return; //$NON-NLS-1$ // Check if the item already exists TableItem[] items = ignoreTable.getItems(); for (int i = 0; i < items.length; i++) { if (items[i].getText().equals(pattern)) { MessageDialog.openWarning(getShell(), TeamUIMessages.IgnorePreferencePage_patternExistsShort, TeamUIMessages.IgnorePreferencePage_patternExistsLong); return; } } TableItem item = new TableItem(ignoreTable, SWT.NONE); item.setText(TextProcessor.process(pattern, ".*")); //$NON-NLS-1$ item.setChecked(true); }
private InputDialog getRefNameInputDialog(String prompt, final String refPrefix, String initialValue) { InputDialog labelDialog = new InputDialog(getShell(), UIText.CheckoutDialog_QuestionNewBranchTitle, prompt, initialValue, ValidationUtils.getRefNameInputValidator(repo, refPrefix, true)); labelDialog.setBlockOnOpen(true); return labelDialog; }
InputDialog seaerchDialog = new InputDialog(); // show modal dialog, wait for response seaerchDialog.doModal(); // get the input text Dialog.alert(seaerchDialog.getInputText());
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { dia = new InputDialog(this); dia.setVisible(true); }
Composite area= (Composite)super.createDialogArea(parent);
public String getNewName() throws OperationCanceledException { InputDialog dialog= new InputDialog(shell, ReorgMessages.ReorgQueries_nameConflictMessage, message, initial, validator) { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ protected Control createDialogArea(Composite parent) { Control area= super.createDialogArea(parent); TextFieldNavigationHandler.install(getText()); return area; } }; if (dialog.open() == Window.CANCEL) throw new OperationCanceledException(); return dialog.getValue(); } };
InputDialog md = new InputDialog(AspectJUIPlugin.getDefault().getActiveWorkbenchWindow().getShell(), title, msg, fileName, validator); md.setBlockOnOpen(true); if (md.open() == Window.OK) { if (md.getValue() != null) { String newName = md.getValue();
private void addIgnore() { InputDialog dialog = new InputDialog(getShell(), TeamUIMessages.IgnorePreferencePage_enterPatternShort, TeamUIMessages.IgnorePreferencePage_enterPatternLong, null, null); // dialog.open(); if (dialog.getReturnCode() != Window.OK) return; String pattern = dialog.getValue(); if (pattern.equals("")) return; //$NON-NLS-1$ // Check if the item already exists TableItem[] items = ignoreTable.getItems(); for (int i = 0; i < items.length; i++) { if (items[i].getText().equals(pattern)) { MessageDialog.openWarning(getShell(), TeamUIMessages.IgnorePreferencePage_patternExistsShort, TeamUIMessages.IgnorePreferencePage_patternExistsLong); // return; } } TableItem item = new TableItem(ignoreTable, SWT.NONE); item.setText(TextProcessor.process(pattern, ".*")); //$NON-NLS-1$ item.setChecked(true); }
private InputDialog getRefNameInputDialog(String prompt, final String refPrefix, String initialValue) { InputDialog branchNameDialog = new InputDialog( getShell(), UIText.RenameBranchDialog_RenameBranchDialogNewNameInputWindowTitle, prompt, initialValue, ValidationUtils.getRefNameInputValidator( repo, refPrefix, true)); branchNameDialog.setBlockOnOpen(true); return branchNameDialog; }
protected Control createDialogArea(Composite parent) { Control result= super.createDialogArea(parent); getText().setFocus(); applyDialogFont(result); return result; }
@Override public void widgetSelected(SelectionEvent e) { InputDialog inputDialog = new InputDialog( (Shell) shell, RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.HASHINPUTFORMAT), "", null); if (inputDialog.open() == InputDialog.OK) { String values = inputDialog.getValue(); String[] hashValues = values.split(";"); TableItem item = null; for (String value : hashValues) { item = new TableItem(table, SWT.NONE); String[] zset = value.split(","); item.setText(zset); } if(item != null) table.setSelection(item); } } });
@Override public String getNewName() throws OperationCanceledException { InputDialog dialog= new InputDialog(shell, ReorgMessages.ReorgQueries_nameConflictMessage, message, initial, validator) { @Override protected Control createDialogArea(Composite parent) { Control area= super.createDialogArea(parent); TextFieldNavigationHandler.install(getText()); return area; } @Override protected Control createContents(Composite parent) { Control contents= super.createContents(parent); int lastIndexOfDot= initial.lastIndexOf('.'); if (isFile && lastIndexOfDot > 0) { getText().setSelection(0, lastIndexOfDot); } return contents; } }; if (dialog.open() == Window.CANCEL) throw new OperationCanceledException(); return dialog.getValue(); } };
}; InputDialog dialog = new InputDialog(getShell(), IDEWorkbenchMessages.RenameResourceAction_inputDialogTitle, IDEWorkbenchMessages.RenameResourceAction_inputDialogMessage, resource.getName(), validator); dialog.setBlockOnOpen(true); int result = dialog.open(); if (result == Window.OK) return dialog.getValue(); return null;
protected Control createDialogArea(Composite parent) { IWorkbench workbench = PlatformUI.getWorkbench(); workbench.getHelpSystem().setHelp( parent, IJavaDebugHelpContextIds.DEFAULT_INPUT_DIALOG); return super.createDialogArea(parent); } };
@Override public void widgetSelected(SelectionEvent e) { InputDialog inputDialog = new InputDialog((Shell) shell, RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.LISTINPUTFORMAT), "", null); if (inputDialog.open() == InputDialog.OK) { String values = inputDialog.getValue(); String[] listValues = values.split(";"); TableItem item = null; for (String value : listValues) { item = new TableItem(table, SWT.NONE); item.setText(value); } if(item != null) table.setSelection(item); } } });