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.preferences.JavaEEPreferencePage"
810
           id="org.eclipse.jst.j2ee.ui.preferencePages.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
JAVA_EE_PREFERENCE_PAGE_NAME=General settings for Java EE development:
338
JAVA_EE_PREFERENCE_PAGE_JET_TEMPLATE=JET templates
339
JAVA_EE_PREFERENCE_PAGE_DYN_TRANSLATION_BTN_NAME=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 JAVA_EE_PREFERENCE_PAGE_NAME = "JAVA_EE_PREFERENCE_PAGE_NAME"; //$NON-NLS-1$
215
	public static final String JAVA_EE_PREFERENCE_PAGE_JET_TEMPLATE = "JAVA_EE_PREFERENCE_PAGE_JET_TEMPLATE"; //$NON-NLS-1$
216
	public static final String JAVA_EE_PREFERENCE_PAGE_DYN_TRANSLATION_BTN_NAME = "JAVA_EE_PREFERENCE_PAGE_DYN_TRANSLATION_BTN_NAME"; //$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/preferences/JavaEEPreferencePage.java (+76 lines)
Added Link Here
1
package org.eclipse.jst.j2ee.internal.ui.preferences;
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.layout.GridData;
12
import org.eclipse.swt.layout.GridLayout;
13
import org.eclipse.swt.widgets.Button;
14
import org.eclipse.swt.widgets.Composite;
15
import org.eclipse.swt.widgets.Control;
16
import org.eclipse.swt.widgets.Group;
17
import org.eclipse.swt.widgets.Label;
18
import org.eclipse.ui.IWorkbench;
19
import org.eclipse.ui.IWorkbenchPreferencePage;
20
21
public class JavaEEPreferencePage 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 JavaEEPreferencePage() {
30
		setDescription(J2EEUIMessages.getResourceString(J2EEUIMessages.JAVA_EE_PREFERENCE_PAGE_NAME));
31
	}
32
33
	@Override
34
	protected void performDefaults() {
35
		preferences.setToDefault(name);
36
		J2EEPlugin.getDefault().savePluginPreferences();
37
		dynamicTranslation = preferences.getBoolean(name);
38
		showReferences.setSelection(dynamicTranslation);
39
		super.performDefaults();
40
	}
41
42
	@Override
43
	protected Control createContents(Composite parent) {
44
		Composite result= new Composite(parent, SWT.NONE);
45
		GridLayout layout= new GridLayout();
46
		layout.marginWidth= 0;
47
		result.setLayout(layout);
48
		Label spacer = new Label(result, SWT.NONE);
49
		Group buttonComposite= new Group(result, SWT.NONE);
50
		buttonComposite.setLayout(new GridLayout());		
51
		buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
52
        buttonComposite.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.JAVA_EE_PREFERENCE_PAGE_JET_TEMPLATE));
53
54
		showReferences = new Button(buttonComposite, SWT.CHECK);
55
		showReferences.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.JAVA_EE_PREFERENCE_PAGE_DYN_TRANSLATION_BTN_NAME)); //$NON-NLS-1$
56
		showReferences.setSelection(dynamicTranslation);
57
		showReferences.addSelectionListener(new SelectionAdapter() {
58
			public void widgetSelected(SelectionEvent e) {
59
				dynamicTranslation = showReferences.getSelection();
60
			}
61
		});
62
		return result;
63
	}
64
65
	public void init(IWorkbench workbench) {
66
		preferences = J2EEPlugin.getDefault().getPluginPreferences();
67
		dynamicTranslation = preferences.getBoolean(name);
68
	}
69
70
	@Override
71
	public boolean performOk() {
72
		preferences.setValue(name, showReferences.getSelection());
73
		J2EEPlugin.getDefault().savePluginPreferences();
74
		return super.performOk();
75
	}
76
}

Return to bug 250128