當前位置: 首頁>>代碼示例>>Java>>正文


Java FieldEditor類代碼示例

本文整理匯總了Java中org.eclipse.jface.preference.FieldEditor的典型用法代碼示例。如果您正苦於以下問題:Java FieldEditor類的具體用法?Java FieldEditor怎麽用?Java FieldEditor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FieldEditor類屬於org.eclipse.jface.preference包,在下文中一共展示了FieldEditor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createFieldEditors

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors ()
{
    final List<String> tzs = Arrays.asList ( TimeZone.getAvailableIDs () );
    Collections.sort ( tzs );
    final String[][] entries = new String[tzs.size ()][2];
    int i = 0;
    for ( final String id : tzs )
    {
        entries[i][0] = id;
        entries[i][1] = id;
        i += 1;
    }
    final FieldEditor field = new ComboFieldEditor ( "timeZone", Messages.TimeZonePreferencePage_TimeZone_Label, entries, getFieldEditorParent () ); //$NON-NLS-1$
    addField ( field );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:TimeZonePreferencePage.java

示例2: checkState

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
/**
 * Check if all fields are valid
 * 
 */
private void checkState() {
	if(editorList != null){
		int size = editorList.size();
		for(int i=0; i<size; i++){
			FieldEditor fieldEditor = editorList.get(i);
			if(StringUtils.isNotBlank(((StringFieldEditor)fieldEditor).getErrorMessage())){
				setErrorMessage(((StringFieldEditor)fieldEditor).getErrorMessage());
				setValid(false);
				break;
			}else{
				setValid(true);
			}
		}
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:20,代碼來源:ServicesPreference.java

示例3: createContents

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
@Override
public Control createContents(Composite parent) {
  Composite container = new Composite(parent, SWT.NONE);
  parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  fieldEditor = createFieldEditor(container);
  fieldEditor.setPage(messages);
  fieldEditor.setPropertyChangeListener(new IPropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent event) {
      if (FieldEditor.IS_VALID.equals(event.getProperty())) {
        fireValueChanged(IS_VALID, event.getOldValue(), event.getNewValue());
      } else if (FieldEditor.VALUE.equals(event.getProperty())) {
        fireValueChanged(VALUE, event.getOldValue(), event.getNewValue());
      }
    }
  });
  fieldEditor.setPreferenceStore(getPreferenceStore());
  fieldEditor.load();
  fieldEditor.fillIntoGrid(container, fieldEditor.getNumberOfControls());
  return container;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:22,代碼來源:FieldEditorWrapper.java

示例4: createPollChangesIntervalGroup

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
private void createPollChangesIntervalGroup(Composite composite) {
	Composite groupComposite = new Composite(composite, SWT.LEFT);
	GridLayout layout = new GridLayout();
	layout.numColumns = 2;
	groupComposite.setLayout(layout);
	GridData gd = new GridData();
	gd.horizontalAlignment = GridData.FILL;
	gd.grabExcessHorizontalSpace = true;
	groupComposite.setLayoutData(gd);

	pollChangesInterval = new IntegerFieldEditor(POLL_CHANGES_INTERVAL_PREF, "Poll changes interval (seconds)",
			groupComposite);

	pollChangesInterval.setTextLimit(Integer.toString(MAX_POLL_CHANGES_INTERVAL).length());
	pollChangesInterval.setErrorMessage("The workspace save interval should be between 30 and 9999.");
	pollChangesInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	pollChangesInterval.setValidRange(MIN_POLL_CHANGES_INTERVAL, MAX_POLL_CHANGES_INTERVAL);
	pollChangesInterval.setPropertyChangeListener(event -> {
		if (event.getProperty().equals(FieldEditor.IS_VALID)) {
			setValid(pollChangesInterval.isValid());
		}
	});
	addField(pollChangesInterval);
}
 
開發者ID:cchabanois,項目名稱:mesfavoris,代碼行數:25,代碼來源:GDriveBookmarksStorePreferencePage.java

示例5: performDefaults

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
/**  
 * The field editor preference page implementation of a <code>PreferencePage</code>
 * method loads all the field editors with their default values.
 */
protected void performDefaults()
{
    if (fields != null)
    {
        Iterator e = fields.iterator();
        while (e.hasNext())
        {
            FieldEditor pe = (FieldEditor) e.next();
            pe.loadDefault();
        }
    }
    // Force a recalculation of my error state.
    checkState();
    super.performDefaults();
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:20,代碼來源:GenericFieldEditorPropertyPage.java

示例6: propertyChange

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
/**
 * The field editor preference page implementation of this <code>IPreferencePage</code>
 * (and <code>IPropertyChangeListener</code>) method intercepts <code>IS_VALID</code> 
 * events but passes other events on to its superclass.
 */
public void propertyChange(PropertyChangeEvent event)
{

    if (event.getProperty().equals(FieldEditor.IS_VALID))
    {
        boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
        // If the new value is true then we must check all field editors.
        // If it is false, then the page is invalid in any case.
        if (newValue)
        {
            checkState();
        } else
        {
            setInvalidFieldEditor((FieldEditor) event.getSource());
            setValid(newValue);
        }
    }
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:24,代碼來源:GenericFieldEditorPropertyPage.java

示例7: checkState

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
/**
 * Recomputes the page's error state by calling <code>isValid</code> for
 * every field editor.
 */
protected void checkState()
{
    boolean valid = true;
    setInvalidFieldEditor(null);
    // The state can only be set to true if all
    // field editors contain a valid value. So we must check them all
    if (fields != null)
    {
        int size = fields.size();
        for (int i = 0; i < size; i++)
        {
            FieldEditor editor = (FieldEditor) fields.get(i);
            valid = valid && editor.isValid();
            if (!valid)
            {
                setInvalidFieldEditor(editor);
                break;
            }
        }
    }
    setValid(valid);
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:27,代碼來源:GenericFieldEditorPropertyPage.java

示例8: createFieldEditor

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
@Override
public FieldEditor createFieldEditor(final String name, final String label, final Composite parent, final FieldEditorDetails details) {
	final Class<? extends FieldEditor> type = details.getFieldEditorClass();
	if (DatabaseComboFieldEditor.class.equals(type)) {
		return new DatabaseComboFieldEditor(name, label, details.getLabelsAndValues().toArray(), parent);
	}
	if (ReaderComboFieldEditor.class.equals(type)) {
		return new ReaderComboFieldEditor(name, label, details.getLabelsAndValues().toArray(), parent);
	}
	if (ThresholdsListEditor.class.equals(type)) {
		return new ThresholdsListEditor(name, label, parent);
	}
	if (WriterComboFieldEditor.class.equals(type)) {
		return new WriterComboFieldEditor(name, label, details.getLabelsAndValues().toArray(), parent);
	}
	return super.createFieldEditor(name, label, parent, details);
}
 
開發者ID:Albertus82,項目名稱:RouterLogger,代碼行數:18,代碼來源:RouterLoggerFieldEditorFactory.java

示例9: propertyChange

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
@Override
public void propertyChange(PropertyChangeEvent event) {
    super.propertyChange(event);

    if (event.getProperty().equals(FieldEditor.VALUE)) {

        if (event.getSource() == getCacheHashCodeField()) {
            getHashCodeCachingField().setEnabled(getCacheHashCodeField().getBooleanValue(), getFieldEditorParent());

        } else if (event.getSource() == getCacheToStringField()) {
            getToStringCachingField().setEnabled(getCacheToStringField().getBooleanValue(), getFieldEditorParent());

        } else
            if (event.getSource() == getHashCodeCachingField() || event.getSource() == getToStringCachingField()) {
            checkState();
        }
    }
}
 
開發者ID:maximeAudrain,項目名稱:jenerate,代碼行數:19,代碼來源:JenerateBasePreferencePage.java

示例10: createFieldEditors

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
/**
   * Creates the field editors. Field editors are abstractions of the common GUI
   * blocks needed to manipulate various types of preferences. Each field editor
   * knows how to save and restore itself.
   */
  public void createFieldEditors()
  {
    this.createBeyondCompareFieldEditors();
    this.addField(new EmptyFieldEitor(this.getFieldEditorParent()));
    this.createTortoiseFieldEditors("SVN", "TortoiseProc.exe", "TortoiseMerge.exe", PreferenceConstants.TORTOISE_SVN);
    this.addField(new EmptyFieldEitor(this.getFieldEditorParent()));
    this.createTortoiseFieldEditors("Git", "TortoiseGitProc.exe", "TortoiseGitMerge.exe", PreferenceConstants.TORTOISE_GIT);
    
    /*final String tortoiseHgExecutable = "thg.exe";
    this.addField(new EmptyFieldEitor(this.getFieldEditorParent()));
    this.createTortoiseFieldEditors("Hg", tortoiseHgExecutable, tortoiseHgExecutable, PreferenceConstants.TORTOISE_HG);
*/
    for (BooleanFieldEditor featureEnabledEditor : this.controlMapping.keySet())
    {
      featureEnabledEditor.setPropertyChangeListener(this);
      final boolean featureEnabled = this.getPreferenceStore().getBoolean(featureEnabledEditor.getPreferenceName());
      for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor))
      {
        fieldEditor.setPropertyChangeListener(this);
        fieldEditor.setEnabled(featureEnabled, getFieldEditorParent());
      }
    }
  }
 
開發者ID:ContextQuickie,項目名稱:ContextQuickie,代碼行數:29,代碼來源:ContextQuickie.java

示例11: propertyChange

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
@Override
public final void propertyChange(final PropertyChangeEvent event)
{
  final Object eventSource = event.getSource();
  if (eventSource instanceof BooleanFieldEditor)
  {
    final BooleanFieldEditor featureEnabledEditor = (BooleanFieldEditor) eventSource;
    if (this.controlMapping.keySet().contains(featureEnabledEditor))
    {
      final boolean featureEnabled = featureEnabledEditor.getBooleanValue();
      for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor))
      {
        fieldEditor.setEnabled(featureEnabled, getFieldEditorParent());
      }
    }
  }

  // Updated the apply button in every case because the property change
  // can be caused by a changed string or path value
  this.updateApplyButton();
}
 
開發者ID:ContextQuickie,項目名稱:ContextQuickie,代碼行數:22,代碼來源:ContextQuickie.java

示例12: isValid

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
@Override
public final boolean isValid()
{
  // Search for enabled features wit invalid configuration options
  for (BooleanFieldEditor featureEnabledEditor : this.controlMapping.keySet())
  {
    if (featureEnabledEditor.getBooleanValue() == true)
    {
      for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor))
      {
        if (fieldEditor.isValid() == false)
        {
          return false;
        }
      }
    }
  }

  return true;
}
 
開發者ID:ContextQuickie,項目名稱:ContextQuickie,代碼行數:21,代碼來源:ContextQuickie.java

示例13: createFieldEditors

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
	// Header
	header = createHeader();
	if (header != null) {
		GridDataFactory.fillDefaults().span(Short.MAX_VALUE, 1).applyTo(header);
		addSeparator();
	}

	// Fields
	for (final IPreference preference : preferences) {
		if (pageDefinition.equals(preference.getPageDefinition())) {
			if (preference.isSeparate()) {
				addSeparator();
			}
			final Composite fieldEditorParent = getFieldEditorParent();
			final FieldEditor fieldEditor = createFieldEditor(preference, fieldEditorParent);
			addField(fieldEditor);
			fieldEditorMap.put(preference, new FieldEditorWrapper(fieldEditor, fieldEditorParent));
		}
	}
	universe.putAll(fieldEditorMap);
}
 
開發者ID:Albertus82,項目名稱:JFaceUtils,代碼行數:24,代碼來源:BasePreferencePage.java

示例14: checkParentsEnabled

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
protected boolean checkParentsEnabled(final Set<IPreference> parents) {
	boolean parentEnabled = true;
	for (final IPreference preference : parents) {
		final FieldEditorWrapper fieldEditorWrapper = universe.get(preference);
		if (fieldEditorWrapper == null) {
			parentEnabled = getBooleanFromStore(preference);
		}
		else {
			final FieldEditor fieldEditor = fieldEditorWrapper.getFieldEditor();
			if (fieldEditor instanceof BooleanFieldEditor) {
				try {
					parentEnabled = ((BooleanFieldEditor) fieldEditor).getBooleanValue();
				}
				catch (final NullPointerException e) {
					logger.log(Level.FINE, e.toString(), e);
					parentEnabled = getBooleanFromStore(preference);
				}
			}
		}
		if (!parentEnabled) {
			break; // don't waste time
		}
	}
	return parentEnabled;
}
 
開發者ID:Albertus82,項目名稱:JFaceUtils,代碼行數:26,代碼來源:BasePreferencePage.java

示例15: checkState

import org.eclipse.jface.preference.FieldEditor; //導入依賴的package包/類
/**
 * Recomputes the page's error state by calling <code>isValid</code> for every field editor.
 */
protected void checkState() {
    boolean valid = true;
    m_invalidFieldEditor = null;
    // The state can only be set to true if all
    // field editors contain a valid value. So we must check them all
    if (m_fields != null) {
        int size = m_fields.size();
        for (int i = 0; i < size; i++) {
            FieldEditor editor = m_fields.get(i);
            valid = valid && editor.isValid();
            if (!valid) {
                m_invalidFieldEditor = editor;
                break;
            }
        }
    }
    setValid(true);
}
 
開發者ID:Talend,項目名稱:tesb-studio-se,代碼行數:22,代碼來源:FieldLayoutPreferencePage.java


注:本文中的org.eclipse.jface.preference.FieldEditor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。