Examples of IntegerFieldEditor


Examples of org.eclipse.jface.preference.IntegerFieldEditor

        return ok;
      }
    };
    fePort.setTextLimit(6); */
   
    fePort=new IntegerFieldEditor(PreferenceConstants.P_SERVERPORT,
        Messages.getString("MaudeDaemon.MAUDE_PORT"), compServerB);
   
    feIP=new StringFieldEditor(PreferenceConstants.P_SERVERIP,
        Messages.getString("MaudeDaemon.MAUDE_IP"),15, compServerA){ //$NON-NLS-1$
      protected boolean checkState() {
        //boolean state= super.checkState();
        char [] txt = getStringValue().toCharArray();
        int points=0;
        boolean isDigit=true;
        for(int i=0;i<txt.length;i++){
          if(txt[i]=='.'){
            points++;
            isDigit= isDigit && (i==3 || i==7 || i==11);
          }
          else{
            isDigit=isDigit && Character.isDigit(txt[i]);
          }
        }
        boolean res =( points==3 && isDigit && txt.length==15) || txt.length==0 ;
        if(!res) showErrorMessage(Messages.getString("MaudeDaemon.ERROR_IP_MESSAGE")); //$NON-NLS-1$
        else{
          clearErrorMessage();
//          fePathMaude.setEnabled(txt.length==0,compPaths);
          //fePathFMaude.setEnabled(txt.length==0,compPaths);
//          fePort.setEnabled(!(txt.length==0),compPaths3);
//          setServerOn(!(txt.length==0));
        }
        return res;
      }
     
    };
    feIP.setTextLimit(15);
    addField(feIP); //$NON-NLS-1$

   
    addField(fePort); //$NON-NLS-1$
   
   
   
    //aqui establecemos la relacion de eventos de cambios de seleccion de uno a otro
    //cbLocalExecution
    //cbRemoteExecution
   
 
    final Button cbLoc= cbLocalExecution.getCheckBox();
    final Button cbRem= cbRemoteExecution.getCheckBox();
   
    cbLoc.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                    boolean isSelected = cbLoc.getSelection();
                    cbRem.setSelection(!isSelected);
                   
                    refreshStates(isSelected);

                    fePathMaude.load();
//                    fePathPrelude.load();
                    fePathFMaude.load();
                    feIP.load();
                    fePort.load();
                    checkState();
                   
                }
         });
   
    cbRem.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                boolean isSelected = cbRem.getSelection();
                cbLoc.setSelection(!isSelected);
               
                refreshStates(!isSelected);
                fePathMaude.load();
//               fePathPrelude.load();
                fePathFMaude.load();
                feIP.load();
                fePort.load();
                checkState();
            }
    });
   
   
   
   
    Composite compTempCols = new Composite(top, SWT.NONE);
    gdFill = new GridData(GridData.FILL_HORIZONTAL);
    compTempCols.setLayoutData(gdFill);
    compTempCols.setLayout(layout3);
    //zona donde coloco la ruta de los ficheros temporales
    DirectoryFieldEditor dfed=new DirectoryFieldEditor(PreferenceConstants.P_PATHLOG,
        Messages.getString("MaudeDaemon.PREF_LOGDIR"), compTempCols);
    dfed.setEmptyStringAllowed(false);
    addField(dfed); //$NON-NLS-1$



    // Control to group the trace options
    {
      Group groupLogging = new Group(top, SWT.NONE);
      gdFill = new GridData(GridData.FILL_HORIZONTAL);
      groupLogging.setLayoutData(gdFill);
      groupLogging.setLayout(layout1);
      groupLogging.setText(Messages.getString("MaudeDaemon.GROUP_LOGGING")); //$NON-NLS-1$
 
      // This is a Composite to align correctly the file field editors
      Composite comp1Cols = new Composite(groupLogging, SWT.NONE);
      gdFill = new GridData(GridData.FILL_HORIZONTAL);
      comp1Cols.setLayoutData(gdFill);
      comp1Cols.setLayout(layout2);
    /*  Composite comp3Cols = new Composite(groupLogging, SWT.NONE);
      gdFill = new GridData(GridData.FILL_HORIZONTAL);
      comp3Cols.setLayoutData(gdFill);
      comp3Cols.setLayout(layout3); */
      Composite comp2Cols = new Composite(groupLogging, SWT.NONE);
      gdFill = new GridData(GridData.FILL_HORIZONTAL);
      comp2Cols.setLayoutData(gdFill);
      comp2Cols.setLayout(layout2);
     
 
      addField(new BooleanFieldEditor(PreferenceConstants.P_ENABLELOGGING,
          Messages.getString("MaudeDaemon.PREF_ENABLELOGGING"), comp1Cols)); //$NON-NLS-1$
      addField(new StringFieldEditor(PreferenceConstants.P_LOGNAME,
          Messages.getString("MaudeDaemon.PREF_LOGFILE"), comp2Cols)); //$NON-NLS-1$
      IntegerFieldEditor ifemsize = (IntegerFieldEditor) addField(new IntegerFieldEditor(PreferenceConstants.P_MAXSIZE,
          Messages.getString("MaudeDaemon.PREF_MAXSIZE"), comp2Cols)); //$NON-NLS-1$
      IntegerFieldEditor ife = (IntegerFieldEditor) addField(new IntegerFieldEditor(PreferenceConstants.P_FLUSHINTERVAL,
          Messages.getString("MaudeDaemon.PREF_FLUSHINTERVAL"), comp2Cols)); //$NON-NLS-1$
     
      ife.setValidRange(1,Integer.MAX_VALUE);
      ifemsize.setValidRange(1,Integer.MAX_VALUE);
      ifemsize.setEmptyStringAllowed(false);

    }
   
    // Control to group the console options
    {
      Group groupConsole = new Group(top, SWT.NONE);
      gdFill = new GridData(GridData.FILL_HORIZONTAL);
      groupConsole.setLayoutData(gdFill);
      groupConsole.setLayout(layout1);
      groupConsole.setText(Messages.getString("MaudeDaemon.GROUP_CONSOLE")); //$NON-NLS-1$
 
      // This is a Composite to align correctly the file field editors
      Composite comp1Cols = new Composite(groupConsole, SWT.NONE);
      gdFill = new GridData(GridData.FILL_HORIZONTAL);
      comp1Cols.setLayoutData(gdFill);
      comp1Cols.setLayout(layout2);
      Composite comp2Cols = new Composite(groupConsole, SWT.NONE);
      gdFill = new GridData(GridData.FILL_HORIZONTAL);
      comp2Cols.setLayoutData(gdFill);
      comp2Cols.setLayout(layout2);
     
 
      addField(new BooleanFieldEditor(PreferenceConstants.P_ENABLECONSOLE,
          Messages.getString("MaudeDaemon.PREF_ENABLECONSOLE"), comp1Cols)); //$NON-NLS-1$
      IntegerFieldEditor ife = (IntegerFieldEditor) addField(new IntegerFieldEditor(PreferenceConstants.P_CONSOLESIZE,
          Messages.getString("MaudeDaemon.PREF_CONSOLESIZE"), comp2Cols)); //$NON-NLS-1$
     
      ife.setValidRange(1,Integer.MAX_VALUE);
 
    }
   
    // Radio buttons of the execution type
    addField(new RadioGroupFieldEditor(
View Full Code Here

Examples of org.eclipse.jface.preference.IntegerFieldEditor

   * editor knows how to save and restore itself.
   */
  @Override
  public void createFieldEditors() {
    // TODO externalize
    addField(new IntegerFieldEditor(Preferences.SEARCH_DEPTH,
        "maximal search depth:", getFieldEditorParent())); //$NON-NLS-1$
  }
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.