protected void createFieldEditors() { secretSFE = new StringFieldEditor("secret", "&Secret:\t\t",getFieldEditorParent()){
/** * Checks whether the text input field contains a valid value or not. * * @return <code>true</code> if the field value is valid, * and <code>false</code> if invalid */ protected boolean checkState() { boolean result = false; if (emptyStringAllowed) { result = true; } if (textField == null) { result = false; } String txt = textField.getText(); result = (txt.trim().length() > 0) || emptyStringAllowed; // call hook for subclasses result = result && doCheckState(); if (result) { clearErrorMessage(); } else { showErrorMessage(errorMessage); } return result; }
public String getOutjarValue() { return outputJarEditor.getStringValue(); }
public void focusLost(FocusEvent e) { valueChanged(); clearErrorMessage(); } });
private void createNlsExtensionsGroup(Composite parent) { nlExtensionsField = new StringFieldEditor(IPreferenceConstants.NL_EXTENSIONS, WorkbenchMessages.GlobalizationPreference_nlExtensions, parent); nlExtensionsField.setPreferenceStore(getPreferenceStore()); nlExtensionsField.setPage(this); nlExtensionsField.load(); }
@Override protected void createFieldEditors() { fPaddedString = new StringFieldEditor(IDebugUIConstants.PREF_PADDED_STR, DebugUIMessages.SetPaddedStringPreferencePage_0, getFieldEditorParent()); fPaddedString.setEmptyStringAllowed(false); fPaddedString.setTextLimit(5); addField(fPaddedString); }
/** * Create the widget for the system explorer command. * * @param composite */ protected void createSystemExplorerGroup(Composite composite) { Composite groupComposite = new Composite(composite, SWT.LEFT); GridLayout layout = new GridLayout(); layout.numColumns = 2; groupComposite.setLayout(layout); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; groupComposite.setLayoutData(gd); systemExplorer = new StringFieldEditor(IDEInternalPreferences.WORKBENCH_SYSTEM_EXPLORER, IDEWorkbenchMessages.IDEWorkbenchPreference_workbenchSystemExplorer, 40, groupComposite); Text textControl = systemExplorer.getTextControl(groupComposite); BidiUtils.applyBidiProcessing(textControl, BidiUtils.LEFT_TO_RIGHT); gd = (GridData) textControl.getLayoutData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; systemExplorer.setPreferenceStore(getIDEPreferenceStore()); systemExplorer.setPage(this); systemExplorer.load(); systemExplorer.setPropertyChangeListener(event -> { if (event.getProperty().equals(FieldEditor.IS_VALID)) { setValid(systemExplorer.isValid()); } }); }
@Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); m_jvmArgs = new StringFieldEditor(TestNGPluginConstants.S_JVM_ARGS, "JVM args:", StringFieldEditor.UNLIMITED, parent); m_jvmArgs.setEmptyStringAllowed(true); m_jvmArgs.fillIntoGrid(parent, 2); addField(m_jvmArgs); }
Composite parentComposite= getFieldEditorParent(); m_outputdir = new StringFieldEditor(TestNGPluginConstants.S_OUTDIR, ResourceUtil.getString("TestNGPropertyPage.outputDir"), parentComposite); parentComposite); m_preDefinedListeners = new StringFieldEditor(TestNGPluginConstants.S_PRE_DEFINED_LISTENERS, ResourceUtil.getString("TestNGPropertyPage.preDefinedListeners"), parentComposite); m_excludedStackTraces = new StringFieldEditor(TestNGPluginConstants.S_EXCLUDED_STACK_TRACES, "Excluded stack traces:", parentComposite); m_excludedStackTraces.fillIntoGrid(parentComposite, 3); GridDataFactory.fillDefaults().grab(true, false) .hint(convertWidthInCharsToPixels(36), SWT.DEFAULT) .applyTo(m_excludedStackTraces.getTextControl(parentComposite));
@Override protected void createFieldEditors() { fAsciiCodePage = new StringFieldEditor(IDebugUIConstants.PREF_DEFAULT_ASCII_CODE_PAGE, DebugUIMessages.CodePagesPrefDialog_2, getFieldEditorParent()); fAsciiCodePage.setEmptyStringAllowed(false); addField(fAsciiCodePage); fEbcdicCodePage = new StringFieldEditor(IDebugUIConstants.PREF_DEFAULT_EBCDIC_CODE_PAGE, DebugUIMessages.CodePagesPrefDialog_4, getFieldEditorParent()); fEbcdicCodePage.setEmptyStringAllowed(false); addField(fEbcdicCodePage); }
new StringFieldEditor( row3Comp); nonStandardOptionsEditor.setStringValue(currValue);
/** * Fills this field editor's basic controls into the given parent. * <p> * The string field implementation of this <code>FieldEditor</code> * framework method contributes the text field. Subclasses may override * but must call <code>super.doFillIntoGrid</code>. * </p> */ protected void doFillIntoGrid(Composite parent, int numColumns) { getLabelControl(parent); textField = getTextControl(parent); GridData gd = new GridData(); gd.horizontalSpan = numColumns - 1; if (widthInChars != UNLIMITED) { GC gc = new GC(textField); try { Point extent = gc.textExtent("X");//$NON-NLS-1$ gd.widthHint = widthInChars * extent.x; } finally { gc.dispose(); } } else { gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; } textField.setLayoutData(gd); }
public void setEnabled(boolean enabled, Composite parent) { super.setEnabled(enabled, parent); getTextControl(parent).setEnabled(enabled); } }
); String outJar = outputJarEditor.getStringValue(); IClasspathEntry newEntry = null; if (outJar != null && !outJar.equals("")) { //$NON-NLS-1$ checkIfOnAspectpath(thisProject, outJar)){ MessageDialog.openInformation(getShell(), UIMessages.buildpathwarning_title, UIMessages.buildConfig_invalidOutjar); outputJarEditor.setStringValue(oldOutJar); }else{ LaunchConfigurationManagementUtils.updateOutJar(JavaCore .create(thisProject), oldEntry, newEntry); AspectJCorePreferences.setProjectOutJar(thisProject, outputJarEditor .getStringValue());
@Override public void keyPressed(KeyEvent e) { clearErrorMessage(); } });
@Override protected void refreshValidState() { isValid = checkState(); }
checkParent(textField, parent);
return super.doCheckState();
private void createFilterExtensions(Composite composite) { filterExtensionsEditor = new StringFieldEditor(ILogViewerConstants.PREF_FILTER_EXTENSIONS,LogViewerPlugin.getResourceString("preferences.contenteditor.filterextensions.label.text"),composite); //$NON-NLS-1$ filterExtensionsEditor.setPreferenceStore(doGetPreferenceStore()); filterExtensionsEditor.setPage(this); filterExtensionsEditor.setTextLimit(128); //filterExtensionsEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.readwait.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_READWAIT_SIZE)})); //$NON-NLS-1$ //filterExtensionsEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); //filterExtensionsEditor.setValidRange(0,ILogViewerConstants.MAX_READWAIT_SIZE); filterExtensionsEditor.load(); //filterExtensionsEditor.setPropertyChangeListener(validityChangeListener); }
/** * Fills this field editor's basic controls into the given parent. * <p> * The string field implementation of this <code>FieldEditor</code> * framework method contributes the text field. Subclasses may override * but must call <code>super.doFillIntoGrid</code>. * </p> */ @Override protected void doFillIntoGrid(Composite parent, int numColumns) { getLabelControl(parent); textField = getTextControl(parent); GridData gd = new GridData(); gd.horizontalSpan = numColumns - 1; if (widthInChars != UNLIMITED) { GC gc = new GC(textField); try { Point extent = gc.textExtent("X");//$NON-NLS-1$ gd.widthHint = widthInChars * extent.x; } finally { gc.dispose(); } } else { gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; } textField.setLayoutData(gd); }