1 11 package org.eclipse.ui.ide.dialogs; 12 13 import org.eclipse.swt.widgets.Composite; 14 import org.eclipse.swt.widgets.Group; 15 import org.eclipse.ui.ide.IDEEncoding; 16 17 27 public final class EncodingFieldEditor extends AbstractEncodingFieldEditor { 28 29 30 47 public EncodingFieldEditor(String name, String labelText, 48 String groupTitle, Composite parent) { 49 super(name, labelText, groupTitle, parent); 50 } 51 58 public EncodingFieldEditor(String name, String labelText, Composite parent) { 59 super(name, labelText, parent); 60 } 61 64 protected String getStoredValue() { 65 return getPreferenceStore().getString(getPreferenceName()); 66 } 67 68 71 protected void doStore() { 72 String encoding = getSelectedEncoding(); 73 74 if(hasSameEncoding(encoding)) { 75 return; 76 } 77 78 IDEEncoding.addIDEEncoding(encoding); 79 80 if (encoding.equals(getDefaultEnc())) { 81 getPreferenceStore().setToDefault(getPreferenceName()); 82 } else { 83 getPreferenceStore().setValue(getPreferenceName(), encoding); 84 } 85 } 86 87 } 88 | Popular Tags |