]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/preferences/NameConventionConfigurationBlock.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / ui / org / eclipse / jdt / internal / ui / preferences / NameConventionConfigurationBlock.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2011 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.preferences;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 import org.eclipse.swt.SWT;
17 import org.eclipse.swt.graphics.Image;
18 import org.eclipse.swt.layout.GridLayout;
19 import org.eclipse.swt.widgets.Composite;
20 import org.eclipse.swt.widgets.Control;
21 import org.eclipse.swt.widgets.Shell;
22
23 import org.eclipse.core.runtime.IStatus;
24
25 import org.eclipse.core.resources.IProject;
26
27 import org.eclipse.jface.dialogs.StatusDialog;
28 import org.eclipse.jface.viewers.ColumnLayoutData;
29 import org.eclipse.jface.viewers.ColumnWeightData;
30 import org.eclipse.jface.viewers.ITableLabelProvider;
31 import org.eclipse.jface.viewers.LabelProvider;
32 import org.eclipse.jface.window.Window;
33
34 import org.eclipse.ui.PlatformUI;
35 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
36
37 import org.eclipse.jdt.core.JavaConventions;
38 import org.eclipse.jdt.core.JavaCore;
39
40 import org.eclipse.jdt.internal.corext.util.Messages;
41 import org.eclipse.jdt.internal.corext.util.Strings;
42
43 import org.eclipse.jdt.ui.JavaElementImageDescriptor;
44 import org.eclipse.jdt.ui.PreferenceConstants;
45
46 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
47 import org.eclipse.jdt.internal.ui.JavaPlugin;
48 import org.eclipse.jdt.internal.ui.JavaPluginImages;
49 import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
50 import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
51 import org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry;
52 import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
53 import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
54 import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
55 import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
56 import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
57 import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
58 import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
59 import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
60 import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
61
62 /*
63  * The page to configure name conventions
64  */
65 public class NameConventionConfigurationBlock extends OptionsConfigurationBlock {
66
67         private final static int FIELD= 1;
68         private final static int STATIC= 2;
69         private final static int ARGUMENT= 3;
70         private final static int LOCAL= 4;
71         private final static int STATIC_FINAL= 5;
72
73         // Preference store keys
74         private static final Key PREF_FIELD_PREFIXES= getJDTCoreKey(JavaCore.CODEASSIST_FIELD_PREFIXES);
75         private static final Key PREF_FIELD_SUFFIXES= getJDTCoreKey(JavaCore.CODEASSIST_FIELD_SUFFIXES);
76         private static final Key PREF_STATIC_FIELD_PREFIXES= getJDTCoreKey(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES);
77         private static final Key PREF_STATIC_FIELD_SUFFIXES= getJDTCoreKey(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES);
78         private static final Key PREF_STATIC_FINAL_FIELD_PREFIXES= getJDTCoreKey(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_PREFIXES);
79         private static final Key PREF_STATIC_FINAL_FIELD_SUFFIXES= getJDTCoreKey(JavaCore.CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES);
80         private static final Key PREF_ARGUMENT_PREFIXES= getJDTCoreKey(JavaCore.CODEASSIST_ARGUMENT_PREFIXES);
81         private static final Key PREF_ARGUMENT_SUFFIXES= getJDTCoreKey(JavaCore.CODEASSIST_ARGUMENT_SUFFIXES);
82         private static final Key PREF_LOCAL_PREFIXES= getJDTCoreKey(JavaCore.CODEASSIST_LOCAL_PREFIXES);
83         private static final Key PREF_LOCAL_SUFFIXES= getJDTCoreKey(JavaCore.CODEASSIST_LOCAL_SUFFIXES);
84
85         private static final Key PREF_KEYWORD_THIS= getJDTUIKey(PreferenceConstants.CODEGEN_KEYWORD_THIS);
86         private static final Key PREF_IS_FOR_GETTERS= getJDTUIKey(PreferenceConstants.CODEGEN_IS_FOR_GETTERS);
87         private static final Key PREF_EXCEPTION_NAME= getJDTUIKey(PreferenceConstants.CODEGEN_EXCEPTION_VAR_NAME);
88
89         private static final Key PREF_USE_OVERRIDE_ANNOT= getJDTUIKey(PreferenceConstants.CODEGEN_USE_OVERRIDE_ANNOTATION);
90
91
92         public static class NameConventionEntry {
93                 public int kind;
94                 public String prefix;
95                 public String suffix;
96                 public Key prefixkey;
97                 public Key suffixkey;
98                 public void generated_8379409674514614199(Key prefixKey, Key suffixKey, NameConventionConfigurationBlock nameconventionconfigurationblock) {
99                         suffixkey= suffixKey;
100                         prefixkey= prefixKey;
101                 }
102                 public void generated_4688744330726818169(String title, String message, NameConventionInputDialog nameconventioninputdialog) {
103                         nameconventioninputdialog.fEntry= this;
104                 
105                         nameconventioninputdialog.setTitle(title);
106                 
107                         nameconventioninputdialog.fMessageField= new DialogField();
108                         nameconventioninputdialog.fMessageField.setLabelText(message);
109                 
110                         nameconventioninputdialog.fPrefixField= new StringDialogField();
111                         nameconventioninputdialog.fPrefixField.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_dialog_prefix);
112                         nameconventioninputdialog.fPrefixField.setDialogFieldListener(nameconventioninputdialog);
113                 
114                         nameconventioninputdialog.fSuffixField= new StringDialogField();
115                         nameconventioninputdialog.fSuffixField.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_dialog_suffix);
116                         nameconventioninputdialog.fSuffixField.setDialogFieldListener(nameconventioninputdialog);
117                 
118                         nameconventioninputdialog.fPrefixField.setText(prefix);
119                         nameconventioninputdialog.fSuffixField.setText(suffix);
120                 }
121                 public void generated_7023408437225658644(NameConventionInputDialog nameconventioninputdialog, NameConventionEntry res) {
122                         res.prefixkey= prefixkey;
123                         res.suffixkey= suffixkey;
124                 }
125                 public Image generated_7269901888612669156(NameConventionLabelProvider nameconventionlabelprovider) {
126                         ImageDescriptorRegistry registry= JavaPlugin.getImageDescriptorRegistry();
127                         switch (kind) {
128                                 case NameConventionConfigurationBlock.FIELD:
129                                         return registry.get(JavaPluginImages.DESC_FIELD_PUBLIC);
130                                 case NameConventionConfigurationBlock.STATIC:
131                                         return registry.get(new JavaElementImageDescriptor(JavaPluginImages.DESC_FIELD_PUBLIC, JavaElementImageDescriptor.STATIC, JavaElementImageProvider.SMALL_SIZE));
132                                 case NameConventionConfigurationBlock.STATIC_FINAL:
133                                         return registry.get(new JavaElementImageDescriptor(JavaPluginImages.DESC_FIELD_PUBLIC, JavaElementImageDescriptor.STATIC | JavaElementImageDescriptor.FINAL, JavaElementImageProvider.SMALL_SIZE));
134                                 case NameConventionConfigurationBlock.ARGUMENT:
135                                         return registry.get(JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE);
136                                 default:
137                                         return registry.get(JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE);
138                         }
139                 }
140                 public String generated_6278774536163369843(int columnIndex, NameConventionLabelProvider nameconventionlabelprovider) {
141                         if (columnIndex == 0) {
142                                 switch (kind) {
143                                         case NameConventionConfigurationBlock.FIELD:
144                                                 return PreferencesMessages.NameConventionConfigurationBlock_field_label;
145                                         case NameConventionConfigurationBlock.STATIC:
146                                                 return PreferencesMessages.NameConventionConfigurationBlock_static_label;
147                                         case NameConventionConfigurationBlock.STATIC_FINAL:
148                                                 return PreferencesMessages.NameConventionConfigurationBlock_static_final_label;
149                                         case NameConventionConfigurationBlock.ARGUMENT:
150                                                 return PreferencesMessages.NameConventionConfigurationBlock_arg_label;
151                                         default:
152                                                 return PreferencesMessages.NameConventionConfigurationBlock_local_label;
153                                 }
154                         } else if (columnIndex == 1) {
155                                 return prefix;
156                         } else {
157                                 return suffix;
158                         }
159                 }
160         }
161
162         public class NameConventionInputDialog extends StatusDialog implements IDialogFieldListener {
163
164                 public StringDialogField fPrefixField;
165                 public StringDialogField fSuffixField;
166                 private NameConventionEntry fEntry;
167                 public DialogField fMessageField;
168
169                 public NameConventionInputDialog(Shell parent, String title, String message, NameConventionEntry entry) {
170                         super(parent);
171                         entry.generated_4688744330726818169(title, message, NameConventionInputDialog.this);
172                 }
173
174                 public NameConventionEntry getResult() {
175                         NameConventionEntry res= new NameConventionEntry();
176                         res.prefix= Strings.removeTrailingCharacters(fPrefixField.getText(), ',');
177                         res.suffix= Strings.removeTrailingCharacters(fSuffixField.getText(), ',');
178                         fEntry.generated_7023408437225658644(this, res);
179                         res.kind=       fEntry.kind;
180                         return res;
181                 }
182
183                 @Override
184                 protected Control createDialogArea(Composite parent) {
185                         Composite composite= (Composite) super.createDialogArea(parent);
186                         Composite inner= new Composite(composite, SWT.NONE);
187                         inner.setFont(composite.getFont());
188                         GridLayout layout= new GridLayout();
189                         layout.marginHeight= 0;
190                         layout.marginWidth= 0;
191                         layout.numColumns= 2;
192                         inner.setLayout(layout);
193
194                         fPrefixField.generated_4612917318465607875(this, inner);
195                         LayoutUtil.setWidthHint(fPrefixField.getTextControl(null), convertWidthInCharsToPixels(45));
196                         LayoutUtil.setWidthHint(fSuffixField.getTextControl(null), convertWidthInCharsToPixels(45));
197
198                         fPrefixField.postSetFocusOnDialogField(parent.getDisplay());
199
200                         applyDialogFont(composite);
201
202                         PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.CODE_STYLE_EDIT_PREFIX_SUFFIX);
203
204                         return composite;
205                 }
206
207                 /* (non-Javadoc)
208                  * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener#dialogFieldChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField)
209                  */
210                 public void dialogFieldChanged(DialogField field) {
211                         // validate
212                         IStatus prefixStatus= validateIdentifiers(getTokens(fPrefixField.getText(), ","), true); //$NON-NLS-1$
213                         IStatus suffixStatus= validateIdentifiers(getTokens(fSuffixField.getText(), ","), false); //$NON-NLS-1$
214
215                         updateStatus(StatusUtil.getMoreSevere(suffixStatus, prefixStatus));
216                 }
217
218                 private IStatus validateIdentifiers(String[] values, boolean prefix) {
219                         for (int i= 0; i < values.length; i++) {
220                                 String val= values[i];
221                                 if (val.length() == 0) {
222                                         if (prefix) {
223                                                 return new StatusInfo(IStatus.ERROR, PreferencesMessages.NameConventionConfigurationBlock_error_emptyprefix);
224                                         } else {
225                                                 return new StatusInfo(IStatus.ERROR, PreferencesMessages.NameConventionConfigurationBlock_error_emptysuffix);
226                                         }
227                                 }
228                                 String name= prefix ? val + "x" : "x" + val; //$NON-NLS-2$ //$NON-NLS-1$
229                                 IStatus status= JavaConventions.validateIdentifier(name, JavaCore.VERSION_1_3, JavaCore.VERSION_1_3);
230                                 if (status.matches(IStatus.ERROR)) {
231                                         if (prefix) {
232                                                 return new StatusInfo(IStatus.ERROR, Messages.format(PreferencesMessages.NameConventionConfigurationBlock_error_invalidprefix, val));
233                                         } else {
234                                                 return new StatusInfo(IStatus.ERROR, Messages.format(PreferencesMessages.NameConventionConfigurationBlock_error_invalidsuffix, val));
235                                         }
236                                 }
237                         }
238                         return new StatusInfo();
239                 }
240
241                 /*
242                  * @see org.eclipse.jface.window.Window#configureShell(Shell)
243                  */
244                 @Override
245                 protected void configureShell(Shell newShell) {
246                         super.configureShell(newShell);
247                         //PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.IMPORT_ORGANIZE_INPUT_DIALOG);
248                 }
249         }
250
251         static class NameConventionLabelProvider extends LabelProvider implements ITableLabelProvider {
252
253                 /* (non-Javadoc)
254                  * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
255                  */
256                 @Override
257                 public Image getImage(Object element) {
258                         return getColumnImage(element, 0);
259                 }
260
261                 /* (non-Javadoc)
262                  * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
263                  */
264                 @Override
265                 public String getText(Object element) {
266                         return getColumnText(element, 0);
267                 }
268
269                 /* (non-Javadoc)
270                  * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
271                  */
272                 public Image getColumnImage(Object element, int columnIndex) {
273                         if (columnIndex != 0) {
274                                 return null;
275                         }
276
277                         NameConventionEntry entry= (NameConventionEntry) element;
278                         return entry.generated_7269901888612669156(NameConventionLabelProvider.this);
279                 }
280
281                 /* (non-Javadoc)
282                  * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
283                  */
284                 public String getColumnText(Object element, int columnIndex) {
285                         NameConventionEntry entry= (NameConventionEntry) element;
286                         return entry.generated_6278774536163369843(columnIndex, NameConventionLabelProvider.this);
287                 }
288         }
289
290         public class NameConventionAdapter implements IListAdapter<NameConventionEntry>, IDialogFieldListener {
291
292                 public boolean canEdit(ListDialogField<?> field) {
293                         return field.getSelectedElements().size() == 1;
294                 }
295
296                 public void customButtonPressed(ListDialogField<NameConventionEntry> field, int index) {
297                         doEditButtonPressed();
298                 }
299
300                 public void selectionChanged(ListDialogField<NameConventionEntry> field) {
301                         field.generated_7440598668083616666(NameConventionAdapter.this);
302                 }
303
304                 public void doubleClicked(ListDialogField<NameConventionEntry> field) {
305                         if (canEdit(field)) {
306                                 doEditButtonPressed();
307                         }
308                 }
309
310                 public void dialogFieldChanged(DialogField field) {
311                         updateModel(field);
312                 }
313         }
314
315         public ListDialogField<NameConventionEntry> fNameConventionList;
316         public SelectionButtonDialogField fUseKeywordThisBox;
317         public SelectionButtonDialogField fUseIsForBooleanGettersBox;
318
319         public StringDialogField fExceptionName;
320         public SelectionButtonDialogField fUseOverrideAnnotation;
321
322         public NameConventionConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
323                 super(context, project, getAllKeys(), container);
324
325                 NameConventionAdapter adapter=  new NameConventionAdapter();
326                 String[] buttons= new String[] {
327                         PreferencesMessages.NameConventionConfigurationBlock_list_edit_button
328                 };
329                 fNameConventionList= new ListDialogField<NameConventionEntry>(adapter, buttons, new NameConventionLabelProvider()) {
330                         @Override
331                         protected int getListStyle() {
332                                 return super.getListStyle() & ~SWT.MULTI | SWT.SINGLE;
333                         }
334
335                 };
336                 fNameConventionList.setDialogFieldListener(adapter);
337                 fNameConventionList.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_list_label);
338
339                 String[] columnsHeaders= new String[] {
340                         PreferencesMessages.NameConventionConfigurationBlock_list_name_column,
341                         PreferencesMessages.NameConventionConfigurationBlock_list_prefix_column,
342                         PreferencesMessages.NameConventionConfigurationBlock_list_suffix_column,
343                 };
344                 ColumnLayoutData[] data= new ColumnLayoutData[] {
345                         new ColumnWeightData(3),
346                         new ColumnWeightData(2),
347                         new ColumnWeightData(2)
348                 };
349
350                 fNameConventionList.setTableColumns(new ListDialogField.ColumnsDescription(data, columnsHeaders, true));
351
352                 fNameConventionList.generated_1022775476695690767();
353
354                 fExceptionName= new StringDialogField();
355                 fExceptionName.setDialogFieldListener(adapter);
356                 fExceptionName.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_exceptionname_label);
357
358                 fUseKeywordThisBox= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
359                 fUseKeywordThisBox.setDialogFieldListener(adapter);
360                 fUseKeywordThisBox.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_keywordthis_label);
361
362                 fUseIsForBooleanGettersBox= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
363                 fUseIsForBooleanGettersBox.setDialogFieldListener(adapter);
364                 fUseIsForBooleanGettersBox.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_isforbooleangetters_label);
365
366                 fUseOverrideAnnotation= new SelectionButtonDialogField(SWT.CHECK | SWT.WRAP);
367                 fUseOverrideAnnotation.setDialogFieldListener(adapter);
368                 fUseOverrideAnnotation.setLabelText(PreferencesMessages.NameConventionConfigurationBlock_use_override_annotation_label);
369
370                 updateControls();
371         }
372
373         private static Key[] getAllKeys() {
374                 return new Key[] {
375                         PREF_FIELD_PREFIXES, PREF_FIELD_SUFFIXES, PREF_STATIC_FIELD_PREFIXES, PREF_STATIC_FIELD_SUFFIXES,
376                         PREF_STATIC_FINAL_FIELD_PREFIXES, PREF_STATIC_FINAL_FIELD_SUFFIXES,
377                         PREF_ARGUMENT_PREFIXES, PREF_ARGUMENT_SUFFIXES, PREF_LOCAL_PREFIXES, PREF_LOCAL_SUFFIXES,
378                         PREF_EXCEPTION_NAME, PREF_KEYWORD_THIS, PREF_IS_FOR_GETTERS, PREF_USE_OVERRIDE_ANNOT
379                 };
380         }
381
382         @Override
383         protected Control createContents(Composite parent) {
384                 setShell(parent.getShell());
385
386                 GridLayout layout= new GridLayout();
387                 layout.numColumns= 3;
388                 layout.marginHeight= 0;
389                 layout.marginWidth= 0;
390
391                 Composite composite= new Composite(parent, SWT.NONE);
392                 return fNameConventionList.generated_1617848325307136665(this, parent, layout, composite);
393         }
394
395         /* (non-Javadoc)
396          * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#validateSettings(java.lang.String, java.lang.String)
397          */
398         @Override
399         protected void validateSettings(Key changedKey, String oldValue, String newValue) {
400                 // no validation here
401         }
402
403         public final void updateModel(DialogField field) {
404                 if (field == fNameConventionList) {
405                         for (int i= 0; i < fNameConventionList.getSize(); i++) {
406                                 NameConventionEntry entry= fNameConventionList.getElement(i);
407                                 setValue(entry.suffixkey, entry.suffix);
408                                 setValue(entry.prefixkey, entry.prefix);
409                         }
410                 } else if (field == fExceptionName) {
411                         String name= fExceptionName.getText();
412
413                         setValue(PREF_EXCEPTION_NAME, name);
414
415                         // validation
416                         IStatus status = JavaConventions.validateIdentifier(name, JavaCore.VERSION_1_3, JavaCore.VERSION_1_3);
417                         if (!status.isOK()) {
418                                 fContext.statusChanged(status);
419                         } else {
420                                 fContext.statusChanged(new StatusInfo());
421                         }
422                 } else if (field == fUseKeywordThisBox) {
423                         setValue(PREF_KEYWORD_THIS, fUseKeywordThisBox.isSelected());
424                 } else if (field == fUseIsForBooleanGettersBox) {
425                         setValue(PREF_IS_FOR_GETTERS, fUseIsForBooleanGettersBox.isSelected());
426                 } else if (field == fUseOverrideAnnotation) {
427                         setValue(PREF_USE_OVERRIDE_ANNOT, fUseOverrideAnnotation.isSelected());
428                 }
429         }
430
431
432         /* (non-Javadoc)
433          * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#updateControls()
434          */
435         @Override
436         protected void updateControls() {
437                 ArrayList<NameConventionEntry> list= new ArrayList<NameConventionEntry>(4);
438                 createEntry(list, PREF_FIELD_PREFIXES, PREF_FIELD_SUFFIXES, FIELD);
439                 createEntry(list, PREF_STATIC_FIELD_PREFIXES, PREF_STATIC_FIELD_SUFFIXES, STATIC);
440                 createEntry(list, PREF_STATIC_FINAL_FIELD_PREFIXES, PREF_STATIC_FINAL_FIELD_SUFFIXES, STATIC_FINAL);
441                 createEntry(list, PREF_ARGUMENT_PREFIXES, PREF_ARGUMENT_SUFFIXES, ARGUMENT);
442                 createEntry(list, PREF_LOCAL_PREFIXES, PREF_LOCAL_SUFFIXES, LOCAL);
443                 fNameConventionList.setElements(list);
444
445                 fExceptionName.setText(getValue(PREF_EXCEPTION_NAME));
446                 fUseKeywordThisBox.setSelection(getBooleanValue(PREF_KEYWORD_THIS));
447                 fUseIsForBooleanGettersBox.setSelection(getBooleanValue(PREF_IS_FOR_GETTERS));
448                 fUseOverrideAnnotation.setSelection(getBooleanValue(PREF_USE_OVERRIDE_ANNOT));
449         }
450
451         /* (non-Javadoc)
452          * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#getFullBuildDialogStrings(boolean)
453          */
454         @Override
455         protected String[] getFullBuildDialogStrings(boolean workspaceSettings) {
456                 return null; // no build required
457         }
458
459         private void createEntry(List<NameConventionEntry> list, Key prefixKey, Key suffixKey, int kind) {
460                 NameConventionEntry entry= new NameConventionEntry();
461                 entry.kind= kind;
462                 entry.generated_8379409674514614199(prefixKey, suffixKey, this);
463                 entry.suffix= getPreferenceValue(suffixKey);
464                 entry.prefix= getPreferenceValue(prefixKey);
465                 list.add(entry);
466         }
467
468         private String getPreferenceValue(Key key) {
469                 String value= getValue(key);
470                 if (value == null) {
471                         value= ""; //$NON-NLS-1$
472                         JavaPlugin.logErrorMessage("JavaCore preference is null. Key:" + key); //$NON-NLS-1$
473                 }
474                 return value;
475         }
476
477         private void doEditButtonPressed() {
478                 NameConventionEntry entry= fNameConventionList.getSelectedElements().get(0);
479
480                 String title;
481                 String message;
482                 switch (entry.kind) {
483                         case FIELD:
484                                 title= PreferencesMessages.NameConventionConfigurationBlock_field_dialog_title;
485                                 message= PreferencesMessages.NameConventionConfigurationBlock_field_dialog_message;
486                                 break;
487                         case STATIC:
488                                 title= PreferencesMessages.NameConventionConfigurationBlock_static_dialog_title;
489                                 message= PreferencesMessages.NameConventionConfigurationBlock_static_dialog_message;
490                                 break;
491                         case STATIC_FINAL:
492                                 title= PreferencesMessages.NameConventionConfigurationBlock_static_final_dialog_title;
493                                 message= PreferencesMessages.NameConventionConfigurationBlock_static_final_dialog_message;
494                                 break;
495                         case ARGUMENT:
496                                 title= PreferencesMessages.NameConventionConfigurationBlock_arg_dialog_title;
497                                 message= PreferencesMessages.NameConventionConfigurationBlock_arg_dialog_message;
498                                 break;
499                         default:
500                                 title= PreferencesMessages.NameConventionConfigurationBlock_local_dialog_title;
501                                 message= PreferencesMessages.NameConventionConfigurationBlock_local_dialog_message;
502                 }
503
504                 NameConventionInputDialog dialog= new NameConventionInputDialog(getShell(), title, message, entry);
505                 if (dialog.open() == Window.OK) {
506                         fNameConventionList.generated_153092146092169035(this, entry, dialog);
507                 }
508         }
509 }