Examples of IInputValidator


Examples of org.eclipse.jface.dialogs.IInputValidator

  public void execute(Object tile) {
    InputDialog inputDialog = new InputDialog(new Shell(),
        Messages.CreateUnitTileAction_NumerOfUnitsTitle,
        Messages.CreateUnitTileAction_NumberOfUnitsQuestion,
        Messages.CreateUnitTileAction_NumberOfUnitDefault,
        new IInputValidator() {
          @Override
          public String isValid(String newText) {
            try {
              int parseInt = Integer.parseInt(newText);
              if (parseInt <= 0) {
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

    InputDialog prompt = new InputDialog(
      parent,
      title,
      message,
      name,
      new IInputValidator(){
        public String isValid(String name) {
          return name.length() > 2 ? name : null;
        }     
    });   
    if( prompt.open() == Window.OK ){
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

     */
    protected String getNewInputObject() {
        if( prompt == null ){
            prompt = "Please enter:";
        }
        InputDialog dialog = new InputDialog( getShell(), "New "+getLabelText(), prompt, "", new IInputValidator(){
            public String isValid( String newText ) {
                if( newText == null || newText.length() == 0 ){
                    return "Action is required";
                }
                return null;
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    btnAdd.setText(Messages.UniqueValuesDialog_AddButton);
    btnAdd.addSelectionListener(new SelectionAdapter(){
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog id = new InputDialog(getParentShell(), Messages.UniqueValuesDialog_AddValueDialogTitle, Messages.UniqueValuesDialog_AddValueDialogMessage, "0", new IInputValidator() { //$NON-NLS-1$
          @Override
          public String isValid(String newText) {
            try{
              Double.parseDouble(newText);
              return null;
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

    if (proposal == null)
      proposal= ""; //$NON-NLS-1$

    String title= getString(fBundle, fPrefix + "add.dialog.title", fPrefix + "add.dialog.title"); //$NON-NLS-2$ //$NON-NLS-1$
    String message= getString(fBundle, fPrefix + "add.dialog.message", fPrefix + "add.dialog.message"); //$NON-NLS-2$ //$NON-NLS-1$
    IInputValidator inputValidator= new IInputValidator() {
      public String isValid(String newText) {
        return (newText == null || newText.trim().length() == 0) ? " " : null; //$NON-NLS-1$
      }
    };
    InputDialog dialog= new InputDialog(fTextEditor.getSite().getShell(), title, message, proposal, inputValidator);
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

      if (encodingSupport == null)
        return;

      String title= TextEditorMessages.Editor_ConvertEncoding_Custom_dialog_title;
      String message= TextEditorMessages.Editor_ConvertEncoding_Custom_dialog_message;
      IInputValidator inputValidator = new IInputValidator() {
        public String isValid(String newText) {
          return (newText == null || newText.length() == 0) ? " " : null; //$NON-NLS-1$
        }
      };
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

    if (proposal == null)
      proposal= ""; //$NON-NLS-1$

    String title= getString(fBundle, fPrefix + "dialog.title", fPrefix + "dialog.title"); //$NON-NLS-2$ //$NON-NLS-1$
    String message= getString(fBundle, fPrefix + "dialog.message", fPrefix + "dialog.message"); //$NON-NLS-2$ //$NON-NLS-1$
    IInputValidator inputValidator= new IInputValidator() {
      public String isValid(String newText) {
        return  (newText == null || newText.trim().length() == 0) ? " " : null//$NON-NLS-1$
      }
    };
    InputDialog dialog= new InputDialog(getTextEditor().getSite().getShell(), title, message, proposal, inputValidator);
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

            private String getNewName(final String oldName,
                                   final DeviceRepositoryAccessorManager dram,
                                   final boolean hasAdminRights) {
                final RE deviceNameMatch =
                        new RE(DeviceConstants.DEVICE_NAME_REGEXP_STRING);
                IInputValidator validator = new IInputValidator() {
                    public String isValid(String string) {
                        if (!hasAdminRights && !string.startsWith("_")) {
                            string = "_" + string;
                        }
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

  private void changeFeature(Shell shell, Object node) {
    FeatureCheckTreeNode featTreeNode = (FeatureCheckTreeNode) node;
    shell.setText("Change value of feature");
    Type range = featTreeNode.getFeature().getRange();
    IInputValidator validator = new ChangeFeatureValidator(range);
    InputDialog dialog = new InputDialog(getShell(), "Define new feature value",
            "New feature value:", "", validator);
    if (dialog.open() == Window.OK) {
      featTreeNode.setValue(dialog.getValue());
      treeView.refresh();
View Full Code Here

Examples of org.eclipse.jface.dialogs.IInputValidator

            RutaPreferenceConstants.EDITOR_FOLDING_BLOCKS,
            RutaPreferenceConstants.EDITOR_FOLDING_BLOCKS_INCLUDE);
    fIncludePatterns = new ListBlock(blockFolding,
            RutaPreferenceConstants.EDITOR_FOLDING_INCLUDE_LIST);

    IInputValidator val = new IInputValidator() {

      public String isValid(String number) {
        if (number.length() == 0) {
          return PreferencesMessages.DLTKEditorPreferencePage_empty_input;
        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.