Révision 510
tmp/org.txm.cah.core/src/org/txm/cah/core/preferences/CAHPreferences.java (revision 510) | ||
---|---|---|
19 | 19 |
// auto populate the preference node qualifier from the current bundle id |
20 | 20 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(CAHPreferences.class).getSymbolicName(); |
21 | 21 |
|
22 |
public static final String PREFERENCES_PREFIX = "cah_"; //$NON-NLS-1$ |
|
23 |
|
|
24 | 22 |
/** The Constant DISPLAY. */ |
25 |
public static final String DISPLAY_2D = PREFERENCES_PREFIX + "display_2d"; //$NON-NLS-1$
|
|
23 |
public static final String DISPLAY_2D = "display_2d"; //$NON-NLS-1$ |
|
26 | 24 |
|
27 | 25 |
/** The Constant METHOD. */ |
28 |
public static final String METHOD = PREFERENCES_PREFIX + "method"; //$NON-NLS-1$
|
|
26 |
public static final String METHOD = "method"; //$NON-NLS-1$ |
|
29 | 27 |
|
30 | 28 |
/** The Constant METRIC. */ |
31 |
public static final String METRIC = PREFERENCES_PREFIX + "metric"; //$NON-NLS-1$
|
|
29 |
public static final String METRIC = "metric"; //$NON-NLS-1$ |
|
32 | 30 |
|
33 | 31 |
/** The Constant NCLUSTER. */ |
34 |
public static final String N_CLUSTERS = PREFERENCES_PREFIX + "n_clusters"; //$NON-NLS-1$
|
|
32 |
public static final String N_CLUSTERS = "n_clusters"; //$NON-NLS-1$ |
|
35 | 33 |
|
36 |
public static final String COLUMNS_COMPUTING = PREFERENCES_PREFIX + "columns_computing"; //$NON-NLS-1$
|
|
34 |
public static final String COLUMNS_COMPUTING = "columns_computing"; //$NON-NLS-1$ |
|
37 | 35 |
|
38 |
|
|
39 | 36 |
public CAHPreferences() { |
40 | 37 |
// TODO Auto-generated constructor stub |
41 | 38 |
} |
tmp/org.txm.partition.core/src/org/txm/partition/core/preferences/PartitionDimensionsPreferences.java (revision 510) | ||
---|---|---|
14 | 14 |
*/ |
15 | 15 |
public class PartitionDimensionsPreferences extends TXMPreferences { |
16 | 16 |
|
17 |
|
|
18 | 17 |
// auto populate the preference node qualifier from the current bundle id |
19 | 18 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(PartitionDimensionsPreferences.class).getSymbolicName(); |
20 | 19 |
|
... | ... | |
23 | 22 |
public static final String CHART_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE = PREFERENCES_PREFIX + "chart_dimensions_display_parts_count_in_title"; //$NON-NLS-1$ |
24 | 23 |
public static final String CHART_DIMENSIONS_SORTED_BY_SIZE = PREFERENCES_PREFIX + "chart_dimensions_sort_by_parts_size"; //$NON-NLS-1$ |
25 | 24 |
|
26 |
|
|
27 |
|
|
28 |
public PartitionDimensionsPreferences() { |
|
29 |
// TODO Auto-generated constructor stub |
|
30 |
} |
|
31 |
|
|
32 | 25 |
@Override |
33 | 26 |
public void initializeDefaultPreferences() { |
34 | 27 |
Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE); |
tmp/org.txm.searchengine.cqp.core/src/cwbinstaller/CQPPreferences.java (revision 510) | ||
---|---|---|
1 |
package cwbinstaller; |
|
2 |
|
|
3 |
import org.eclipse.core.runtime.preferences.DefaultScope; |
|
4 |
import org.osgi.service.prefs.Preferences; |
|
5 |
import org.txm.core.preferences.TXMPreferences; |
|
6 |
|
|
7 |
public class CQPPreferences extends TXMPreferences { |
|
8 |
|
|
9 |
public static final String PREFERENCES_NODE = "cwbinstaller"; |
|
10 |
|
|
11 |
public static final String VERSION = "cwbinstaller.commands.version"; |
|
12 |
|
|
13 |
@Override |
|
14 |
public void initializeDefaultPreferences() { |
|
15 |
Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE); |
|
16 |
preferences.put(VERSION, "0.0"); |
|
17 |
} |
|
18 |
} |
tmp/org.txm.searchengine.cqp.core/plugin.xml (revision 510) | ||
---|---|---|
7 | 7 |
class="org.txm.searchengine.cqp.CQPEngine"> |
8 | 8 |
</SearchEngine> |
9 | 9 |
</extension> |
10 |
<extension |
|
11 |
point="org.eclipse.core.runtime.preferences"> |
|
12 |
<initializer |
|
13 |
class="org.txm.searchengine.cqp.CQPPreferences"> |
|
14 |
</initializer> |
|
15 |
</extension> |
|
10 | 16 |
|
11 | 17 |
|
12 | 18 |
</plugin> |
tmp/org.txm.ca.core/src/org/txm/ca/core/preferences/CAPreferences.java (revision 510) | ||
---|---|---|
16 | 16 |
*/ |
17 | 17 |
public class CAPreferences extends TXMPreferences { |
18 | 18 |
|
19 |
|
|
20 | 19 |
// auto populate the preference node qualifier from the current bundle id |
21 | 20 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(CAPreferences.class).getSymbolicName(); |
22 |
|
|
23 | 21 |
|
24 |
public static final String PREFERENCES_PREFIX = "ca_"; //$NON-NLS-1$ |
|
25 |
|
|
26 |
|
|
27 |
|
|
28 | 22 |
/** Lexical table FMIN. */ |
29 |
public static final String F_MIN = PREFERENCES_PREFIX + "lt_fmin"; //$NON-NLS-1$
|
|
23 |
public static final String F_MIN = "lt_fmin"; //$NON-NLS-1$ |
|
30 | 24 |
/** Lexical table VMAX. */ |
31 |
public static final String V_MAX = PREFERENCES_PREFIX + "lt_vmax"; //$NON-NLS-1$
|
|
25 |
public static final String V_MAX = "lt_vmax"; //$NON-NLS-1$ |
|
32 | 26 |
|
33 |
public static final String SHOW_INDIVIDUALS = PREFERENCES_PREFIX + "chart_show_individuals"; //$NON-NLS-1$
|
|
34 |
public static final String SHOW_VARIABLES = PREFERENCES_PREFIX + "chart_show_variables"; //$NON-NLS-1$
|
|
35 |
public static final String SHOW_POINT_SHAPES = PREFERENCES_PREFIX + "chart_show_point_shapes"; //$NON-NLS-1$
|
|
27 |
public static final String SHOW_INDIVIDUALS = "chart_show_individuals"; //$NON-NLS-1$ |
|
28 |
public static final String SHOW_VARIABLES = "chart_show_variables"; //$NON-NLS-1$ |
|
29 |
public static final String SHOW_POINT_SHAPES = "chart_show_point_shapes"; //$NON-NLS-1$ |
|
36 | 30 |
|
37 | 31 |
/** The Constant QUALITYDISPLAY. */ |
38 |
public static final String QUALITY_DISPLAY_FORMAT = PREFERENCES_PREFIX + "quality_display_format"; //$NON-NLS-1$
|
|
32 |
public static final String QUALITY_DISPLAY_FORMAT = "quality_display_format"; //$NON-NLS-1$ |
|
39 | 33 |
|
40 | 34 |
/** The Constant CONTRIBDISPLAY. */ |
41 |
public static final String CONTRIB_DISPLAY_FORMAT = PREFERENCES_PREFIX + "contrib_display_format"; //$NON-NLS-1$
|
|
35 |
public static final String CONTRIB_DISPLAY_FORMAT = "contrib_display_format"; //$NON-NLS-1$ |
|
42 | 36 |
|
43 | 37 |
/** The Constant MASSDISPLAY. */ |
44 |
public static final String MASS_DISPLAY_FORMAT = PREFERENCES_PREFIX + "mass_display_format"; //$NON-NLS-1$
|
|
38 |
public static final String MASS_DISPLAY_FORMAT = "mass_display_format"; //$NON-NLS-1$ |
|
45 | 39 |
|
46 |
public static final String CHI_DISPLAY_FORMAT = PREFERENCES_PREFIX + "chi_display_format"; //$NON-NLS-1$
|
|
40 |
public static final String CHI_DISPLAY_FORMAT = "chi_display_format"; //$NON-NLS-1$ |
|
47 | 41 |
|
48 | 42 |
/** The Constant DISTDISPLAY. */ |
49 |
public static final String DIST_DISPLAY_FORMAT = PREFERENCES_PREFIX + "dist_display_format"; //$NON-NLS-1$
|
|
43 |
public static final String DIST_DISPLAY_FORMAT = "dist_display_format"; //$NON-NLS-1$ |
|
50 | 44 |
|
51 | 45 |
/** The Constant COS2DISPLAY. */ |
52 |
public static final String COS2_DISPLAY_FORMAT = PREFERENCES_PREFIX + "cos2_display_format"; //$NON-NLS-1$
|
|
46 |
public static final String COS2_DISPLAY_FORMAT = "cos2_display_format"; //$NON-NLS-1$ |
|
53 | 47 |
|
54 | 48 |
/** The Constant COORDDISPLAY. */ |
55 |
public static final String COORD_DISPLAY_FORMAT = PREFERENCES_PREFIX + "coord_display_format"; //$NON-NLS-1$
|
|
49 |
public static final String COORD_DISPLAY_FORMAT = "coord_display_format"; //$NON-NLS-1$ |
|
56 | 50 |
|
57 | 51 |
|
58 |
public static final String FIRST_DIMENSION = PREFERENCES_PREFIX + "first_dimension"; //$NON-NLS-1$
|
|
59 |
public static final String SECOND_DIMENSION = PREFERENCES_PREFIX + "second_dimension"; //$NON-NLS-1$
|
|
52 |
public static final String FIRST_DIMENSION = "first_dimension"; //$NON-NLS-1$ |
|
53 |
public static final String SECOND_DIMENSION = "second_dimension"; //$NON-NLS-1$ |
|
60 | 54 |
|
61 | 55 |
|
62 | 56 |
|
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java (revision 510) | ||
---|---|---|
19 | 19 |
// auto populate the preference node qualifier from the current bundle id |
20 | 20 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(RPreferences.class).getSymbolicName(); |
21 | 21 |
|
22 |
//public static final String PREFERENCES_NODE = RPreferences.class.getName();//FrameworkUtil.getBundle(RPreferences.class).getSymbolicName(); |
|
23 |
//FIXME: tests |
|
24 |
//public static final String PREFERENCES_NODE = "org.txm.statsengine.r.core"; |
|
25 |
|
|
26 |
|
|
27 | 22 |
public static final String PREFERENCES_PREFIX = "r_"; //$NON-NLS-1$ |
28 | 23 |
|
29 | 24 |
/** The Constant R_REMOTE. */ |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/SetSearchEngine.java (revision 510) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.rcp.commands.workspace; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
|
|
32 |
import org.eclipse.core.commands.AbstractHandler; |
|
33 |
import org.eclipse.core.commands.ExecutionEvent; |
|
34 |
import org.eclipse.core.commands.ExecutionException; |
|
35 |
import org.eclipse.core.runtime.Platform; |
|
36 |
import org.osgi.service.prefs.BackingStoreException; |
|
37 |
import org.osgi.service.prefs.Preferences; |
|
38 |
import org.eclipse.core.runtime.preferences.IPreferencesService; |
|
39 |
import org.eclipse.core.runtime.preferences.InstanceScope; |
|
40 |
import org.eclipse.jface.util.Util; |
|
41 |
import org.eclipse.swt.SWT; |
|
42 |
import org.eclipse.swt.widgets.DirectoryDialog; |
|
43 |
import org.eclipse.swt.widgets.Shell; |
|
44 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
45 |
import org.txm.importer.cwb.CwbEncode; |
|
46 |
import org.txm.rcp.Application; |
|
47 |
import org.txm.rcp.preferences.CQPPreferencePage; |
|
48 |
|
|
49 |
// TODO: Auto-generated Javadoc |
|
50 |
/** |
|
51 |
* The Class SetSearchEngine. |
|
52 |
* |
|
53 |
* not used |
|
54 |
*/ |
|
55 |
@Deprecated |
|
56 |
public class SetSearchEngine extends AbstractHandler { |
|
57 |
|
|
58 |
/* (non-Javadoc) |
|
59 |
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
60 |
*/ |
|
61 |
@Override |
|
62 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
63 |
|
|
64 |
// IPreferencesService service = Platform.getPreferencesService(); |
|
65 |
// String currentengine = service.getString(Application.PLUGIN_ID, |
|
66 |
// TBXPreferences.CQI_SERVER_PATH_TO_REGISTRY, "", null); //$NON-NLS-1$ |
|
67 |
// currentengine = new File(currentengine).getParent(); |
|
68 |
// |
|
69 |
// Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event) |
|
70 |
// .getShell(); |
|
71 |
// DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN); |
|
72 |
// dialog.setFilterPath(currentengine); |
|
73 |
// |
|
74 |
// if (dialog.open() != null) { |
|
75 |
// String path = dialog.getFilterPath(); |
|
76 |
// System.out.println("import searchengine " + path); //$NON-NLS-1$ |
|
77 |
// CwbEncode.patchDir(new File(path)); |
|
78 |
// |
|
79 |
// Preferences preferences = new InstanceScope() |
|
80 |
// .getNode(Application.PLUGIN_ID); |
|
81 |
// |
|
82 |
// preferences.put(TBXPreferences.CQI_SERVER_PATH_TO_REGISTRY, path |
|
83 |
// + "/registry"); //$NON-NLS-1$ |
|
84 |
// |
|
85 |
// if (Util.isWindows()) //$NON-NLS-1$ //$NON-NLS-2$ |
|
86 |
// preferences.put( |
|
87 |
// TBXPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, path |
|
88 |
// + "/bin/cqpserver.exe"); //$NON-NLS-1$ |
|
89 |
// else |
|
90 |
// preferences.put( |
|
91 |
// TBXPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, path |
|
92 |
// + "/bin/cqpserver"); //$NON-NLS-1$ |
|
93 |
// |
|
94 |
// preferences.put(TBXPreferences.CQI_SERVER_PATH_TO_INIT_FILE, |
|
95 |
// path + "/cqpserver.init"); //$NON-NLS-1$ |
|
96 |
// try { |
|
97 |
// preferences.flush(); |
|
98 |
// } catch (BackingStoreException e) { |
|
99 |
// org.txm.rcp.utils.Logger.printStackTrace(e); |
|
100 |
// } |
|
101 |
// |
|
102 |
// org.txm.Toolbox.shutdown(); |
|
103 |
// try { |
|
104 |
// org.txm.Toolbox |
|
105 |
// .initialize(org.txm.rcp.ApplicationWorkbenchAdvisor |
|
106 |
// .getProperties()); |
|
107 |
// } catch (Exception e) { |
|
108 |
// // TODO Auto-generated catch block |
|
109 |
// org.txm.rcp.utils.Logger.printStackTrace(e); |
|
110 |
// } |
|
111 |
// org.txm.rcp.views.CorporaView.refresh(); |
|
112 |
// |
|
113 |
// System.out |
|
114 |
// .println("preferences " + preferences.get(TBXPreferences.CQI_SERVER_PATH_TO_REGISTRY, null)); //$NON-NLS-1$ |
|
115 |
// System.out |
|
116 |
// .println("preferences " + preferences.get(TBXPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, null)); //$NON-NLS-1$ |
|
117 |
// System.out |
|
118 |
// .println("preferences " + preferences.get(TBXPreferences.CQI_SERVER_PATH_TO_INIT_FILE, null)); //$NON-NLS-1$ |
|
119 |
// } |
|
120 |
|
|
121 |
return null; |
|
122 |
} |
|
123 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ReferencerPreferencePage.java (revision 510) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.rcp.preferences; |
|
29 |
|
|
30 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
31 |
import org.eclipse.jface.preference.FieldEditorPreferencePage; |
|
32 |
import org.eclipse.ui.IWorkbench; |
|
33 |
import org.eclipse.ui.IWorkbenchPreferencePage; |
|
34 |
import org.eclipse.ui.preferences.ScopedPreferenceStore; |
|
35 |
import org.txm.rcp.Application; |
|
36 |
import org.txm.rcp.Messages; |
|
37 |
|
|
38 |
/** |
|
39 |
* This class represents a preference page that is contributed to the |
|
40 |
* Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we |
|
41 |
* can use the field support built into JFace that allows us to create a page |
|
42 |
* that is small and knows how to save, restore and apply itself. |
|
43 |
* <p> |
|
44 |
* This page is used to modif y preferences only. They are stored in the |
|
45 |
* preference store that belongs to the main plug-in class. That way, |
|
46 |
* preferences can be accessed directly via the preference store. |
|
47 |
*/ |
|
48 |
|
|
49 |
public class ReferencerPreferencePage extends RCPPreferencesPage { |
|
50 |
|
|
51 |
/** The referencer_sorttype. */ |
|
52 |
private BooleanFieldEditor referencer_sorttype; |
|
53 |
|
|
54 |
/** |
|
55 |
* Instantiates a new referencer preference page. |
|
56 |
*/ |
|
57 |
public ReferencerPreferencePage() { |
|
58 |
super(); |
|
59 |
setTitle(Messages.ReferencerPreferencePage_2); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* Creates the field editors. Field editors are abstractions of the common |
|
64 |
* GUI blocks needed to manipulate various types of preferences. Each field |
|
65 |
* editor knows how to save and restore itself. |
|
66 |
*/ |
|
67 |
@Override |
|
68 |
public void createFieldEditors() { |
|
69 |
|
|
70 |
referencer_sorttype = new BooleanFieldEditor(RCPPreferences.SORTBYFREQ, |
|
71 |
Messages.ReferencerPreferencePage_3, getFieldEditorParent()); |
|
72 |
|
|
73 |
addField(referencer_sorttype); |
|
74 |
|
|
75 |
} |
|
76 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/CQPPreferencePage.java (revision 510) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.rcp.preferences; |
|
29 |
|
|
30 |
import java.io.IOException; |
|
31 |
|
|
32 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
33 |
import org.eclipse.jface.preference.DirectoryFieldEditor; |
|
34 |
import org.eclipse.jface.preference.FieldEditor; |
|
35 |
import org.eclipse.jface.preference.FieldEditorPreferencePage; |
|
36 |
import org.eclipse.jface.preference.FileFieldEditor; |
|
37 |
import org.eclipse.jface.preference.IntegerFieldEditor; |
|
38 |
import org.eclipse.jface.preference.StringFieldEditor; |
|
39 |
import org.eclipse.jface.util.PropertyChangeEvent; |
|
40 |
import org.eclipse.osgi.util.NLS; |
|
41 |
import org.eclipse.ui.IWorkbench; |
|
42 |
import org.eclipse.ui.IWorkbenchPreferencePage; |
|
43 |
import org.eclipse.ui.preferences.ScopedPreferenceStore; |
|
44 |
import org.osgi.service.prefs.Preferences; |
|
45 |
import org.txm.core.preferences.TBXPreferences; |
|
46 |
import org.txm.rcp.Application; |
|
47 |
import org.txm.rcp.Messages; |
|
48 |
import org.txm.searchengine.cqp.CQPPreferences; |
|
49 |
// TODO: Auto-generated Javadoc |
|
50 |
/** |
|
51 |
* This class represents a preference page that is contributed to the |
|
52 |
* Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we |
|
53 |
* can use the field support built into JFace that allows us to create a page |
|
54 |
* that is small and knows how to save, restore and apply itself. |
|
55 |
* <p> |
|
56 |
* This page is used to modif y preferences only. They are stored in the |
|
57 |
* preference store that belongs to the main plug-in class. That way, |
|
58 |
* preferences can be accessed directly via the preference store. |
|
59 |
*/ |
|
60 |
|
|
61 |
public class CQPPreferencePage extends TXMPreferencePage { |
|
62 |
|
|
63 |
/** The cqi_server_is_remote. */ |
|
64 |
private BooleanFieldEditor cqi_use_network; |
|
65 |
|
|
66 |
/** The cqi_server_is_remote. */ |
|
67 |
private BooleanFieldEditor cqi_server_is_remote; |
|
68 |
|
|
69 |
/** The cqi_server_host. */ |
|
70 |
private StringFieldEditor cqi_server_host; |
|
71 |
|
|
72 |
/** The cqi_server_path_to_executable. */ |
|
73 |
private StringFieldEditor cqi_server_path_to_executable; |
|
74 |
private StringFieldEditor cqi_server_path_to_cqplib; |
|
75 |
|
|
76 |
// /** The cqi_server_path_to_registry. */ |
|
77 |
// private StringFieldEditor cqi_server_path_to_registry; |
|
78 |
|
|
79 |
/** The cqi_server_path_to_init_file. */ |
|
80 |
private StringFieldEditor cqi_server_path_to_init_file; |
|
81 |
|
|
82 |
/** The cqi_server_additional_options. */ |
|
83 |
private StringFieldEditor cqi_server_additional_options; |
|
84 |
|
|
85 |
/** The cqi_server_path_to_registry. */ |
|
86 |
private StringFieldEditor cqi_server_port; |
|
87 |
|
|
88 |
/** The cqi_server_path_to_init_file. */ |
|
89 |
private StringFieldEditor cqi_server_user; |
|
90 |
|
|
91 |
/** The cqi_server_additional_options. */ |
|
92 |
private StringFieldEditor cqi_server_password; |
|
93 |
|
|
94 |
/** |
|
95 |
* Instantiates a new cQP preference page. |
|
96 |
*/ |
|
97 |
public CQPPreferencePage() { |
|
98 |
super(); |
|
99 |
} |
|
100 |
|
|
101 |
/** |
|
102 |
* Creates the field editors. Field editors are abstractions of the common |
|
103 |
* GUI blocks needed to manipulate various types of preferences. Each field |
|
104 |
* editor knows how to save and restore itself. |
|
105 |
*/ |
|
106 |
@Override |
|
107 |
public void createFieldEditors() { |
|
108 |
|
|
109 |
cqi_use_network = new BooleanFieldEditor(CQPPreferences.CQI_NETWORK_MODE, |
|
110 |
Messages.CQPPreferencePage_1, |
|
111 |
BooleanFieldEditor.DEFAULT, getFieldEditorParent()); |
|
112 |
cqi_server_path_to_cqplib = new DirectoryFieldEditor( |
|
113 |
CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, Messages.CQPPreferencePage_0, |
|
114 |
getFieldEditorParent()); |
|
115 |
cqi_server_is_remote = new BooleanFieldEditor(CQPPreferences.CQI_SERVER_IS_REMOTE, |
|
116 |
Messages.CQPPreferencePage_10, |
|
117 |
BooleanFieldEditor.DEFAULT, getFieldEditorParent()); |
|
118 |
cqi_server_host = new StringFieldEditor(CQPPreferences.CQI_SERVER_HOST, |
|
119 |
Messages.CQPPreferencePage_11, getFieldEditorParent()); |
|
120 |
|
|
121 |
cqi_server_port = new IntegerFieldEditor(CQPPreferences.CQI_SERVER_PORT, |
|
122 |
Messages.CQPPreferencePage_12, getFieldEditorParent()); |
|
123 |
|
|
124 |
cqi_server_user = new StringFieldEditor(CQPPreferences.CQI_SERVER_LOGIN, |
|
125 |
Messages.CQPPreferencePage_13, getFieldEditorParent()); |
|
126 |
|
|
127 |
cqi_server_password = new StringFieldEditor(CQPPreferences.CQI_SERVER_PASSWORD, |
|
128 |
Messages.CQPPreferencePage_14, getFieldEditorParent()); |
|
129 |
|
|
130 |
cqi_server_path_to_executable = new FileFieldEditor( |
|
131 |
CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, Messages.CQPPreferencePage_15, |
|
132 |
getFieldEditorParent()); |
|
133 |
|
|
134 |
// cqi_server_path_to_registry = new DirectoryFieldEditor( |
|
135 |
// CQI_SERVER_PATH_TO_REGISTRY, Messages.CQPPreferencePage_16, |
|
136 |
// getFieldEditorParent()); |
|
137 |
cqi_server_path_to_init_file = new FileFieldEditor( |
|
138 |
CQPPreferences.CQI_SERVER_PATH_TO_INIT_FILE, Messages.CQPPreferencePage_17, |
|
139 |
getFieldEditorParent()); |
|
140 |
cqi_server_additional_options = new StringFieldEditor( |
|
141 |
CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, Messages.CQPPreferencePage_18, |
|
142 |
getFieldEditorParent()); |
|
143 |
|
|
144 |
addField(cqi_use_network); |
|
145 |
addField(cqi_server_path_to_cqplib); |
|
146 |
addField(cqi_server_is_remote); |
|
147 |
addField(cqi_server_host); |
|
148 |
addField(cqi_server_port); |
|
149 |
addField(cqi_server_user); |
|
150 |
addField(cqi_server_password); |
|
151 |
addField(cqi_server_path_to_executable); |
|
152 |
// addField(cqi_server_path_to_registry); |
|
153 |
addField(cqi_server_path_to_init_file); |
|
154 |
addField(cqi_server_additional_options); |
|
155 |
|
|
156 |
Preferences preferences = org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE.getNode(Application.PLUGIN_ID); |
|
157 |
boolean useNetwork = preferences.getBoolean( |
|
158 |
CQPPreferences.CQI_NETWORK_MODE, |
|
159 |
false); |
|
160 |
boolean serverIsRemote = preferences.getBoolean( |
|
161 |
CQPPreferences.CQI_SERVER_IS_REMOTE, |
|
162 |
false); |
|
163 |
updateFieldsState(useNetwork, serverIsRemote); |
|
164 |
} |
|
165 |
|
|
166 |
public void updateFieldsState(boolean useNetwork, boolean serverIsRemote) { |
|
167 |
|
|
168 |
//System.out.println("update field state : "+useNetwork+" "+serverIsRemote); |
|
169 |
|
|
170 |
if (useNetwork) { |
|
171 |
if (serverIsRemote) { |
|
172 |
(cqi_server_path_to_cqplib).setEnabled(false, getFieldEditorParent()); |
|
173 |
(cqi_server_is_remote).setEnabled(true, getFieldEditorParent()); |
|
174 |
(cqi_server_host).setEnabled(true, getFieldEditorParent()); |
|
175 |
(cqi_server_port).setEnabled(true, getFieldEditorParent()); |
|
176 |
(cqi_server_user).setEnabled(true, getFieldEditorParent()); |
|
177 |
(cqi_server_password).setEnabled(true, getFieldEditorParent()); |
|
178 |
(cqi_server_path_to_executable).setEnabled(false, getFieldEditorParent()); |
|
179 |
// (cqi_server_path_to_registry).setEnabled(false, getFieldEditorParent()); |
|
180 |
(cqi_server_path_to_init_file).setEnabled(false, getFieldEditorParent()); |
|
181 |
(cqi_server_additional_options).setEnabled(true, getFieldEditorParent()); |
|
182 |
} else { |
|
183 |
//cqi_server_host.loadDefault(); |
|
184 |
(cqi_server_path_to_cqplib).setEnabled(false, getFieldEditorParent()); |
|
185 |
(cqi_server_is_remote).setEnabled(true, getFieldEditorParent()); |
|
186 |
(cqi_server_host).setEnabled(false, getFieldEditorParent()); |
|
187 |
(cqi_server_port).setEnabled(true, getFieldEditorParent()); |
|
188 |
(cqi_server_user).setEnabled(true, getFieldEditorParent()); |
|
189 |
(cqi_server_password).setEnabled(true, getFieldEditorParent()); |
|
190 |
(cqi_server_path_to_executable).setEnabled(true, getFieldEditorParent()); |
|
191 |
// (cqi_server_path_to_registry).setEnabled(true, getFieldEditorParent()); |
|
192 |
(cqi_server_path_to_init_file).setEnabled(true, getFieldEditorParent()); |
|
193 |
(cqi_server_additional_options).setEnabled(true, getFieldEditorParent()); |
|
194 |
} |
|
195 |
} else { |
|
196 |
(cqi_server_path_to_cqplib).setEnabled(true, getFieldEditorParent()); |
|
197 |
(cqi_server_is_remote).setEnabled(false, getFieldEditorParent()); |
|
198 |
(cqi_server_host).setEnabled(false, getFieldEditorParent()); |
|
199 |
(cqi_server_port).setEnabled(false, getFieldEditorParent()); |
|
200 |
(cqi_server_user).setEnabled(false, getFieldEditorParent()); |
|
201 |
(cqi_server_password).setEnabled(false, getFieldEditorParent()); |
|
202 |
(cqi_server_path_to_executable).setEnabled(false, getFieldEditorParent()); |
|
203 |
// (cqi_server_path_to_registry).setEnabled(true, getFieldEditorParent()); |
|
204 |
(cqi_server_path_to_init_file).setEnabled(true, getFieldEditorParent()); |
|
205 |
(cqi_server_additional_options).setEnabled(true, getFieldEditorParent()); |
|
206 |
} |
|
207 |
} |
|
208 |
|
|
209 |
/* |
|
210 |
* (non-Javadoc) |
|
211 |
* |
|
212 |
* @see |
|
213 |
* org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) |
|
214 |
*/ |
|
215 |
@Override |
|
216 |
public void init(IWorkbench workbench) { |
|
217 |
this.setPreferenceStore(new TXMPreferenceStore(CQPPreferences.PREFERENCES_NODE)); |
|
218 |
} |
|
219 |
|
|
220 |
/* (non-Javadoc) |
|
221 |
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
|
222 |
*/ |
|
223 |
@Override |
|
224 |
public void propertyChange(PropertyChangeEvent event) { |
|
225 |
boolean useNetwork = false; |
|
226 |
boolean serverIsRemote = false; |
|
227 |
boolean update = false; |
|
228 |
if (((FieldEditor) event.getSource()).getPreferenceName().equals( |
|
229 |
CQPPreferences.CQI_SERVER_IS_REMOTE)) { |
|
230 |
useNetwork = cqi_use_network.getBooleanValue(); |
|
231 |
serverIsRemote = (Boolean) event.getNewValue(); |
|
232 |
update = true; |
|
233 |
} else if (((FieldEditor) event.getSource()).getPreferenceName().equals( |
|
234 |
CQPPreferences.CQI_NETWORK_MODE)) { |
|
235 |
useNetwork = (Boolean) event.getNewValue(); |
|
236 |
serverIsRemote = cqi_server_is_remote.getBooleanValue(); |
|
237 |
update = true; |
|
238 |
} |
|
239 |
if (update) |
|
240 |
updateFieldsState(useNetwork, serverIsRemote); |
|
241 |
} |
|
242 |
} |
tmp/org.txm.rcp/plugin.xml (revision 510) | ||
---|---|---|
287 | 287 |
name="%page.name.0"> |
288 | 288 |
</page> |
289 | 289 |
<page |
290 |
category="org.txm.rcp.preferences.AdvancePreferencePage" |
|
291 |
class="org.txm.rcp.preferences.CQPPreferencePage" |
|
292 |
id="org.txm.rcp.preferences.CQPPreferencePage" |
|
293 |
name="%page.name.4"> |
|
294 |
</page> |
|
295 |
<page |
|
296 | 290 |
class="org.txm.rcp.preferences.TXMMainPreferencePage" |
297 | 291 |
id="org.txm.rcp.preferences.TextometriePreferencePage" |
298 | 292 |
name="%page.name.6"> |
tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/preferences/WordCloudPreferences.java (revision 510) | ||
---|---|---|
25 | 25 |
public static final String ROT = PREFERENCES_PREFIX + "rotation_percent"; //$NON-NLS-1$ |
26 | 26 |
public static final String RANDOM_POSITION = PREFERENCES_PREFIX + "random_positions"; //$NON-NLS-1$ |
27 | 27 |
|
28 |
|
|
29 |
public WordCloudPreferences() { |
|
30 |
// TODO Auto-generated constructor stub |
|
31 |
} |
|
32 |
|
|
33 | 28 |
@Override |
34 | 29 |
public void initializeDefaultPreferences() { |
35 | 30 |
|
... | ... | |
41 | 36 |
|
42 | 37 |
// FIXME: shared charts rendering preferences |
43 | 38 |
//ChartsEnginePreferences.initializeChartsEngineSharedPreferences(preferences); |
44 |
|
|
45 | 39 |
} |
46 |
|
|
47 | 40 |
} |
tmp/org.txm.progression.core/src/org/txm/progression/core/preferences/ProgressionPreferences.java (revision 510) | ||
---|---|---|
20 | 20 |
// auto populate the preference node qualifier from the current bundle id |
21 | 21 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(ProgressionPreferences.class).getSymbolicName(); |
22 | 22 |
|
23 |
|
|
24 | 23 |
public static final String PREFERENCES_PREFIX = "progression_"; //$NON-NLS-1$ |
25 | 24 |
|
26 | 25 |
/** The Constant CUMULATIVE. */ |
... | ... | |
35 | 34 |
/** The Constant MONO_STYLE. */ |
36 | 35 |
public static final String CHART_MONO_STYLE = PREFERENCES_PREFIX + "chart_mono_style"; //$NON-NLS-1$ |
37 | 36 |
|
38 |
|
|
39 | 37 |
/** |
40 | 38 |
* |
41 | 39 |
*/ |
tmp/org.txm.annotation.core/plugin.xml (revision 510) | ||
---|---|---|
5 | 5 |
<extension |
6 | 6 |
point="org.txm.EnginesManager"> |
7 | 7 |
</extension> |
8 |
<extension |
|
9 |
point="org.eclipse.core.runtime.preferences"> |
|
10 |
<initializer |
|
11 |
class="org.txm.annotation.core.preferences.AnnotationPreferences"> |
|
12 |
</initializer> |
|
13 |
</extension> |
|
8 | 14 |
|
9 | 15 |
</plugin> |
tmp/org.txm.referencer.rcp/plugin.xml (revision 510) | ||
---|---|---|
117 | 117 |
point="org.eclipse.ui.preferencePages"> |
118 | 118 |
<page |
119 | 119 |
category="org.txm.rcp.preferences.UserPreferencePage" |
120 |
class="org.txm.rcp.preferences.ReferencerPreferencePage" |
|
121 |
id="org.txm.rcp.preferences.ReferencerPreferencePage" |
|
122 |
name="%page.name.16">
|
|
120 |
class="org.txm.references.rcp.preferences.ReferencerPreferencePage"
|
|
121 |
id="org.txm.references.rcp.preferences.ReferencerPreferencePage"
|
|
122 |
name="Referencer">
|
|
123 | 123 |
</page> |
124 | 124 |
</extension> |
125 | 125 |
</plugin> |
tmp/org.txm.referencer.rcp/src/org/txm/references/rcp/preferences/ReferencerPreferencePage.java (revision 510) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.references.rcp.preferences; |
|
29 |
|
|
30 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
31 |
import org.txm.rcp.Messages; |
|
32 |
import org.txm.rcp.preferences.RCPPreferences; |
|
33 |
import org.txm.rcp.preferences.RCPPreferencesPage; |
|
34 |
|
|
35 |
/** |
|
36 |
* This class represents a preference page that is contributed to the |
|
37 |
* Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we |
|
38 |
* can use the field support built into JFace that allows us to create a page |
|
39 |
* that is small and knows how to save, restore and apply itself. |
|
40 |
* <p> |
|
41 |
* This page is used to modif y preferences only. They are stored in the |
|
42 |
* preference store that belongs to the main plug-in class. That way, |
|
43 |
* preferences can be accessed directly via the preference store. |
|
44 |
*/ |
|
45 |
|
|
46 |
public class ReferencerPreferencePage extends RCPPreferencesPage { |
|
47 |
|
|
48 |
/** The referencer_sorttype. */ |
|
49 |
private BooleanFieldEditor referencer_sorttype; |
|
50 |
|
|
51 |
/** |
|
52 |
* Instantiates a new referencer preference page. |
|
53 |
*/ |
|
54 |
public ReferencerPreferencePage() { |
|
55 |
super(); |
|
56 |
setTitle(Messages.ReferencerPreferencePage_2); |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* Creates the field editors. Field editors are abstractions of the common |
|
61 |
* GUI blocks needed to manipulate various types of preferences. Each field |
|
62 |
* editor knows how to save and restore itself. |
|
63 |
*/ |
|
64 |
@Override |
|
65 |
public void createFieldEditors() { |
|
66 |
|
|
67 |
referencer_sorttype = new BooleanFieldEditor(RCPPreferences.SORTBYFREQ, |
|
68 |
Messages.ReferencerPreferencePage_3, getFieldEditorParent()); |
|
69 |
|
|
70 |
addField(referencer_sorttype); |
|
71 |
|
|
72 |
} |
|
73 |
} |
|
0 | 74 |
tmp/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java (revision 510) | ||
---|---|---|
18 | 18 |
|
19 | 19 |
// auto populate the preference node qualifier from the current bundle id |
20 | 20 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(ConcordancePreferences.class).getSymbolicName(); |
21 |
|
|
22 | 21 |
|
23 | 22 |
public static final String PREFERENCES_PREFIX = "concordance_"; //$NON-NLS-1$ |
24 | 23 |
public static final String N_LINE_PER_PAGE = PREFERENCES_PREFIX + "n_line_per_page"; //$NON-NLS-1$ |
tmp/org.txm.referencer.core/src/org/txm/functions/referencer/ReferencerPreferences.java (revision 510) | ||
---|---|---|
1 |
package org.txm.functions.referencer; |
|
2 |
|
|
3 |
import org.eclipse.core.runtime.preferences.DefaultScope; |
|
4 |
import org.osgi.service.prefs.Preferences; |
|
5 |
import org.txm.core.preferences.TXMPreferences; |
|
6 |
|
|
7 |
public class ReferencerPreferences extends TXMPreferences { |
|
8 |
|
|
9 |
public static final String PREFERENCES_NODE = ReferencerPreferences.class.getName();//FrameworkUtil.getBundle(RPreferences.class).getSymbolicName(); |
|
10 |
|
|
11 |
|
|
12 |
/** The Constant SORTBYFREQ. */ |
|
13 |
//FIXME: to extract to referencer plug-in |
|
14 |
public static final String SORTBYFREQ = "referencer_sorttype"; //$NON-NLS-1$ |
|
15 |
|
|
16 |
@Override |
|
17 |
public void initializeDefaultPreferences() { |
|
18 |
Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE); |
|
19 |
|
|
20 |
preferences.putBoolean(SORTBYFREQ, false); //$NON-NLS-1$ |
|
21 |
|
|
22 |
} |
|
23 |
} |
|
0 | 24 |
tmp/org.txm.referencer.core/build.properties (revision 510) | ||
---|---|---|
1 | 1 |
source.. = src/ |
2 | 2 |
output.. = bin/ |
3 | 3 |
bin.includes = META-INF/,\ |
4 |
. |
|
4 |
.,\ |
|
5 |
plugin.xml |
tmp/org.txm.referencer.core/plugin.xml (revision 510) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<?eclipse version="3.4"?> |
|
3 |
<plugin> |
|
4 |
<extension |
|
5 |
point="org.eclipse.core.runtime.preferences"> |
|
6 |
<initializer |
|
7 |
class="org.txm.functions.referencer.ReferencerPreferences"> |
|
8 |
</initializer> |
|
9 |
</extension> |
|
10 |
|
|
11 |
</plugin> |
|
0 | 12 |
tmp/org.txm.referencer.core/META-INF/MANIFEST.MF (revision 510) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 | 2 |
Bundle-ManifestVersion: 2 |
3 | 3 |
Bundle-Name: Referencer |
4 |
Bundle-SymbolicName: org.txm.referencer.core |
|
4 |
Bundle-SymbolicName: org.txm.referencer.core;singleton:=true
|
|
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
7 | 7 |
Require-Bundle: org.txm.utils;bundle-version="1.0.0", |
tmp/org.txm.groovy.core/src/java/GroovyPreferences.java (revision 510) | ||
---|---|---|
1 |
import org.txm.core.preferences.TXMPreferences; |
|
2 |
|
|
3 |
public class GroovyPreferences extends TXMPreferences { |
|
4 |
|
|
5 |
public static final String PREFERENCES_NODE = GroovyPreferences.class.getName();//FrameworkUtil.getBundle(RPreferences.class).getSymbolicName(); |
|
6 |
|
|
7 |
@Override |
|
8 |
public void initializeDefaultPreferences() { |
|
9 |
// TODO Auto-generated method stub |
|
10 |
} |
|
11 |
} |
|
0 | 12 |
tmp/org.txm.internalview.core/META-INF/MANIFEST.MF (revision 510) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 | 2 |
Bundle-ManifestVersion: 2 |
3 | 3 |
Bundle-Name: InternalView |
4 |
Bundle-SymbolicName: org.txm.internalview.core |
|
4 |
Bundle-SymbolicName: org.txm.internalview.core;singleton:=true
|
|
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
7 | 7 |
Require-Bundle: org.txm.core;bundle-version="0.8.0";visibility:=reexport, |
tmp/org.txm.internalview.core/src/org/txm/functions/internal/InternalViewPreferences.java (revision 510) | ||
---|---|---|
1 |
package org.txm.functions.internal; |
|
2 |
|
|
3 |
import org.eclipse.core.runtime.preferences.DefaultScope; |
|
4 |
import org.osgi.framework.FrameworkUtil; |
|
5 |
import org.osgi.service.prefs.Preferences; |
|
6 |
import org.txm.core.preferences.TXMPreferences; |
|
7 |
|
|
8 |
public class InternalViewPreferences extends TXMPreferences { |
|
9 |
|
|
10 |
public static String PREFERENCES_NODE = FrameworkUtil.getBundle(InternalViewPreferences.class).getSymbolicName(); |
|
11 |
|
|
12 |
@Override |
|
13 |
public void initializeDefaultPreferences() { |
|
14 |
Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE); |
|
15 |
} |
|
16 |
} |
|
0 | 17 |
tmp/org.txm.internalview.core/build.properties (revision 510) | ||
---|---|---|
1 | 1 |
source.. = src/ |
2 | 2 |
output.. = bin/ |
3 | 3 |
bin.includes = META-INF/,\ |
4 |
. |
|
4 |
.,\ |
|
5 |
plugin.xml |
tmp/org.txm.internalview.core/plugin.xml (revision 510) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<?eclipse version="3.4"?> |
|
3 |
<plugin> |
|
4 |
<extension |
|
5 |
point="org.eclipse.core.runtime.preferences"> |
|
6 |
<initializer |
|
7 |
class="org.txm.functions.internal.InternalViewPreferences"> |
|
8 |
</initializer> |
|
9 |
</extension> |
|
10 |
|
|
11 |
</plugin> |
|
0 | 12 |
tmp/org.txm.searchengine.cqp.rcp/plugin.xml (revision 510) | ||
---|---|---|
256 | 256 |
</command> |
257 | 257 |
</menuContribution> |
258 | 258 |
</extension> |
259 |
<extension |
|
260 |
point="org.eclipse.ui.preferencePages"> |
|
261 |
<page |
|
262 |
category="org.txm.rcp.preferences.AdvancePreferencePage" |
|
263 |
class="org.txm.rcp.preferences.CQPPreferencePage" |
|
264 |
id="org.txm.rcp.preferences.CQPPreferencePage" |
|
265 |
name="CQP"> |
|
266 |
</page> |
|
267 |
</extension> |
|
259 | 268 |
|
260 | 269 |
</plugin> |
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/CQPPreferencePage.java (revision 510) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.searchengine.cqp.rcp.preferences; |
|
29 |
|
|
30 |
|
|
31 |
import java.io.IOException; |
|
32 |
|
|
33 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
34 |
import org.eclipse.jface.preference.DirectoryFieldEditor; |
|
35 |
import org.eclipse.jface.preference.FieldEditor; |
|
36 |
import org.eclipse.jface.preference.FieldEditorPreferencePage; |
|
37 |
import org.eclipse.jface.preference.FileFieldEditor; |
|
38 |
import org.eclipse.jface.preference.IntegerFieldEditor; |
|
39 |
import org.eclipse.jface.preference.StringFieldEditor; |
|
40 |
import org.eclipse.jface.util.PropertyChangeEvent; |
|
41 |
import org.eclipse.osgi.util.NLS; |
|
42 |
import org.eclipse.ui.IWorkbench; |
|
43 |
import org.eclipse.ui.IWorkbenchPreferencePage; |
|
44 |
import org.eclipse.ui.preferences.ScopedPreferenceStore; |
|
45 |
import org.osgi.service.prefs.Preferences; |
|
46 |
import org.txm.core.preferences.TBXPreferences; |
|
47 |
import org.txm.rcp.Application; |
|
48 |
import org.txm.rcp.Messages; |
|
49 |
import org.txm.rcp.preferences.TXMPreferencePage; |
|
50 |
import org.txm.rcp.preferences.TXMPreferenceStore; |
|
51 |
import org.txm.searchengine.cqp.CQPPreferences; |
|
52 |
// TODO: Auto-generated Javadoc |
|
53 |
/** |
|
54 |
* This class represents a preference page that is contributed to the |
|
55 |
* Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we |
|
56 |
* can use the field support built into JFace that allows us to create a page |
|
57 |
* that is small and knows how to save, restore and apply itself. |
|
58 |
* <p> |
|
59 |
* This page is used to modif y preferences only. They are stored in the |
|
60 |
* preference store that belongs to the main plug-in class. That way, |
|
61 |
* preferences can be accessed directly via the preference store. |
|
62 |
*/ |
|
63 |
|
|
64 |
public class CQPPreferencePage extends TXMPreferencePage { |
|
65 |
|
|
66 |
/** The cqi_server_is_remote. */ |
|
67 |
private BooleanFieldEditor cqi_use_network; |
|
68 |
|
|
69 |
/** The cqi_server_is_remote. */ |
|
70 |
private BooleanFieldEditor cqi_server_is_remote; |
|
71 |
|
|
72 |
/** The cqi_server_host. */ |
|
73 |
private StringFieldEditor cqi_server_host; |
|
74 |
|
|
75 |
/** The cqi_server_path_to_executable. */ |
|
76 |
private StringFieldEditor cqi_server_path_to_executable; |
|
77 |
private StringFieldEditor cqi_server_path_to_cqplib; |
|
78 |
|
|
79 |
// /** The cqi_server_path_to_registry. */ |
|
80 |
// private StringFieldEditor cqi_server_path_to_registry; |
|
81 |
|
|
82 |
/** The cqi_server_path_to_init_file. */ |
|
83 |
private StringFieldEditor cqi_server_path_to_init_file; |
|
84 |
|
|
85 |
/** The cqi_server_additional_options. */ |
|
86 |
private StringFieldEditor cqi_server_additional_options; |
|
87 |
|
|
88 |
/** The cqi_server_path_to_registry. */ |
|
89 |
private StringFieldEditor cqi_server_port; |
|
90 |
|
|
91 |
/** The cqi_server_path_to_init_file. */ |
|
92 |
private StringFieldEditor cqi_server_user; |
|
93 |
|
|
94 |
/** The cqi_server_additional_options. */ |
|
95 |
private StringFieldEditor cqi_server_password; |
|
96 |
|
|
97 |
/** |
|
98 |
* Instantiates a new cQP preference page. |
|
99 |
*/ |
|
100 |
public CQPPreferencePage() { |
|
101 |
super(); |
|
102 |
} |
|
103 |
|
|
104 |
/** |
|
105 |
* Creates the field editors. Field editors are abstractions of the common |
|
106 |
* GUI blocks needed to manipulate various types of preferences. Each field |
|
107 |
* editor knows how to save and restore itself. |
|
108 |
*/ |
|
109 |
@Override |
|
110 |
public void createFieldEditors() { |
|
111 |
|
|
112 |
cqi_use_network = new BooleanFieldEditor(CQPPreferences.CQI_NETWORK_MODE, |
|
113 |
Messages.CQPPreferencePage_1, |
|
114 |
BooleanFieldEditor.DEFAULT, getFieldEditorParent()); |
|
115 |
cqi_server_path_to_cqplib = new DirectoryFieldEditor( |
|
116 |
CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, Messages.CQPPreferencePage_0, |
|
117 |
getFieldEditorParent()); |
|
118 |
cqi_server_is_remote = new BooleanFieldEditor(CQPPreferences.CQI_SERVER_IS_REMOTE, |
|
119 |
Messages.CQPPreferencePage_10, |
|
120 |
BooleanFieldEditor.DEFAULT, getFieldEditorParent()); |
|
121 |
cqi_server_host = new StringFieldEditor(CQPPreferences.CQI_SERVER_HOST, |
|
122 |
Messages.CQPPreferencePage_11, getFieldEditorParent()); |
|
123 |
|
|
124 |
cqi_server_port = new IntegerFieldEditor(CQPPreferences.CQI_SERVER_PORT, |
|
125 |
Messages.CQPPreferencePage_12, getFieldEditorParent()); |
|
126 |
|
|
127 |
cqi_server_user = new StringFieldEditor(CQPPreferences.CQI_SERVER_LOGIN, |
|
128 |
Messages.CQPPreferencePage_13, getFieldEditorParent()); |
|
129 |
|
|
130 |
cqi_server_password = new StringFieldEditor(CQPPreferences.CQI_SERVER_PASSWORD, |
|
131 |
Messages.CQPPreferencePage_14, getFieldEditorParent()); |
|
132 |
|
|
133 |
cqi_server_path_to_executable = new FileFieldEditor( |
|
134 |
CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, Messages.CQPPreferencePage_15, |
|
135 |
getFieldEditorParent()); |
|
136 |
|
|
137 |
// cqi_server_path_to_registry = new DirectoryFieldEditor( |
|
138 |
// CQI_SERVER_PATH_TO_REGISTRY, Messages.CQPPreferencePage_16, |
|
139 |
// getFieldEditorParent()); |
|
140 |
cqi_server_path_to_init_file = new FileFieldEditor( |
|
141 |
CQPPreferences.CQI_SERVER_PATH_TO_INIT_FILE, Messages.CQPPreferencePage_17, |
|
142 |
getFieldEditorParent()); |
|
143 |
cqi_server_additional_options = new StringFieldEditor( |
|
144 |
CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, Messages.CQPPreferencePage_18, |
|
145 |
getFieldEditorParent()); |
|
146 |
|
|
147 |
addField(cqi_use_network); |
|
148 |
addField(cqi_server_path_to_cqplib); |
|
149 |
addField(cqi_server_is_remote); |
|
150 |
addField(cqi_server_host); |
|
151 |
addField(cqi_server_port); |
|
152 |
addField(cqi_server_user); |
|
153 |
addField(cqi_server_password); |
|
154 |
addField(cqi_server_path_to_executable); |
|
155 |
// addField(cqi_server_path_to_registry); |
|
156 |
addField(cqi_server_path_to_init_file); |
|
157 |
addField(cqi_server_additional_options); |
|
158 |
|
|
159 |
Preferences preferences = org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE.getNode(Application.PLUGIN_ID); |
|
160 |
boolean useNetwork = preferences.getBoolean( |
|
161 |
CQPPreferences.CQI_NETWORK_MODE, |
|
162 |
false); |
|
163 |
boolean serverIsRemote = preferences.getBoolean( |
|
164 |
CQPPreferences.CQI_SERVER_IS_REMOTE, |
|
165 |
false); |
|
166 |
updateFieldsState(useNetwork, serverIsRemote); |
|
167 |
} |
|
168 |
|
|
169 |
public void updateFieldsState(boolean useNetwork, boolean serverIsRemote) { |
|
170 |
|
|
171 |
//System.out.println("update field state : "+useNetwork+" "+serverIsRemote); |
|
172 |
|
|
173 |
if (useNetwork) { |
|
174 |
if (serverIsRemote) { |
|
175 |
(cqi_server_path_to_cqplib).setEnabled(false, getFieldEditorParent()); |
|
176 |
(cqi_server_is_remote).setEnabled(true, getFieldEditorParent()); |
|
177 |
(cqi_server_host).setEnabled(true, getFieldEditorParent()); |
|
178 |
(cqi_server_port).setEnabled(true, getFieldEditorParent()); |
|
179 |
(cqi_server_user).setEnabled(true, getFieldEditorParent()); |
|
180 |
(cqi_server_password).setEnabled(true, getFieldEditorParent()); |
|
181 |
(cqi_server_path_to_executable).setEnabled(false, getFieldEditorParent()); |
|
182 |
// (cqi_server_path_to_registry).setEnabled(false, getFieldEditorParent()); |
|
183 |
(cqi_server_path_to_init_file).setEnabled(false, getFieldEditorParent()); |
|
184 |
(cqi_server_additional_options).setEnabled(true, getFieldEditorParent()); |
|
185 |
} else { |
|
186 |
//cqi_server_host.loadDefault(); |
|
187 |
(cqi_server_path_to_cqplib).setEnabled(false, getFieldEditorParent()); |
|
188 |
(cqi_server_is_remote).setEnabled(true, getFieldEditorParent()); |
|
189 |
(cqi_server_host).setEnabled(false, getFieldEditorParent()); |
|
190 |
(cqi_server_port).setEnabled(true, getFieldEditorParent()); |
|
191 |
(cqi_server_user).setEnabled(true, getFieldEditorParent()); |
|
192 |
(cqi_server_password).setEnabled(true, getFieldEditorParent()); |
|
193 |
(cqi_server_path_to_executable).setEnabled(true, getFieldEditorParent()); |
|
194 |
// (cqi_server_path_to_registry).setEnabled(true, getFieldEditorParent()); |
|
195 |
(cqi_server_path_to_init_file).setEnabled(true, getFieldEditorParent()); |
|
196 |
(cqi_server_additional_options).setEnabled(true, getFieldEditorParent()); |
|
197 |
} |
|
198 |
} else { |
|
199 |
(cqi_server_path_to_cqplib).setEnabled(true, getFieldEditorParent()); |
|
200 |
(cqi_server_is_remote).setEnabled(false, getFieldEditorParent()); |
|
201 |
(cqi_server_host).setEnabled(false, getFieldEditorParent()); |
|
202 |
(cqi_server_port).setEnabled(false, getFieldEditorParent()); |
|
203 |
(cqi_server_user).setEnabled(false, getFieldEditorParent()); |
|
204 |
(cqi_server_password).setEnabled(false, getFieldEditorParent()); |
|
205 |
(cqi_server_path_to_executable).setEnabled(false, getFieldEditorParent()); |
|
206 |
// (cqi_server_path_to_registry).setEnabled(true, getFieldEditorParent()); |
|
207 |
(cqi_server_path_to_init_file).setEnabled(true, getFieldEditorParent()); |
|
208 |
(cqi_server_additional_options).setEnabled(true, getFieldEditorParent()); |
|
209 |
} |
|
210 |
} |
|
211 |
|
|
212 |
/* |
|
213 |
* (non-Javadoc) |
|
214 |
* |
|
215 |
* @see |
|
216 |
* org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) |
|
217 |
*/ |
|
218 |
@Override |
|
219 |
public void init(IWorkbench workbench) { |
|
220 |
this.setPreferenceStore(new TXMPreferenceStore(CQPPreferences.PREFERENCES_NODE)); |
|
221 |
} |
|
222 |
|
|
223 |
/* (non-Javadoc) |
|
224 |
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
|
225 |
*/ |
|
226 |
@Override |
|
227 |
public void propertyChange(PropertyChangeEvent event) { |
|
228 |
boolean useNetwork = false; |
|
229 |
boolean serverIsRemote = false; |
|
230 |
boolean update = false; |
|
231 |
if (((FieldEditor) event.getSource()).getPreferenceName().equals( |
|
232 |
CQPPreferences.CQI_SERVER_IS_REMOTE)) { |
|
233 |
useNetwork = cqi_use_network.getBooleanValue(); |
|
234 |
serverIsRemote = (Boolean) event.getNewValue(); |
|
235 |
update = true; |
|
236 |
} else if (((FieldEditor) event.getSource()).getPreferenceName().equals( |
|
237 |
CQPPreferences.CQI_NETWORK_MODE)) { |
|
238 |
useNetwork = (Boolean) event.getNewValue(); |
|
239 |
serverIsRemote = cqi_server_is_remote.getBooleanValue(); |
|
240 |
update = true; |
|
241 |
} |
|
242 |
if (update) |
|
243 |
updateFieldsState(useNetwork, serverIsRemote); |
|
244 |
} |
|
245 |
} |
|
0 | 246 |
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java (revision 510) | ||
---|---|---|
19 | 19 |
// auto populate the preference node qualifier from the current bundle id |
20 | 20 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(CooccurrencePreferences.class).getSymbolicName(); |
21 | 21 |
|
22 |
|
|
23 | 22 |
public static final String PREFERENCES_PREFIX = "cooccurrence_"; //$NON-NLS-1$ |
24 | 23 |
|
25 | 24 |
/** The Constant SCOREFORMAT. */ |
tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/preferences/TextsBalancePreferences.java (revision 510) | ||
---|---|---|
16 | 16 |
|
17 | 17 |
// auto populate the preference node qualifier from the current bundle id |
18 | 18 |
public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(TextsBalancePreferences.class).getSymbolicName(); |
19 |
|
|
20 | 19 |
|
21 | 20 |
public static final String PREFERENCES_PREFIX = "texts_balance_"; //$NON-NLS-1$ |
22 | 21 |
|
... | ... | |
27 | 26 |
public static final String STRUCTURAL_UNIT = PREFERENCES_PREFIX + "structural_unit"; //$NON-NLS-1$ |
28 | 27 |
public static final String STRUCTURAL_UNIT_PROPERTY_INDEX = PREFERENCES_PREFIX + "structural_unit_property_index"; //$NON-NLS-1$ |
29 | 28 |
|
30 |
|
|
31 |
public TextsBalancePreferences() { |
|
32 |
// TODO Auto-generated constructor stub |
|
33 |
} |
|
34 |
|
|
35 | 29 |
@Override |
36 | 30 |
public void initializeDefaultPreferences() { |
37 | 31 |
|
... | ... | |
42 | 36 |
preferences.put(STRUCTURAL_UNIT, "text"); |
43 | 37 |
preferences.putInt(STRUCTURAL_UNIT_PROPERTY_INDEX, 0); |
44 | 38 |
|
45 |
|
|
46 | 39 |
// shared charts rendering preferences |
47 | 40 |
ChartsEnginePreferences.initializeChartsEngineSharedPreferences(preferences); |
48 | 41 |
|
Formats disponibles : Unified diff