Package org.eclipse.jface.preference

Examples of org.eclipse.jface.preference.IntegerFieldEditor


    addField(new FontFieldEditor(PrefConst.P_FNT_FILEBROWSE_STD, "Default Browser Font", getFieldEditorParent()));   

    // addField(new ExtensionListEditor(getFieldEditorParent()));

    addField(new IntegerFieldEditor(PrefConst.P_BRW_MAXFILESIZE, "Max File Size (Bytes)", getFieldEditorParent()));

    addField(new IntegerFieldEditor(PrefConst.P_BRW_ICONSIZE, "Icon Size (pixel)", getFieldEditorParent()));

    addField(new IntegerFieldEditor(PrefConst.P_BRW_MARGINLEFT, "Margin Left", getFieldEditorParent()));

    addField(new IntegerFieldEditor(PrefConst.P_BRW_MARGINRIGHT, "Margin Right", getFieldEditorParent()));

    addField(new IntegerFieldEditor(PrefConst.P_BRW_MARGINTOP, "Margin Top", getFieldEditorParent()));

    addField(new IntegerFieldEditor(PrefConst.P_BRW_MARGINBOTTOM, "Margin Bottom", getFieldEditorParent()));

//    addField(new RadioGroupFieldEditor(PrefConst.P_BRW_EXTS, "Extensions", 2, new String[][]
//      {
//            {
//                "PNG", "png"
View Full Code Here


   * manipulate various types of preferences. Each field editor knows how to save and restore
   * itself.
   */
  @Override
  public void createFieldEditors() {
    addField(new IntegerFieldEditor(PreferenceConstants.P_OPEN_TIMEOUT, "Open timeout:",
      getFieldEditorParent()));
    addField(new IntegerFieldEditor(PreferenceConstants.P_BAUD_RATE, "Baud rate:",
      getFieldEditorParent()));
    addField(new IntegerFieldEditor(PreferenceConstants.P_DATA_BITS, "Data bits:",
      getFieldEditorParent()));
    addField(new IntegerFieldEditor(PreferenceConstants.P_STOP_BITS, "Stop bits:",
      getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(PreferenceConstants.P_PARITY, "Parity", 1,
      new String[][] { { "None", "none" }, { "Even", "even" }, { "Odd", "odd" } },
      getFieldEditorParent()));
  }
View Full Code Here

        editorReuseThresholdGroup.setLayout(new GridLayout());
        editorReuseThresholdGroup.setLayoutData(new GridData(
                GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
        editorReuseThresholdGroup.setFont(font);

        reuseEditorsThreshold = new IntegerFieldEditor(
                IPreferenceConstants.REUSE_EDITORS,
                WorkbenchMessages.WorkbenchPreference_reuseEditorsThreshold, editorReuseThresholdGroup);

        reuseEditorsThreshold.setPreferenceStore(WorkbenchPlugin.getDefault()
                .getPreferenceStore());
View Full Code Here

        gd.horizontalAlignment = GridData.FILL;
        gd.grabExcessHorizontalSpace = true;
        groupComposite.setLayoutData(gd);
        groupComposite.setFont(composite.getFont());

        recentFilesEditor = new IntegerFieldEditor(
                IPreferenceConstants.RECENT_FILES,
                WorkbenchMessages.WorkbenchPreference_recentFiles, groupComposite);

        recentFilesEditor.setPreferenceStore(WorkbenchPlugin.getDefault()
                .getPreferenceStore());
View Full Code Here

    final Composite composite = new Composite(parent, SWT.NONE);
    if (alignedRight) {
      GridDataFactory.create(composite).grabH().alignHR().alignVM();
    }
    // set min width of text control to 40
    IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor(key, text, composite);
    Text textControl = integerFieldEditor.getTextControl(composite);
    GridDataFactory.modify(textControl).hintHC(5);
    addField(integerFieldEditor);
  }
View Full Code Here

            new StringFieldEditor(
                CactusPreferences.CONTEXT_URL_HOST,
                CactusMessages.getString("CactusPreferencePage.label.host"),
                getFieldEditorParent()));
        addField(
            new IntegerFieldEditor(
                CactusPreferences.CONTEXT_URL_PORT,
                CactusMessages.getString("CactusPreferencePage.label.port"),
                getFieldEditorParent()));
        addField(
            new StringFieldEditor(
View Full Code Here

        JsonEditorPlugin.SPACES_FOR_TABS,
        "Insert Spaces For Tabs",
        getFieldEditorParent());
    addField(spacesForTab);

    IntegerFieldEditor indentSpaces = new IntegerFieldEditor(
        JsonEditorPlugin.NUM_SPACES,
        "&Number of spaces to indent:",
        getFieldEditorParent(), 1);
    indentSpaces.setValidRange(0, 10);
    addField(indentSpaces);
  }
View Full Code Here

              new String[]{
                  "Side by side with a split pane (Design first)",
                  "" + V_EDITOR_LAYOUT_SPLIT_HORIZONTAL_DESIGN},}, getFieldEditorParent());
      addField(editorLayout);
      // sync delay
      IntegerFieldEditor syncDelay =
          new IntegerFieldEditor(P_EDITOR_LAYOUT_SYNC_DELAY,
              "Sync Delay (ms):",
              getFieldEditorParent());
      syncDelay.setErrorMessage("Default syncronization delay in milliseconds must be an integer value in 250-10000 range.");
      syncDelay.setEmptyStringAllowed(false);
      syncDelay.setValidRange(-1, Integer.MAX_VALUE);
      syncDelay.getTextControl(getFieldEditorParent()).setToolTipText(
          "Set the default syncronization delay in milliseconds, -1 for syncronization on save");
      addField(syncDelay);
    }
    {
      // From com.google.gdt.eclipse.designer.preferences.MainPreferencePage
View Full Code Here

        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

   * 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

Related Classes of org.eclipse.jface.preference.IntegerFieldEditor

Copyright © 2018 www.massapicom. 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.