Package org.eclipse.jface.preference

Examples of org.eclipse.jface.preference.StringFieldEditor


    editor = new BooleanFieldEditor(
        UIPreferences.PREF_DEFAULT_SCOPE_SAME_PROJECT_ONLY,
        UIMessages.CoveragePreferencesSameProjectOnly_label, group);
    addField(editor);
    editor.fillIntoGrid(group, 2);
    editor = new StringFieldEditor(UIPreferences.PREF_DEFAULT_SCOPE_FILTER,
        UIMessages.CoveragePreferencesClasspathFilter_label, group);
    addField(editor);
    editor.fillIntoGrid(group, 2);
    adjustGroupLayout(group);
  }
View Full Code Here


  private void createCoverageRuntimeGroup(final Composite parent) {
    FieldEditor editor;
    final Group group = createGroup(parent,
        UIMessages.CoveragePreferencesCoverageRuntime_title);
    editor = new StringFieldEditor(UIPreferences.PREF_AGENT_INCLUDES,
        UIMessages.CoveragePreferencesIncludes_label, group);
    addField(editor);
    editor.fillIntoGrid(group, 2);
    editor = new StringFieldEditor(UIPreferences.PREF_AGENT_EXCLUDES,
        UIMessages.CoveragePreferencesExcludes_label, group);
    addField(editor);
    editor.fillIntoGrid(group, 2);
    editor = new StringFieldEditor(UIPreferences.PREF_AGENT_EXCLCLASSLOADER,
        UIMessages.CoveragePreferencesExcludeClassloaders_label, group);
    addField(editor);
    editor.fillIntoGrid(group, 2);
    Label hint = new Label(group, SWT.WRAP);
    GridDataFactory.fillDefaults().span(2, 1).applyTo(hint);
View Full Code Here

        UIPreferences.PREF_DEFAULT_INSTRUMENTATION_SOURCE_FOLDERS_ONLY,
        UIMessages.CoveragePreferencesSourceFoldersOnly_label, parent));
    addField(new BooleanFieldEditor(
        UIPreferences.PREF_DEFAULT_INSTRUMENTATION_SAME_PROJECT_ONLY,
        UIMessages.CoveragePreferencesSameProjectOnly_label, parent));
    addField(new StringFieldEditor(
        UIPreferences.PREF_DEFAULT_INSTRUMENTATION_FILTER,
        UIMessages.CoveragePreferencesClasspathFilter_label, parent));

    // Links:
    createSpacer(parent);
View Full Code Here

                    editor_Language = new RadioGroupFieldEditor(Preference.lang, "Select your language.", 2,
                            labelAndValues, parent);
                    addField(editor_Language);

                    // output file encoding
                    addField(new StringFieldEditor(Preference.Common.outputFileEncoding, props
                            .get(Preference.Common.outputFileEncoding), parent));

                    // src/main/java
                    addField(new StringFieldEditor(Preference.Common.srcMainPath, props
                            .get(Preference.Common.srcMainPath), parent));
                    // src/test/java
                    addField(new StringFieldEditor(Preference.Common.srcTestPath, props
                            .get(Preference.Common.srcTestPath), parent));

                    // line break policy
                    {
                        String forceCRLF = Preference.LineBreakPolicy.forceCRLF;
                        String forceLF = Preference.LineBreakPolicy.forceLF;
                        String forceNewFileCRLF = Preference.LineBreakPolicy.forceNewFileCRLF;
                        String forceNewFileLF = Preference.LineBreakPolicy.forceNewFileLF;
                        String[][] lbpLabelAndValues = new String[][] { { props.get(forceCRLF), forceCRLF },
                                { props.get(forceLF), forceLF }, { props.get(forceNewFileCRLF), forceNewFileCRLF },
                                { props.get(forceNewFileLF), forceNewFileLF } };
                        editor_lineBreakPolicy = new RadioGroupFieldEditor(Preference.Common.lineBreakPolicy, props
                                .get(Preference.LineBreakPolicy.description), 5, lbpLabelAndValues, parent);
                        addField(editor_lineBreakPolicy);
                    }

                    // Soft tabs
                    {
                        editor_useSoftTabs = new BooleanFieldEditor(Preference.Common.useSoftTabs, props
                                .get(Preference.Common.useSoftTabs), parent);
                        addField(editor_useSoftTabs);
                        editor_softTabSize = new StringFieldEditor(Preference.Common.softTabSize, props
                                .get(Preference.Common.softTabSize), parent);
                        addField(editor_softTabSize);
                    }

                    // JUnit version(3 or 4)
                    String ver3 = Preference.TestClassGen.junitVersion3;
                    String ver4 = Preference.TestClassGen.junitVersion4;
                    String[][] junitVersionsLabelAndValues = new String[][] { { props.get(ver3), ver3 },
                            { props.get(ver4), ver4 }, };

                    editor_JUnitVersion = new RadioGroupFieldEditor(Preference.TestClassGen.junitVersion, props
                            .get(Preference.TestClassGen.description), 2, junitVersionsLabelAndValues, parent) {
                        @Override
                        protected void fireValueChanged(String p, Object o, Object n) {
                            super.fireValueChanged(p, o, n);
                            IPreferenceStore store = Activator.getDefault().getPreferenceStore();
                            store.setValue(Preference.TestClassGen.junitVersion, String.valueOf(n));
                        }
                    };
                    addField(editor_JUnitVersion);

                    // class to extend
                    editor_ClassToExtend = new StringFieldEditor(Preference.TestClassGen.classToExtend, props
                            .get(Preference.TestClassGen.classToExtend), parent);
                    addField(editor_ClassToExtend);

                    // common delimiter setting
                    editor_TestMethodNameBasicDelimiter = new StringFieldEditor(Preference.TestMethodGen.delimiter,
                            props.get(Preference.TestMethodGen.delimiter), 10, parent);
                    addField(editor_TestMethodNameBasicDelimiter);

                    editor_isTestMethodNameArgsRequired = new BooleanFieldEditor(Preference.TestMethodGen.enabledArgs,
                            props.get(Preference.TestMethodGen.enabledArgs), parent);
                    addField(editor_isTestMethodNameArgsRequired);
                    editor_TestMethodNameArgsPrefix = new StringFieldEditor(Preference.TestMethodGen.argsPrefix, props
                            .get(Preference.TestMethodGen.argsPrefix), parent);
                    addField(editor_TestMethodNameArgsPrefix);
                    editor_TestMethodNameArgsDelimiter = new StringFieldEditor(Preference.TestMethodGen.argsDelimiter,
                            props.get(Preference.TestMethodGen.argsDelimiter), parent);
                    addField(editor_TestMethodNameArgsDelimiter);

                    editor_isTestMethodNameReturnTypeRequired = new BooleanFieldEditor(
                            Preference.TestMethodGen.enabledReturn, props.get(Preference.TestMethodGen.enabledReturn),
                            parent);
                    addField(editor_isTestMethodNameReturnTypeRequired);
                    editor_TestMethodNameReturnPrefix = new StringFieldEditor(Preference.TestMethodGen.returnPrefix,
                            props.get(Preference.TestMethodGen.returnPrefix), parent);
                    addField(editor_TestMethodNameReturnPrefix);
                    editor_TestMethodNameRetrnDelimiter = new StringFieldEditor(
                            Preference.TestMethodGen.returnDelimiter, props
                                    .get(Preference.TestMethodGen.returnDelimiter), parent);
                    addField(editor_TestMethodNameRetrnDelimiter);

                    // enable exception thrown
                    editor_isExceptionThrownRequired = new BooleanFieldEditor(
                            Preference.TestMethodGen.enabledException, props
                                    .get(Preference.TestMethodGen.enabledException), parent);
                    addField(editor_isExceptionThrownRequired);
                    editor_TestMethodNameExceptionPrefix = new StringFieldEditor(
                            Preference.TestMethodGen.exceptionPrefix, props
                                    .get(Preference.TestMethodGen.exceptionPrefix), parent);
                    addField(editor_TestMethodNameExceptionPrefix);
                    editor_TestMethodNameExceptionDelimiter = new StringFieldEditor(
                            Preference.TestMethodGen.exceptionDelimiter, props
                                    .get(Preference.TestMethodGen.exceptionDelimiter), parent);
                    addField(editor_TestMethodNameExceptionDelimiter);

                    // public methods
View Full Code Here

     * restore itself.
     */
    public void createFieldEditors()
    {
        addField(
            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(
                CactusPreferences.CONTEXT_URL_PATH,
                CactusMessages.getString("CactusPreferencePage.label.context"),
                getFieldEditorParent()));
        addField(
            new DirectoryFieldEditor(
View Full Code Here

                parent);
        jetty.getLabelControl(parent).setToolTipText(
            CactusMessages.getString(
                "ContainersPreferencePage.label.jetty.tooltip"));
        addField(jetty);
        StringFieldEditor jettyXML =
            new StringFieldEditor(
                CactusPreferences.JETTY_XML,
                CactusMessages.getString(
                    "ContainersPreferencePage.label.jettyxml"),
                parent);
        jettyXML.getTextControl(parent).setToolTipText(
            CactusMessages.getString(
                "ContainersPreferencePage.label.jettyxml.tooltip"));
        addField(jettyXML);
    }
View Full Code Here

  }
 
  @Override
  public void createFieldEditors() {
    addField(
      new StringFieldEditor(PreferenceConstants.P_IMAGE_REPOSITORY_URL,
          "URL image repository at Magiccards.info:", getFieldEditorParent()));
   
    createHttpProxy(getFieldEditorParent(), 3);
  }
View Full Code Here

    layout.numColumns = 2;
    proxyParent.setLayout(layout);

    enableEditor = new BooleanFieldEditor(PreferenceConstants.P_HTTP_PROXY_ENABLE, "Enable HTTP proxy connection", proxyParent);
    addField( enableEditor );
    hostEditor = new StringFieldEditor(PreferenceConstants.P_HTTP_PROXY_HOST, "HTTP proxy host address", proxyParent);
    addField( hostEditor );
    portEditor = new StringFieldEditor(PreferenceConstants.P_HTTP_PROXY_PORT, "HTTP proxy host port", proxyParent) {
        @Override
      protected boolean doCheckState() {
          try {
            String portValue = getStringValue();
            int num = 80;
View Full Code Here

    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$
View Full Code Here

   * restore itself.
   */
  public void createFieldEditors() {

    addField(
      new StringFieldEditor(PreferenceConstants.P_CARDLIST_URL, "URL to Standard Tournament Cardlist:", getFieldEditorParent()));
    addField(
      new StringFieldEditor(PreferenceConstants.P_REGEX_CARD, "Regular Expression to scan for card names:", getFieldEditorParent()));
   
    addField(
        new RestrictedListEditor(PreferenceConstants.P_RESTRICTED_CARDS, "List of restricted cards in this set:", getFieldEditorParent()));
  }
View Full Code Here

TOP

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

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.