blob: 6bf54fb1f9d3077480fd0b0b4cafc90cc13dde17 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
/*****************************************************************************
* Copyright (c) 2009 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:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr
* Thibault Landre (Atos Origin)
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Messages;
import org.eclipse.papyrus.infra.gmfdiag.preferences.jface.preference.FontFieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
/**
* The Class FontGroupComposite contains a field to manage preference to display a text in a label
*/
public class FontGroup extends AbstractGroup {
/** The FONT Group label **/
private static final String FONT_GROUPBOX_LABEL = Messages.AbstractPapyrusElementPreferencePage_Font;
/** The font field editor. */
protected FontFieldEditor fontFieldEditor;
/**
* Instantiates a new font group composite.
*
* @param parent
* the parent of the composite
* @param key
* the key of the preference
* @param dialogPage
* to set the page in field editor
**/
public FontGroup(Composite parent, String key, DialogPage dialogPage) {
super(parent, key, dialogPage);
System.out.println("FONT key = " + key);
createContent(parent);
}
/**
* Creates the content.
*
* @param parent
* the parent
*/
protected void createContent(Composite parent) {
Group fontGroup = new Group(parent, SWT.SHADOW_NONE);
fontGroup.setLayout(new GridLayout(1, true));
fontGroup.setText(FONT_GROUPBOX_LABEL);
fontFieldEditor = new FontFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.FONT), fontGroup);
addFieldEditor(fontFieldEditor);
}
}
|