private void saveSelected() { getPreferences().put(getKey(), Integer.toString(fSelected)); setChanged(); notifyObservers(); }
private void saveSelected() { getPreferences().put(getKey(), Integer.toString(fSelected)); setChanged(); notifyObservers(); }
private void saveSelected() { getPreferences().put(getKey(), Integer.toString(fSelected)); setChanged(); notifyObservers(); }
@Override protected void updateWidget() { final boolean hasKey= getKey() != null; if (fNumberLabel != null) fNumberLabel.setEnabled(hasKey && getEnabled()); fNumberText.setEnabled(hasKey && getEnabled()); if (hasKey) { String s= getPreferences().get(getKey()); try { fSelected= Integer.parseInt(s); } catch (NumberFormatException e) { final String message= Messages.format(FormatterMessages.ModifyDialogTabPage_NumberPreference_error_invalid_key, getKey()); JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, message, e)); s= ""; //$NON-NLS-1$ } fNumberText.setText(s); } else { fNumberText.setText(""); //$NON-NLS-1$ } }
protected void updateWidget() { final boolean hasKey= getKey() != null; fNumberLabel.setEnabled(hasKey && getEnabled()); fNumberText.setEnabled(hasKey && getEnabled()); if (hasKey) { String s= (String)getPreferences().get(getKey()); try { fSelected= Integer.parseInt(s); } catch (NumberFormatException e) { final String message= Messages.format(FormatterMessages.ModifyDialogTabPage_NumberPreference_error_invalid_key, getKey()); JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, message, e)); s= ""; //$NON-NLS-1$ } fNumberText.setText(s); } else { fNumberText.setText(""); //$NON-NLS-1$ } }
@Override protected void updateWidget() { final boolean hasKey= getKey() != null; if (fNumberLabel != null) fNumberLabel.setEnabled(hasKey && getEnabled()); fNumberText.setEnabled(hasKey && getEnabled()); if (hasKey) { String s= getPreferences().get(getKey()); try { fSelected= Integer.parseInt(s); } catch (NumberFormatException e) { final String message= Messages.format(FormatterMessages.ModifyDialogTabPage_NumberPreference_error_invalid_key, getKey()); JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, message, e)); s= ""; //$NON-NLS-1$ } fNumberText.setText(s); } else { fNumberText.setText(""); //$NON-NLS-1$ } }