Project

General

Profile

« Previous | Next » 

Revision 69213a6e

Added by Katja Luther about 4 years ago

ref #8562: add admin preference page for multilanguage support

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LanguageRepresentationPreferencePage.java
16 16
import org.eclipse.swt.events.SelectionEvent;
17 17
import org.eclipse.swt.layout.GridLayout;
18 18
import org.eclipse.swt.layout.RowLayout;
19
import org.eclipse.swt.widgets.Button;
20 19
import org.eclipse.swt.widgets.Combo;
21 20
import org.eclipse.swt.widgets.Composite;
22 21
import org.eclipse.swt.widgets.Control;
......
34 33
 */
35 34
public class LanguageRepresentationPreferencePage extends CdmPreferencePage{
36 35

  
37
	private boolean isMultilanguageTextEditingCapability;
36

  
38 37
	private Language globalLanguage;
39 38

  
40 39
//	private Composite createComposite(Composite parent){
......
52 51

  
53 52
		createSetDefaultLanguage(container);
54 53

  
55
		createSetMultiLanguageTextEditingCapability(container);
54
//		createSetMultiLanguageTextEditingCapability(container);
56 55

  
57 56
		return container;
58 57

  
......
102 101
		});
103 102
	}
104 103

  
105
	private void createSetMultiLanguageTextEditingCapability(Composite parent) {
106
		isMultilanguageTextEditingCapability = PreferencesUtil.getBooleanValue(IPreferenceKeys.MULTILANGUAGE_TEXT_EDITING_CAPABILITY);
107

  
108
		final Composite composite = createComposite(parent);
109

  
110
		final Button button_toggle = new Button(composite, SWT.CHECK);
111

  
112

  
113
		button_toggle.setText(Messages.LanguageRepresentationPreferencePage_enable);
114

  
115
		button_toggle.setSelection(isMultilanguageTextEditingCapability);
116

  
117

  
118
		button_toggle.addSelectionListener(new SelectionAdapter(){
119
			/* (non-Javadoc)
120
			 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
121
			 */
122
			@Override
123
			public void widgetSelected(SelectionEvent e) {
124
			    setApply(true);
125
				isMultilanguageTextEditingCapability = button_toggle.getSelection();
126
			}
127
		});
128
	}
104
//	private void createSetMultiLanguageTextEditingCapability(Composite parent) {
105
//		isMultilanguageTextEditingCapability = PreferencesUtil.getBooleanValue(IPreferenceKeys.MULTILANGUAGE_TEXT_EDITING_CAPABILITY);
106
//
107
//		final Composite composite = createComposite(parent);
108
//
109
//		final Button button_toggle = new Button(composite, SWT.CHECK);
110
//
111
//
112
//		button_toggle.setText(Messages.LanguageRepresentationPreferencePage_enable);
113
//
114
//		button_toggle.setSelection(isMultilanguageTextEditingCapability);
115
//
116
//
117
//		button_toggle.addSelectionListener(new SelectionAdapter(){
118
//			/* (non-Javadoc)
119
//			 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
120
//			 */
121
//			@Override
122
//			public void widgetSelected(SelectionEvent e) {
123
//			    setApply(true);
124
//				isMultilanguageTextEditingCapability = button_toggle.getSelection();
125
//			}
126
//		});
127
//	}
129 128

  
130 129
	@Override
131 130
	public boolean performOk() {
132 131
	    if (!isApply()){
133 132
	        return true;
134 133
	    }
135
	    PreferencesUtil.setBooleanValue(IPreferenceKeys.MULTILANGUAGE_TEXT_EDITING_CAPABILITY, isMultilanguageTextEditingCapability);
136 134
	    PreferencesUtil.setGlobalLanguage(globalLanguage);
137

  
138 135
		return super.performOk();
139 136
	}
140 137
}

Also available in: Unified diff