@Override public void widgetSelected(SelectionEvent e) { InputDialog inputDialog = new InputDialog( (Shell) shell, RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.INPUTZSETFORMAT), "", null); if (inputDialog.open() == InputDialog.OK) { String values = inputDialog.getValue(); String[] zsetValues = values.split(";"); TableItem item = null; for (String value : zsetValues) { item = new TableItem(table, SWT.NONE); String[] zset = value.split(","); item.setText(zset); } if(item != null) table.setSelection(item); } } });
@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 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); } } });
@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); } } });
@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(); } } });
@Override public void widgetSelected(SelectionEvent e) { InputDialog inputDialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.LISTINPUTFORMAT), "", null); if (inputDialog.open() == InputDialog.OK) { String values = inputDialog.getValue(); String[] setValues = values.split(";"); long size = service.addValues(id, db, key, setValues); if(size == 0) MessageDialog.openInformation(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.ADDSETVALUES)); refresh(); } } });
@Override public void widgetSelected(SelectionEvent e) { InputDialog dialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.APPENDTAIL), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), "", null); if(dialog.open() == InputDialog.OK){ String value = dialog.getValue(); service.addTail(id, db, key, value); pageListener.setCount(); table.clear(table.getItemCount()-1); table.setSelection(table.getItemCount()-1); table.setSelection(-1); currentData.setItem(null); status = Status.Normal; statusChanged(); } } });
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; }
/** * Prompts the user to input a string. * @see PromptExpanderBase#prompt() */ @Override public void prompt() { InputDialog dialog = new InputDialog(null, StringSubstitutionMessages.StringPromptExpander_0, dialogMessage, defaultValue == null ? lastValue : defaultValue, null); int dialogResult = dialog.open(); if (dialogResult == Window.OK) { dialogResultString = dialog.getValue(); } }
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(); } };
private void addFilter() { IInputValidator validator = new IInputValidator() { public String isValid(String newText) { return newText.indexOf(';') >= 0 ? Messages.FilterDialog_FilterShouldntContainSemicolon : null; } }; InputDialog dialog = new InputDialog(getShell(), Messages.FilterDialog_AddFilterTitle, Messages.FilterDialog_AddFliterLabel, null, validator); if (dialog.open() == Window.OK) { String value = dialog.getValue().trim(); if (value.length() > 0) { filterList.add(value); } } }
@Override public void runWithEvent ( final Event event ) { final InputDialog dialog = new InputDialog ( this.shell, "Add key", "Enter the name of the key to add", "", null ); if ( dialog.open () == Window.OK ) { this.map.put ( dialog.getValue (), "" ); } } }
@Override public void runWithEvent ( final Event event ) { final InputDialog dialog = new InputDialog ( this.shell, "Add key", "Enter the name of the key to add", "", null ); if ( dialog.open () == Window.OK ) { this.map.put ( dialog.getValue (), "" ); } } }
public void widgetSelected(SelectionEvent e) { IInputValidator validator = new IInputValidator() { public String isValid(String newText) { if (newText.trim().length() > 0 && newText.matches("[_a-zA-Z]*")) //$NON-NLS-1$ return null; return RutaFoldingMessages.RutaFoldingPreferenceBlock_2; } }; InputDialog dlg = new InputDialog(null, RutaFoldingMessages.RutaFoldingPreferenceBlock_3, RutaFoldingMessages.RutaFoldingPreferenceBlock_4, "", validator); if (dlg.open() == Window.OK) { fList.add(dlg.getValue()); save(); } } });
@Override public void widgetSelected(SelectionEvent e) { InputDialog dialog = new InputDialog(getShell(), "New Name", "File name pattern like *.java, my.xml:", null, new IInputValidator() { public String isValid(String newText) { if (newText != null && newText.trim().length() > 0) return null; return ""; } }); if (dialog.open() == InputDialog.OK) { addFileName(dialog.getValue()); } } }
public void handleInsert () { final InputDialog dlg = new InputDialog ( getSite ().getShell (), "Create new configuration", "Enter the id of the new configuration object to create", "", null ); if ( dlg.open () == Window.OK ) { insertEntry ( dlg.getValue () ); } }
@Override public void widgetSelected(SelectionEvent e) { InputDialog dialog = new InputDialog(getShell(), "New Category", "Name:", null, new IInputValidator() { public String isValid(String newText) { if (newText != null && newText.trim().length() > 0 && !contains(categoryList.getItems(), newText)) return null; return "Unique name required"; } }); if (dialog.open() == InputDialog.OK) { String providerName = dialog.getValue(); newTab(providerName); categoryList.setSelection(new String[] { providerName }); providersChanged = true; } }
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 void renameFilter() { MarkerFieldFilterGroup filterGroup = getSelectionFromTable(); IInputValidator nameValidator = getNameValidator(filterGroup.getName(), getCurrentConfigurationNames()); InputDialog inputDialog = new InputDialog(getShell(), MarkerMessages.MarkerFilterDialog_title, MarkerMessages.MarkerFilterDialog_message, filterGroup.getName(), nameValidator); if(inputDialog.open() == Window.OK) { filterGroup.setName(inputDialog.getValue()); configsTable.refresh(filterGroup); } }
/** * To be called when add is requested to the table. * * @return Returns new {@link ExcludeRule} or <code>null</code> if definition of one has been * canceled. */ private ExcludeRule addRequested() { InputDialog inputDialog = new InputDialog(getManagedForm().getForm().getShell(), "New Exclude Rule", "Enter class name or pattern:", "", new FqnWildcardValidator(false, false)); if (inputDialog.open() == Window.OK) { ExcludeRule excludeRule = new ExcludeRule(); excludeRule.setClassName(inputDialog.getValue()); return excludeRule; } return null; }