* Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
* Thomas Corbat
*******************************************************************************/
-
+/*
+ * 2016-11-10 yoonki.park@samsung.com
+ * Modifications by S-Core Co., Ltd.
+ * 1. Added text control to auto-activation group
+ */
package org.eclipse.cdt.internal.ui.preferences;
import java.util.ArrayList;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_ARROW));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOUBLECOLON));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW));
+ /* Tizen */
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_AS_TYPES));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_AS_TYPES_ENABLE));
+ /* ===== */
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.DEFAULT_ARGUMENT_DISPLAY_PARAMETERS_WITH_DEFAULT_ARGUMENT));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.DEFAULT_ARGUMENT_DISPLAY_ARGUMENTS));
// overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.SHOW_DOCUMENTED_PROPOSALS));
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
// The following items are grouped for Auto Activation
label = PreferencesMessages.CEditorPreferencePage_ContentAssistPage_autoActivationGroupTitle;
+ /* Tizen */
Group enableGroup = addGroupBox(contentAssistComposite, label, 2);
-
+ /* ===== */
label = PreferencesMessages.CEditorPreferencePage_ContentAssistPage_autoActivationEnableDot;
addCheckBox(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOT, 0);
label = PreferencesMessages.CEditorPreferencePage_ContentAssistPage_autoActivationEnableArrow;
- addCheckBox(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_ARROW, 0);
label = PreferencesMessages.CEditorPreferencePage_ContentAssistPage_autoActivationEnableDoubleColon;
addCheckBox(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOUBLECOLON, 0);
label = PreferencesMessages.CEditorPreferencePage_ContentAssistPage_autoActivationEnableReplaceDotWithArrow;
addCheckBox(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW, 0);
+ /* Tizen */
+ label = PreferencesMessages.CEditorPreferencePage_ContentAssistPage_autoActivationEnableAsTypes;
+ Composite comp = new Composite(enableGroup, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(3, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ comp.setLayout(gridLayout);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 3;
+ comp.setLayoutData(gd);
+ final Button btn = addCheckBox(comp, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_AS_TYPES_ENABLE, 0);
+ final Text textControl = addTextField(comp, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_AS_TYPES, 30, 0);
+ textControl.setEnabled(fOverlayStore.getBoolean(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_AS_TYPES_ENABLE));
+
+ btn.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ textControl.setEnabled(btn.getSelection());
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ textControl.setEnabled(btn.getSelection());
+ }});
+ /* ===== */
label = PreferencesMessages.CEditorPreferencePage_ContentAssistPage_autoActivationDelay;
addTextField(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_DELAY, 4, 0, true);
return contentAssistComposite;
}
+ /* Tizen */
+ protected Text addTextField(Composite composite, String key, int textLimit, int indentation) {
+ Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData();
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalIndent = indentation;
+ gd.widthHint = convertWidthInCharsToPixels(textLimit - 10);
+ textControl.setLayoutData(gd);
+ textControl.setTextLimit(textLimit);
+ fTextFields.put(textControl, key);
+
+ return textControl;
+ }
+ /* ===== */
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_ARROW, true);
store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOUBLECOLON, true);
store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW, true);
+ /* Tizen */
+ store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_AS_TYPES_ENABLE, true);
+ /* ===== */
store.setDefault(ContentAssistPreference.AUTOACTIVATION_DELAY, 500);
store.setDefault(ContentAssistPreference.DEFAULT_ARGUMENT_DISPLAY_PARAMETERS_WITH_DEFAULT_ARGUMENT, true);
store.setDefault(ContentAssistPreference.DEFAULT_ARGUMENT_DISPLAY_ARGUMENTS, true);
* Kirk Beitz (Nokia)
* Thomas Corbat (IFS)
*******************************************************************************/
+/*
+ * 2016-11-10 yoonki.park@samsung.com
+ * Modifications by S-Core Co., Ltd.
+ * 1. Added another auto activation trigger types
+ */
package org.eclipse.cdt.internal.ui.text.contentassist;
import org.eclipse.jface.preference.IPreferenceStore;
public final static String AUTOACTIVATION_TRIGGERS_ARROW= "content_assist_autoactivation_trigger_arrow"; //$NON-NLS-1$
public final static String AUTOACTIVATION_TRIGGERS_DOUBLECOLON= "content_assist_autoactivation_trigger_doublecolon"; //$NON-NLS-1$
public final static String AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW= "content_assist_autoactivation_trigger_replace_dot_with_arrow"; //$NON-NLS-1$
+ /* Tizen */
+ public final static String AUTOACTIVATION_TRIGGERS_AS_TYPES = "content_assist_autoactivation_trigger_as_types"; //$NON-NLS-1$
+ public final static String AUTOACTIVATION_TRIGGERS_AS_TYPES_ENABLE = "content_assist_autoactivation_trigger_as_types_enabled"; //$NON-NLS-1$
+ public final static String AUTOACTIVATION_TRIGGERS_AS_TYPES_DEFAULT = "_abcdefghighklmnopqrstuvwxyzABCDEFGHIGHKLMNOPQRSTUVWXYZ";
+ /* ===== */
/** Preference key for display of defaulted parameters in content assist */
public final static String DEFAULT_ARGUMENT_DISPLAY_PARAMETERS_WITH_DEFAULT_ARGUMENT = "content_assist_default_argument_display_parameters_with_default_argument"; //$NON-NLS-1$
/** Preference key for display of default arguments in content assist */
boolean useDotAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_DOT);
boolean useArrowAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_ARROW);
boolean useDoubleColonAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_DOUBLECOLON);
+ /* Tizen */
+ boolean triggerCharsEnabled = store.getBoolean(AUTOACTIVATION_TRIGGERS_AS_TYPES_ENABLE);
+ String triggerChars = store.getString(AUTOACTIVATION_TRIGGERS_AS_TYPES);
if (useDotAsTrigger)
triggers = "."; //$NON-NLS-1$
triggers += ">"; //$NON-NLS-1$
if (useDoubleColonAsTrigger)
triggers += ":"; //$NON-NLS-1$
+ /* Tizen */
+ if (triggerCharsEnabled) {
+ triggers += AUTOACTIVATION_TRIGGERS_AS_TYPES_DEFAULT;
+ if (!triggerChars.isEmpty()) {
+ triggers += triggerChars;
+ }
+ }
+ /* ===== */
ccp.setCContentAutoActivationCharacters(triggers);
boolean dotTriggersAutoReplace = store.getBoolean(AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW);
boolean enabledDoubleColon= store.getBoolean(AUTOACTIVATION_TRIGGERS_DOUBLECOLON);
boolean enabledReplaceDotWithArrow
= store.getBoolean(AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW);
+ /// Tizen
+ boolean enabledTyped = store.getBoolean(AUTOACTIVATION_TRIGGERS_AS_TYPES);
boolean enabled
= (enabledDot || enabledArrow || enabledDoubleColon
- || enabledReplaceDotWithArrow);
+ || enabledReplaceDotWithArrow || enabledTyped);
assistant.enableAutoActivation(enabled);
int delay= store.getInt(AUTOACTIVATION_DELAY);
CContentAssistProcessor ccp= getCProcessor(assistant);
if (ccp == null)
return;
-
+ /// Tizen
if ( (AUTOACTIVATION_TRIGGERS_DOT.equals(key))
|| (AUTOACTIVATION_TRIGGERS_ARROW.equals(key))
|| (AUTOACTIVATION_TRIGGERS_DOUBLECOLON.equals(key))
- || (AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW.equals(key))){
+ || (AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW.equals(key))
+ || (AUTOACTIVATION_TRIGGERS_AS_TYPES_ENABLE.equals(key))) {
configureActivationCharacters(store, ccp);
}
// else if (SHOW_DOCUMENTED_PROPOSALS.equals(key)) {
boolean enabledArrow= store.getBoolean(AUTOACTIVATION_TRIGGERS_ARROW);
boolean enabledDoubleColon= store.getBoolean(AUTOACTIVATION_TRIGGERS_DOUBLECOLON);
boolean enabledReplaceDotWithArrow= store.getBoolean(AUTOACTIVATION_TRIGGERS_REPLACE_DOT_WITH_ARROW);
- boolean enabled = ((enabledDot) || ( enabledArrow ) || (enabledDoubleColon ) || (enabledReplaceDotWithArrow ));
+ /// Tizen
+ boolean enabledAlways = store.getBoolean(AUTOACTIVATION_TRIGGERS_AS_TYPES);
+ boolean enabled = ((enabledDot) || ( enabledArrow ) || (enabledDoubleColon ) || (enabledReplaceDotWithArrow )) || (enabledAlways);
assistant.enableAutoActivation(enabled);
} else if (AUTOACTIVATION_DELAY.equals(p)) {