Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 250128 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (+8 lines)
Lines 803-807 Link Here
803
      provider="wtp-user-library-provider"
803
      provider="wtp-user-library-provider"
804
      class="org.eclipse.jst.j2ee.internal.ui.WtpUserLibraryProviderInstallPanel"/>
804
      class="org.eclipse.jst.j2ee.internal.ui.WtpUserLibraryProviderInstallPanel"/>
805
  </extension>
805
  </extension>
806
  <extension
807
        point="org.eclipse.ui.preferencePages">
808
     <page
809
           class="org.eclipse.jst.j2ee.internal.ui.preference.JETTemplatesReferencesPage"
810
           id="org.eclipse.jst.j2ee.ui.preference.JavaEE"
811
           name="Java EE">
812
     </page>
813
  </extension>
806
814
807
</plugin>
815
</plugin>
(-)property_files/j2ee_ui.properties (+3 lines)
Lines 334-339 Link Here
334
JAVAUTILITY_MAIN_PG_TITLE=Java Component
334
JAVAUTILITY_MAIN_PG_TITLE=Java Component
335
JAVAUTILITY_MAIN_PG_DESC=Create a Java Component
335
JAVAUTILITY_MAIN_PG_DESC=Create a Java Component
336
JAVAUTIL_COMPONENT_WIZ_TITLE=New Java Utility Module
336
JAVAUTIL_COMPONENT_WIZ_TITLE=New Java Utility Module
337
JavaEEPrefPageName=General settings for Java EE development:
338
JetTemplates=JET templates
339
DynTranslationButtonName=Use dynamic translation of JET templates
337
AVAILABLE_J2EE_COMPONENTS= Available Java EE modules
340
AVAILABLE_J2EE_COMPONENTS= Available Java EE modules
338
EXTERNAL_JAR=Add External JARs...
341
EXTERNAL_JAR=Add External JARs...
339
PROJECT_JAR=Add JARs...
342
PROJECT_JAR=Add JARs...
(-)j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java (-1 / +3 lines)
Lines 211-217 Link Here
211
	public static final String CONTENT_FOLDER = "102"; //$NON-NLS-1$
211
	public static final String CONTENT_FOLDER = "102"; //$NON-NLS-1$
212
	
212
	
213
	public static final String HOVER_HELP_FOR_DISABLED_LIBS = "HOVER_HELP_FOR_DISABLED_LIBS"; //$NON-NLS-1$
213
	public static final String HOVER_HELP_FOR_DISABLED_LIBS = "HOVER_HELP_FOR_DISABLED_LIBS"; //$NON-NLS-1$
214
214
	public static final String JavaEEPrefPageName = "JavaEEPrefPageName"; //$NON-NLS-1$
215
	public static final String JetTemplates = "JetTemplates"; //$NON-NLS-1$
216
	public static final String DynTranslationButtonName = "DynTranslationButtonName"; //$NON-NLS-1$
215
	/**
217
	/**
216
	 * Returns the string from the resource bundle, or 'key' if not found.
218
	 * Returns the string from the resource bundle, or 'key' if not found.
217
	 */
219
	 */
(-)j2ee_ui/org/eclipse/jst/j2ee/internal/ui/preference/JETTemplatesReferencesPage.java (+68 lines)
Added Link Here
1
package org.eclipse.jst.j2ee.internal.ui.preference;
2
3
//import org.eclipse.core.resources.ResourcesPlugin;
4
import org.eclipse.core.runtime.Preferences;
5
import org.eclipse.jface.preference.PreferencePage;
6
import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
7
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
8
import org.eclipse.swt.SWT;
9
import org.eclipse.swt.events.SelectionAdapter;
10
import org.eclipse.swt.events.SelectionEvent;
11
import org.eclipse.swt.graphics.Font;
12
import org.eclipse.swt.layout.GridData;
13
import org.eclipse.swt.layout.GridLayout;
14
import org.eclipse.swt.widgets.Button;
15
import org.eclipse.swt.widgets.Composite;
16
import org.eclipse.swt.widgets.Control;
17
import org.eclipse.swt.widgets.Group;
18
import org.eclipse.ui.IWorkbench;
19
import org.eclipse.ui.IWorkbenchPreferencePage;
20
21
public class JETTemplatesReferencesPage extends PreferencePage implements
22
		IWorkbenchPreferencePage {
23
24
	private Preferences preferences;
25
	private String name = J2EEPlugin.DYNAMIC_TRANSLATION_OF_JET_TEMPLATES_PREF_KEY;
26
	private Button showReferences;
27
	private boolean dynamicTranslation;
28
29
	public JETTemplatesReferencesPage() {
30
		setDescription(J2EEUIMessages.getResourceString("JavaEEPrefPageName")); //$NON-NLS-1$
31
	}
32
33
	@Override
34
	protected Control createContents(Composite parent) {
35
		Font font = parent.getFont();
36
37
		Composite result= new Composite(parent, SWT.NONE);
38
		GridLayout layout= new GridLayout();
39
		layout.marginWidth= 0;
40
		result.setLayout(layout);
41
		Group buttonComposite= new Group(result, SWT.NONE);
42
		buttonComposite.setLayout(new GridLayout());		
43
		buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
44
        buttonComposite.setText(J2EEUIMessages.getResourceString("JetTemplates"));  //$NON-NLS-1$
45
46
		showReferences = new Button(buttonComposite, SWT.CHECK);
47
		showReferences.setText(J2EEUIMessages.getResourceString("DynTranslationButtonName")); //$NON-NLS-1$
48
		showReferences.setSelection(dynamicTranslation);
49
		showReferences.addSelectionListener(new SelectionAdapter() {
50
			public void widgetSelected(SelectionEvent e) {
51
				dynamicTranslation = showReferences.getSelection();
52
			}
53
		});
54
		return result;
55
	}
56
57
	public void init(IWorkbench workbench) {
58
		preferences = J2EEPlugin.getDefault().getPluginPreferences();
59
		dynamicTranslation = preferences.getBoolean(name);
60
	}
61
62
	@Override
63
	public boolean performOk() {
64
		preferences.setValue(name, showReferences.getSelection());
65
		J2EEPlugin.getDefault().savePluginPreferences();
66
		return super.performOk();
67
	}
68
}

Return to bug 250128