Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0a276cb3917ee22dd68a790eacf1f30364fbe7a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*****************************************************************************
 * Copyright (c) 2014 CEA LIST.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
 *****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.preferences;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;


/**
 * Preference page for stereotype paste strategy
 *
 */
public class StereotypePasteStrategyPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

	protected RadioGroupFieldEditor dblClkFieldEditor;

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
	 */
	public void init(IWorkbench workbench) {
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
	 */
	@Override
	protected void createFieldEditors() {
		String[][] labelAndValues = new String[][]{ 
//			{ "Ask before Aplying Profile", IStereotypePasteStrategyPreferenceConstant.ASK_POPUP }, 
			{ "Always import missing profiles", IStereotypePasteStrategyPreferenceConstant.IMPORT_MISSING_PROFILE }, 
			{ "Never import missing profiles", IStereotypePasteStrategyPreferenceConstant.IGNORE_MISSING_PROFILE }
		};
		dblClkFieldEditor = new RadioGroupFieldEditor(
			IStereotypePasteStrategyPreferenceConstant.PROFILE_STRATEGY, "Missing profiles strategy :", 1, 
			labelAndValues, 
			getFieldEditorParent());
		addField(dblClkFieldEditor);
		dblClkFieldEditor.setPreferenceStore(Activator.getDefault().getPreferenceStore());
	}
}

Back to the top