Examples of EnumValue


Examples of org.eclipse.ui.internal.editors.text.AccessibilityPreferencePage.EnumeratedDomain.EnumValue

        status.setError(TextEditorMessages.TextEditorPreferencePage_emptyInput);
        return status;
      }

      try {
        EnumValue e= parseEnumValue(value);
        if (!fValueSet.contains(e))
          status.setError(NLSUtility.format(TextEditorMessages.TextEditorPreferencePage_invalidRange, new String[] {getValueByIndex(0).getLabel(), getValueByIndex(fItems.size() - 1).getLabel()}));
      } catch (NumberFormatException e) {
        status.setError(NLSUtility.format(TextEditorMessages.TextEditorPreferencePage_invalidInput, String.valueOf(value)));
      }
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

    final Combo combo= new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
    gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    combo.setLayoutData(gd);
    combo.setToolTipText(preference.getDescription());
    for (Iterator it= domain.fItems.iterator(); it.hasNext();) {
      EnumValue value= (EnumValue) it.next();
      combo.add(value.getLabel());
    }

    combo.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index= combo.getSelectionIndex();
        EnumValue value= domain.getValueByIndex(index);
        IStatus status= domain.validate(value);
        if (!status.matches(IStatus.ERROR))
          fOverlayStore.setValue(preference.getKey(), value.getIntValue());
        updateStatus(status);
      }
    });

    fInitializers.add(fInitializerFactory.create(preference, combo, domain));
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

    spinner.setPageIncrement(4);

    spinner.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index= spinner.getSelection();
        EnumValue value= domain.getValueByInteger(index);
        IStatus status= domain.validate(value);
        if (!status.matches(IStatus.ERROR))
          fOverlayStore.setValue(preference.getKey(), value.getIntValue());
        updateStatus(status);
      }
    });

    fInitializers.add(fInitializerFactory.create(preference, spinner, domain));
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

        fControl= control;
        fDomain= domain;
      }
      public void initialize() {
        int value= fOverlayStore.getInt(fPreference.getKey());
        EnumValue enumValue= fDomain.getValueByInteger(value);
        if (enumValue != null) {
          int index= fDomain.getIndex(enumValue);
          if (index >= 0)
            fControl.select(index);
        }
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

        fControl= control;
        fDomain= domain;
      }
      public void initialize() {
        int value= fOverlayStore.getInt(fPreference.getKey());
        EnumValue enumValue= fDomain.getValueByInteger(value);
        if (enumValue != null) {
          fControl.setSelection(value);
        }
      }
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

    }

    public int getIndex(EnumValue enumValue) {
      int i= 0;
      for (Iterator it= fItems.iterator(); it.hasNext();) {
        EnumValue ev= (EnumValue) it.next();
        if (ev.equals(enumValue))
          return i;
        i++;
      }
      return -1;
    }
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

      return null;
    }

    public EnumValue getValueByInteger(int intValue) {
      for (Iterator it= fItems.iterator(); it.hasNext();) {
        EnumValue e= (EnumValue) it.next();
        if (e.getIntValue() == intValue)
          return e;
      }
      return null;
    }
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

      }
      return null;
    }

    public void addValue(int val) {
      addValue(new EnumValue(val));
    }
View Full Code Here

Examples of org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue

      if (value instanceof String && ((String)value).length() == 0) {
        status.setError(TextEditorMessages.TextEditorPreferencePage_emptyInput);
        return status;
      }
      try {
        EnumValue e= parseEnumValue(value);
        if (!fValueSet.contains(e))
          status.setError(NLSUtility.format(TextEditorMessages.TextEditorPreferencePage_invalidRange, new String[] {getValueByIndex(0).getLabel(), getValueByIndex(fItems.size() - 1).getLabel()}));
      } catch (NumberFormatException e) {
        status.setError(NLSUtility.format(TextEditorMessages.TextEditorPreferencePage_invalidInput, String.valueOf(value)));
      }
View Full Code Here

Examples of org.jboss.metatype.api.values.EnumValue

       if (metaType.isSimple()) {
                SimpleValue simpleValue = (SimpleValue)mp.getValue();
                return expectedType.cast((simpleValue != null) ? simpleValue.getValue() : null);
       }
       else if (metaType.isEnum()) {
         EnumValue enumValue = (EnumValue)mp.getValue();
         return expectedType.cast((enumValue != null) ? enumValue.getValue() : null);
       }
       throw new IllegalArgumentException(prop+ " is not a simple type"); //$NON-NLS-1$
     }
     return null;
 
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.