Révision 88

tmp/org.txm.synopticeditor.feature/.project (revision 88)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.txm.synopticeditor.feature</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.pde.FeatureBuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
	</buildSpec>
14
	<natures>
15
		<nature>org.eclipse.pde.FeatureNature</nature>
16
	</natures>
17
</projectDescription>
0 18

  
tmp/org.txm.synopticeditor.feature/build.properties (revision 88)
1
bin.includes = feature.xml
0 2

  
tmp/org.txm.synopticeditor.feature/feature.xml (revision 88)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<feature
3
      id="SynopticEditor.feature"
4
      label="Edition"
5
      version="1.0.0.qualifier"
6
      provider-name="Textometrie.org">
7

  
8
   <description url="http://www.example.com/description">
9
      Edition editor for multi-edition corpora
10
   </description>
11

  
12
   <copyright url="http://www.example.com/copyright">
13
      TXM 0.7.8 BETA
14
Copyright © 2013-2016 ENS de Lyon, University of Franche-Comté.
15
Copyright © 2010-2013 ENS de Lyon.
16
Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
17
Lyon 2, University of Franche-Comté, University of Nice
18
Sophia Antipolis, University of Paris 3.
19
The TXM platform is free software: you can redistribute it
20
and/or modify it under the terms of the GNU General Public
21
License as published by the Free Software Foundation,
22
either version 2 of the License, or (at your option) any
23
later version.
24
The TXM platform is distributed in the hope that it will be
25
useful, but WITHOUT ANY WARRANTY; without even the implied
26
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
27
PURPOSE. See the GNU General Public License for more
28
details.
29
You should have received a copy of the GNU General
30
Public License along with the TXM platform. If not, see
31
http://www.gnu.org/licenses
32
   </copyright>
33

  
34
   <license url="">
35
      &lt;TXM Software User Agreement&gt;
36

  
37
TXM 0.7.8 Copyright © 2010-2016 ENS de Lyon, University of Franche-Comté, CNRS
38

  
39
&lt;English version below&gt;
40

  
41
EN ACCEPTANT CETTE MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L&apos;ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D&apos;ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.
42

  
43
Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.
44

  
45
Le logiciel TXM est distribué dans l&apos;espoir qu&apos;il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.
46

  
47
Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n&apos;est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html.
48
_______________
49
* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.
50
TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.
51
Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. &lt;halshs-00549779&gt;
52

  
53

  
54
ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH
55

  
56

  
57
By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.
58

  
59
The TXM platform is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
60

  
61
The TXM platform is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
62

  
63
You should have received a copy of the GNU General Public License along with the TXM platform. If not, see http://www.gnu.org/licenses/gpl-2.0.html.
64
_______________
65
** Serge Heiden. The TXM Platform: Building Open-Source Textual
66
Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. &lt;halshs-00549764&gt;
67
   </license>
68

  
69
   <requires>
70
      <import plugin="org.eclipse.ui"/>
71
      <import plugin="org.eclipse.core.runtime"/>
72
      <import plugin="org.txm.rcp" version="0.7.5" match="greaterOrEqual"/>
73
      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
74
      <import plugin="org.eclipse.ui.browser" version="3.4.100" match="greaterOrEqual"/>
75
   </requires>
76

  
77
   <plugin
78
         id="SynopticEditorRCP"
79
         download-size="0"
80
         install-size="0"
81
         version="0.0.0"
82
         unpack="false"/>
83

  
84
</feature>
0 85

  
tmp/org.txm.wordcloud.rcp/plugin.xml (revision 88)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.4"?>
3
<plugin>
4

  
5
   <extension
6
         id="application"
7
         point="org.eclipse.core.runtime.applications">
8
      <application>
9
         <run
10
               class="___wordcloudrcp.Application">
11
         </run>
12
      </application>
13
   </extension>
14
   <extension
15
         point="org.eclipse.ui.perspectives">
16
      <perspective
17
            name="%perspective.name"
18
            class="___wordcloudrcp.Perspective"
19
            id="WordCloudRCP.perspective">
20
      </perspective>
21
   </extension>
22
   <extension
23
         point="org.eclipse.ui.commands">
24
      <command
25
            categoryId="org.txm.rcpapplication.category.txm"
26
            defaultHandler="org.txm.wordcloud.rcp.handlers.ComputeWordCloud"
27
            id="ComputeWordCloud"
28
            name="%command.name">
29
      </command>
30
   </extension>
31
   <extension
32
         point="org.eclipse.ui.menus">
33
      <menuContribution
34
            allPopups="false"
35
            locationURI="toolbar:org.txm.rcpapplication.toolbartools">
36
         <command
37
               commandId="ComputeWordCloud"
38
               icon="icons/functions/wordcloud.png"
39
               style="push">
40
            <visibleWhen
41
                  checkEnabled="false">
42
               <or>
43
                  <reference
44
                        definitionId="OneLexiconSelected">
45
                  </reference>
46
                  <reference
47
                        definitionId="OneIndexSelected">
48
                  </reference>
49
                  <reference
50
                        definitionId="OneCorpusSelected">
51
                  </reference>
52
               </or>
53
            </visibleWhen>
54
         </command>
55
      </menuContribution>
56
      <menuContribution
57
            allPopups="false"
58
            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
59
         <command
60
               commandId="ComputeWordCloud"
61
               icon="icons/functions/wordcloud.png"
62
               style="push">
63
            <visibleWhen
64
                  checkEnabled="false">
65
               <or>
66
                  <reference
67
                        definitionId="OneLexiconSelected">
68
                  </reference>
69
                  <reference
70
                        definitionId="OneIndexSelected">
71
                  </reference>
72
                  <reference
73
                        definitionId="OneCorpusSelected">
74
                  </reference>
75
               </or>
76
            </visibleWhen>
77
         </command>
78
      </menuContribution>
79
      <menuContribution
80
            locationURI="menu:menu.tools">
81
         <command
82
               commandId="ComputeWordCloud"
83
               icon="icons/functions/wordcloud.png"
84
               style="push">
85
            <visibleWhen
86
                  checkEnabled="false">
87
               <or>
88
                  <reference
89
                        definitionId="OneLexiconSelected">
90
                  </reference>
91
                  <reference
92
                        definitionId="OneIndexSelected">
93
                  </reference>
94
                  <reference
95
                        definitionId="OneCorpusSelected">
96
                  </reference>
97
               </or>
98
            </visibleWhen>
99
         </command>
100
      </menuContribution>
101
      <menuContribution
102
            locationURI="menu:menu.help.plugins">
103
         <command
104
               commandId="org.txm.rcpapplication.commands.OpenBrowser"
105
               icon="icons/functions/wordcloud.png"
106
               label="%command.name"
107
               style="push">
108
            <parameter
109
                  name="org.txm.rcpapplication.commands.commandParameter2"
110
                  value="https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud">
111
            </parameter>
112
         </command>
113
      </menuContribution>
114
   </extension>
115
   <extension
116
         point="org.eclipse.ui.editors">
117
      <editor
118
            class="org.txm.wordcloud.rcp.editors.WordCloudEditor"
119
            default="false"
120
            icon="icons/functions/wordcloud.png"
121
            id="org.txm.wordcloud.core.functions.WordCloud"
122
            name="%editor.name">
123
      </editor>
124
   </extension>
125
   <extension
126
         point="org.eclipse.core.runtime.adapters">
127
      <factory
128
            adaptableType="org.txm.wordcloud.core.functions.WordCloud"
129
            class="org.txm.wordcloud.rcp.adapters.WordCloudAdapterFactory">
130
         <adapter
131
               type="org.eclipse.ui.model.IWorkbenchAdapter">
132
         </adapter>
133
      </factory>
134
   </extension>
135
   <extension
136
         point="org.eclipse.ui.preferencePages">
137
      <page
138
            category="org.txm.rcpapplication.preferences.UserPreferencePage"
139
            class="org.txm.wordcloud.rcp.preferences.WordCloudPreferencePage"
140
            id="org.txm.wordcloud.rcp.preferences.WordCloudPreferencePage"
141
            name="%page.name">
142
      </page>
143
   </extension>
144
   <extension
145
         point="org.eclipse.core.expressions.definitions">
146
      <definition
147
            id="OneWordCloudSelected">
148
         <with
149
               variable="selection">
150
            <iterate
151
                  ifEmpty="false"
152
                  operator="and">
153
               <instanceof
154
                     value="org.txm.wordcloud.core.functions.WordCloud">
155
               </instanceof>
156
            </iterate>
157
         </with>
158
      </definition>
159
   </extension>
160
</plugin>
0 161

  
tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.jdt.core.prefs (revision 88)
1
eclipse.preferences.version=1
2
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4
org.eclipse.jdt.core.compiler.compliance=1.6
5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7
org.eclipse.jdt.core.compiler.source=1.6
0 8

  
tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.core.resources.prefs (revision 88)
1
eclipse.preferences.version=1
2
encoding//OSGI-INF/l10n/bundle.properties=UTF-8
0 3

  
tmp/org.txm.wordcloud.rcp/.classpath (revision 88)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5
	<classpathentry kind="src" path="src"/>
6
	<classpathentry kind="src" path="OSGI-INF"/>
7
	<classpathentry kind="output" path="bin"/>
8
</classpath>
0 9

  
tmp/org.txm.wordcloud.rcp/META-INF/MANIFEST.MF (revision 88)
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
3
Bundle-Name: WordCloud RCP
4
Bundle-SymbolicName: org.txm.wordcloud.rcp;singleton:=true
5
Bundle-Version: 1.0.0.qualifier
6
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
7
Require-Bundle: org.txm.wordcloud.core;bundle-version="1.0.0",
8
 org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0",
9
 org.txm.chartsengine.r.core;bundle-version="1.0.0",
10
 org.txm.chartsengine.rcp,
11
 org.eclipse.core.runtime;bundle-version="3.10.0",
12
 org.eclipse.ui;bundle-version="3.106.1",
13
 org.txm.core;bundle-version="0.7.0",
14
 org.txm.rcp;bundle-version="0.7.8"
15
Bundle-Vendor: TXM
0 16

  
tmp/org.txm.wordcloud.rcp/.project (revision 88)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.txm.wordcloud.rcp</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.pde.ManifestBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.pde.SchemaBuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
	</buildSpec>
24
	<natures>
25
		<nature>org.eclipse.pde.PluginNature</nature>
26
		<nature>org.eclipse.jdt.core.javanature</nature>
27
	</natures>
28
</projectDescription>
0 29

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationActionBarAdvisor.java (revision 88)
1
package ___wordcloudrcp;
2

  
3
import org.eclipse.jface.action.IMenuManager;
4
import org.eclipse.ui.IWorkbenchWindow;
5
import org.eclipse.ui.application.ActionBarAdvisor;
6
import org.eclipse.ui.application.IActionBarConfigurer;
7

  
8
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
9

  
10
    public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
11
        super(configurer);
12
    }
13

  
14
    protected void makeActions(IWorkbenchWindow window) {
15
    }
16

  
17
    protected void fillMenuBar(IMenuManager menuBar) {
18
    }
19
    
20
}
0 21

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchAdvisor.java (revision 88)
1
package ___wordcloudrcp;
2

  
3
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
4
import org.eclipse.ui.application.WorkbenchAdvisor;
5
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
6

  
7
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
8

  
9
	private static final String PERSPECTIVE_ID = "WordCloudRCP.perspective"; //$NON-NLS-1$
10

  
11
    public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
12
        return new ApplicationWorkbenchWindowAdvisor(configurer);
13
    }
14

  
15
	public String getInitialWindowPerspectiveId() {
16
		return PERSPECTIVE_ID;
17
	}
18
}
0 19

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages.properties (revision 88)
1
WordCloudTitle=WordCloud
2
ComputeVocabulary_0=Opening WordCloud results
3
ComputeWordCloud_0=StatEngine is not ready. Canceling command.
4
ComputeWordCloud_11=The necessary R packages have not been installed properly, it is not possible to complete the installation of the WordCloud command.\nSee instructions at https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud 
5
ComputeWordCloud_12=Aborting WordCloud.
6
ComputeWordCloud_2=R packages loaded. Now running WordCloud
7
ComputeWordCloud_3=The {0} R package was not installed. Reason: {1}
8
ComputeWordCloud_4=Installing {0} R package...
9
ComputeWordCloud_5=Loading package: 
10
ComputeWordCloud_6=Could not install the {0} package
11
ComputeWordCloud_7=Operation canceled by user
12
WordCloudEditor_0=Vmax: 
13
WordCloudEditor_1=Fmin: 
14
WordCloudEditor_2=% of rotated labels: 
15
WordCloudEditor_3=Randomize positions
16
WordCloudEditor_4=Draw
17
WordCloudEditor_5=Wrong WordCloud input object
18
WordCloudEditor_6=WordCloud ready: 
19
WordCloudEditor_7=WordClouding...
20
WordCloudEditor_8=Drawing in {0}
21
WordCloudEditor_9=WordCloud refreshed
22
WordCloudPreferencePage_0=Number of used words
23
WordCloudPreferencePage_1=Minimal frequency for used words
24
WordCloudPreferencePage_2=Percent of rotated words
25
WordCloudPreferencePage_3=Random word positions
0 26

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Application.java (revision 88)
1
package ___wordcloudrcp;
2

  
3
import org.eclipse.equinox.app.IApplication;
4
import org.eclipse.equinox.app.IApplicationContext;
5
import org.eclipse.swt.widgets.Display;
6
import org.eclipse.ui.IWorkbench;
7
import org.eclipse.ui.PlatformUI;
8

  
9
/**
10
 * This class controls all aspects of the application's execution
11
 */
12
public class Application implements IApplication {
13
	
14
	public static String PLUGIN_ID = "WordCloudRCP"; //$NON-NLS-1$
15

  
16
	/* (non-Javadoc)
17
	 * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
18
	 */
19
	public Object start(IApplicationContext context) throws Exception {
20
		Display display = PlatformUI.createDisplay();
21
		try {
22
			int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
23
			if (returnCode == PlatformUI.RETURN_RESTART)
24
				return IApplication.EXIT_RESTART;
25
			else
26
				return IApplication.EXIT_OK;
27
		} finally {
28
			display.dispose();
29
		}
30
	}
31

  
32
	/* (non-Javadoc)
33
	 * @see org.eclipse.equinox.app.IApplication#stop()
34
	 */
35
	public void stop() {
36
		if (!PlatformUI.isWorkbenchRunning())
37
			return;
38
		final IWorkbench workbench = PlatformUI.getWorkbench();
39
		final Display display = workbench.getDisplay();
40
		display.syncExec(new Runnable() {
41
			public void run() {
42
				if (!display.isDisposed())
43
					workbench.close();
44
			}
45
		});
46
	}
47
}
0 48

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/___Messages.java (revision 88)
1
package ___wordcloudrcp;
2

  
3
import org.eclipse.osgi.util.NLS;
4

  
5
public class ___Messages extends NLS {
6
	private static final String BUNDLE_NAME = "wordcloudrcp.messages"; //$NON-NLS-1$
7
	public static String WordCloudTitle;
8
	public static String ComputeIndex_0;
9
	public static String ComputeWordCloud_0;
10
	public static String ComputeWordCloud_11;
11
	public static String ComputeWordCloud_12;
12
	public static String ComputeWordCloud_2;
13
	public static String ComputeWordCloud_3;
14
	public static String ComputeWordCloud_4;
15
	public static String ComputeWordCloud_5;
16
	public static String ComputeWordCloud_6;
17
	public static String ComputeWordCloud_7;
18
	public static String WordCloudEditor_0;
19
	public static String WordCloudEditor_1;
20
	public static String WordCloudEditor_2;
21
	public static String WordCloudEditor_3;
22
	public static String WordCloudEditor_4;
23
	public static String WordCloudEditor_5;
24
	public static String WordCloudEditor_6;
25
	public static String WordCloudEditor_7;
26
	public static String WordCloudEditor_8;
27
	public static String WordCloudEditor_9;
28
	public static String WordCloudPreferencePage_0;
29
	public static String WordCloudPreferencePage_1;
30
	public static String WordCloudPreferencePage_2;
31
	public static String WordCloudPreferencePage_3;
32
	static {
33
		// initialize resource bundle
34
		NLS.initializeMessages(BUNDLE_NAME, ___Messages.class);
35
	}
36

  
37
	private ___Messages() {
38
	}
39
}
0 40

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchWindowAdvisor.java (revision 88)
1
package ___wordcloudrcp;
2

  
3
import org.eclipse.swt.graphics.Point;
4
import org.eclipse.ui.application.ActionBarAdvisor;
5
import org.eclipse.ui.application.IActionBarConfigurer;
6
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
7
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
8

  
9
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
10

  
11
    public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
12
        super(configurer);
13
    }
14

  
15
    public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
16
        return new ApplicationActionBarAdvisor(configurer);
17
    }
18
    
19
    public void preWindowOpen() {
20
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
21
        configurer.setInitialSize(new Point(400, 300));
22
        configurer.setShowCoolBar(false);
23
        configurer.setShowStatusLine(false);
24
        configurer.setTitle("Hello RCP"); //$NON-NLS-1$
25
    }
26
}
0 27

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Perspective.java (revision 88)
1
package ___wordcloudrcp;
2

  
3
import org.eclipse.ui.IPageLayout;
4
import org.eclipse.ui.IPerspectiveFactory;
5

  
6
public class Perspective implements IPerspectiveFactory {
7

  
8
	public void createInitialLayout(IPageLayout layout) {
9
	}
10
}
0 11

  
tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages_fr.properties (revision 88)
1
WordCloudTitle=Nuage de mot
2
ComputeVocabulary_0=Ouverture du r?sultat
3
ComputeWordCloud_0=Le moteur de statistique n'est pas pr?t. Abandon.
4
ComputeWordCloud_11=Les packages n?c?ssaires au fonctionnement de la fonctionnalit? n'ont pas pu ?tre install?s. Voir les instructions pour installation manuelle ? l'adresse https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud
5
ComputeWordCloud_12=Abandon du calcul.
6
ComputeWordCloud_2=Les packages R ont ?t? charg?s. Lancement du calcul.
7
ComputeWordCloud_3=Le package R {0} n'a pas pu ?tre install?. Raison : {1} 
8
ComputeWordCloud_4=Installation du package R {0}...
9
ComputeWordCloud_5=Chargement du package : 
10
ComputeWordCloud_6=Echec de l'installation du package {0}.
11
ComputeWordCloud_7=Annulation par l'utilisateur.
12
WordCloudEditor_0=Vmax : 
13
WordCloudEditor_1=Fmin : 
14
WordCloudEditor_2=% de labels verticaux : 
15
WordCloudEditor_3=Position al?atoire
16
WordCloudEditor_4=Calculer
17
WordCloudEditor_5=Object non-compatible avec la fonctionnalit? Nuage de mot
18
WordCloudEditor_6=WordCloud est pr?t : 
19
WordCloudEditor_7=Dessin en cours...
20
WordCloudEditor_8=Sauvegarde dans le fichier {0} 
21
WordCloudEditor_9=Rafra?chissement 
22
WordCloudPreferencePage_0=Filtre en nombre de mot ? utiliser
23
WordCloudPreferencePage_1=Filtre en fr?quence minimal des mots ? utiliser frequency
24
WordCloudPreferencePage_2=Pourcentage de mot verticaux
25
WordCloudPreferencePage_3=Position al?atoire des mots
0 26

  
tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/messages/Messages.java (revision 88)
1
package org.txm.wordcloud.rcp.messages;
2

  
3
import org.eclipse.osgi.util.NLS;
4

  
5
public class Messages extends NLS {
6
	
7

  
8
	//private static final String BUNDLE_NAME = "org.txm.rcp.wordcloud.messages.messages"; //$NON-NLS-1$
9
	// FIXME: use the same properties file than the bundle	
10
	private static final String BUNDLE_NAME = "l10n.bundle"; //$NON-NLS-1$
11
	
12
	
13
	
14
	public static String EditorName;
15
	public static String EditorToolBar_vmin;
16
	public static String EditorToolBar_fmin;
17
	public static String EditorToolBar_Percent_of_rotated_labels;
18
	public static String EditorToolBar_Randomize_positions;
19
	public static String EditorToolBar_Draw;
20
	public static String Log_Wrong_input_object;
21
	public static String Log_WordCloud_ready;
22
	public static String WordCloudEditor_7;
23
	public static String WordCloudEditor_8;
24
	public static String WordCloudEditor_9;
25
	public static String PreferencePage_Number_of_used_words;
26
	public static String PreferencePage_Minimal_frequency;
27
	public static String PreferencePage_Percent_of_rotated_words;
28
	public static String PreferencePage_Random_word_positions;
29
	static {
30
		// initialize resource bundle
31
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
32
	}
33

  
34
	private Messages() {
35
	}
36
}
0 37

  
tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditor.java (revision 88)
1
package org.txm.wordcloud.rcp.editors;
2

  
3
import org.eclipse.core.runtime.IProgressMonitor;
4
import org.eclipse.core.runtime.IStatus;
5
import org.eclipse.core.runtime.Status;
6
import org.eclipse.core.runtime.jobs.Job;
7
import org.eclipse.swt.SWT;
8
import org.eclipse.swt.events.SelectionEvent;
9
import org.eclipse.swt.events.SelectionListener;
10
import org.eclipse.swt.widgets.Button;
11
import org.eclipse.swt.widgets.Composite;
12
import org.eclipse.swt.widgets.Label;
13
import org.eclipse.swt.widgets.Spinner;
14
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
15
import org.txm.chartsengine.rcp.editors.ChartEditorInput;
16
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
17
import org.txm.core.preferences.TXMPreferences;
18
import org.txm.rcpapplication.views.CorporaView;
19
import org.txm.utils.logger.Log;
20
import org.txm.wordcloud.core.functions.WordCloud;
21
import org.txm.wordcloud.core.preferences.WordCloudPreferences;
22
import org.txm.wordcloud.rcp.messages.Messages;
23

  
24
/**
25
 * Word cloud editor. 
26
 * @author mdecorde
27
 * @author sjacquot
28
 *
29
 */
30
public class WordCloudEditor extends ChartEditorPart {
31
	
32
	
33
	/**
34
	 * 
35
	 */
36
	public WordCloudEditor() {
37
	}
38

  
39
	
40
	
41
	/**
42
	 * 
43
	 * @param swtComponentsProvider
44
	 * @param chartEditorInput
45
	 */
46
	public WordCloudEditor(SWTChartsComponentsProvider swtComponentsProvider, ChartEditorInput chartEditorInput) {
47
		super(swtComponentsProvider, chartEditorInput);
48
	}
49
	
50
	
51
	@Override
52
	public void createPartControl(Composite parent) {
53
		super.createPartControl(parent);
54
		
55
		//Composite paramPanel = new Composite(parent, SWT.NONE);
56
		
57
//		FormData fdata = new FormData();
58
//		fdata.top = new FormAttachment(0);
59
//		fdata.left = new FormAttachment(0);
60
//		fdata.right = new FormAttachment(100);
61
//		this.getParametersComposite().setLayoutData(fdata);
62

  
63
//		FormData fdata = new FormData();
64
//		fdata.top = new FormAttachment(this.getParametersComposite());
65
//		fdata.left = new FormAttachment(0);
66
//		fdata.right = new FormAttachment(100);
67
//		fdata.bottom = new FormAttachment(100);
68

  
69
		// fill param Area
70
//		RowLayout layout = new RowLayout();
71
//		layout.wrap = true;
72
//		layout.center = true;
73
//		this.getParametersComposite().setLayout(layout);
74

  
75
		// max words
76
		new Label(this.getParametersGroup(), SWT.NONE).setText(Messages.EditorToolBar_vmin);
77
		final Spinner maxWordsSpinner = new Spinner(this.getParametersGroup(), SWT.BORDER);
78
		maxWordsSpinner.setMinimum(10);
79
		maxWordsSpinner.setIncrement(1);
80
		maxWordsSpinner.setMaximum(100000);
81
		maxWordsSpinner.setSelection(TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.MAX_WORDS));
82
		
83
		// fmin
84
		new Label(this.getParametersGroup(), SWT.NONE).setText(Messages.EditorToolBar_fmin);
85
		final Spinner minFreqSpinner = new Spinner(this.getParametersGroup(), SWT.BORDER);
86
		minFreqSpinner.setMinimum(1);
87
		minFreqSpinner.setIncrement(1);
88
		minFreqSpinner.setMaximum(100000000);
89
		minFreqSpinner.setSelection(TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.FMIN));
90
		
91
		// rotation percent
92
		new Label(this.getParametersGroup(), SWT.NONE).setText(Messages.EditorToolBar_Percent_of_rotated_labels);
93
		final Spinner rotPerSpinner = new Spinner(this.getParametersGroup(), SWT.BORDER);
94
		rotPerSpinner.setMinimum(0);
95
		rotPerSpinner.setIncrement(1);
96
		rotPerSpinner.setMaximum(100);
97
		rotPerSpinner.setSelection(TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.ROT));
98
		
99
		// random positions
100
		final Button randomOrderButton = new Button(this.getParametersGroup(), SWT.CHECK);
101
		randomOrderButton.setText(Messages.EditorToolBar_Randomize_positions);
102
		randomOrderButton.setSelection(TXMPreferences.getBoolean(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.RANDOM_POSITION));
103

  
104
		
105
		// compute button
106
		Button okButton = new Button(this.getParametersGroup(), SWT.PUSH);
107
		okButton.setText(Messages.EditorToolBar_Draw);
108
		okButton.addSelectionListener(new SelectionListener() {
109
			@Override
110
			public void widgetSelected(SelectionEvent e) {
111
					
112
					// persistence
113
					TXMPreferences.putLocalInt(getResultData(), WordCloudPreferences.MAX_WORDS, maxWordsSpinner.getSelection());
114
					TXMPreferences.putLocalInt(getResultData(), WordCloudPreferences.FMIN, minFreqSpinner.getSelection());
115
					TXMPreferences.putLocalFloat(getResultData(), WordCloudPreferences.ROT, rotPerSpinner.getSelection());
116
					TXMPreferences.putLocalBoolean(getResultData(), WordCloudPreferences.RANDOM_POSITION, randomOrderButton.getSelection());
117
					
118

  
119
					compute(true);
120
			}
121
					
122
					
123
			
124
			
125
			@Override
126
			public void widgetDefaultSelected(SelectionEvent e) { }
127
		});
128

  
129
		
130
		this.compute(false);
131
		Log.info(Messages.Log_WordCloud_ready + this.getResultData());
132

  
133
	}
134

  
135
	
136
	/**
137
	 * Computes.
138
	 */
139
	public void compute(final boolean update) {
140

  
141
		Job job = new Job("Compute Word Cloud") {
142

  
143
		    @Override
144
		    protected IStatus run(IProgressMonitor monitor) {
145

  
146
		    	// creating
147
				monitor.beginTask("Computing", IProgressMonitor.UNKNOWN);
148
		    	
149
				if(update)	{
150
					updateChart();
151
				}
152
				else	{
153
					createChart();
154
				}
155

  
156
				// cancel
157
				if(monitor.isCanceled())	{
158
					close();
159
					return Status.CANCEL_STATUS;
160
				}
161
				
162
				// loading
163
				monitor.setTaskName("Loading");
164
				loadChart();
165
				
166
				
167
				setPartName(((WordCloud)getResultData()).getCorpus().getName() + " - " + ((WordCloud)getResultData()).getName());
168
				
169
				
170
				// FIXME: persistence test, saving local preferences/parameters to file
171
				//WordCloudPreferences.flush((WordCloud)getResultData());
172

  
173
				// refreshes the view to update the node label
174
				getSite().getShell().getDisplay().syncExec(new Runnable() {
175
					@Override
176
					public void run() {
177
						CorporaView.refresh();
178
					}
179
				});
180

  
181
				
182
				// done
183
				monitor.done(); 
184
				return Status.OK_STATUS;
185
	    }
186

  
187
		};
188
		job.setUser(true); // show progress bar, without that the progress is located to bottom right
189
		job.schedule();
190
	}
191
	
192

  
193
	/* (non-Javadoc)
194
	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
195
	 */
196
	@Override
197
	public void doSave(IProgressMonitor monitor) { }
198

  
199
	/* (non-Javadoc)
200
	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
201
	 */
202
	@Override
203
	public void doSaveAs() { }
204

  
205
	/* (non-Javadoc)
206
	 * @see org.eclipse.ui.part.EditorPart#isDirty()
207
	 */
208
	@Override
209
	public boolean isDirty() {
210
		// TODO Auto-generated method stub
211
		return false;
212
	}
213

  
214
	/* (non-Javadoc)
215
	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
216
	 */
217
	@Override
218
	public boolean isSaveAsAllowed() {
219
		// TODO Auto-generated method stub
220
		return false;
221
	}
222

  
223
	
224

  
225
}
0 226

  
tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditorInput.java (revision 88)
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.wordcloud.rcp.editors;
29

  
30
import org.eclipse.jface.resource.ImageDescriptor;
31
import org.eclipse.ui.IPersistableElement;
32
import org.eclipse.ui.plugin.AbstractUIPlugin;
33
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
34
import org.txm.chartsengine.rcp.editors.ChartEditorInput;
35
import org.txm.rcpapplication.Application;
36
import org.txm.rcpapplication.IImageKeys;
37
import org.txm.wordcloud.core.functions.WordCloud;
38
import org.txm.wordcloud.core.preferences.WordCloudPreferences;
39
import org.txm.wordcloud.rcp.messages.Messages;
40

  
41

  
42
/**
43
 *
44
 *
45
 * @author sloiseau
46
 */
47
public class WordCloudEditorInput extends ChartEditorInput {
48
	
49
		
50
	/**
51
	 * 
52
	 * @param src
53
	 * @param wc
54
	 */
55
	public WordCloudEditorInput(Object src, WordCloud wc) {
56
		super(wc, WordCloudPreferences.PREFERENCES_NODE);
57
	}
58
	
59
	/**
60
	 * Exists.
61
	 *
62
	 * @return true, if successful
63
	 * @see org.eclipse.ui.IEditorInput#exists()
64
	 */
65
	@Override
66
	public boolean exists() {
67
		return false;
68
	}
69

  
70
	/**
71
	 * Gets the image descriptor.
72
	 *
73
	 * @return the image descriptor
74
	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
75
	 */
76
	@Override
77
	public ImageDescriptor getImageDescriptor() {
78
		return AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, IImageKeys.ACTION_WORDCLOUD);
79
	}
80

  
81
	/**
82
	 * Gets the name.
83
	 *
84
	 * @return the name
85
	 * @see org.eclipse.ui.IEditorInput#getName()
86
	 */
87
	@Override
88
	public String getName() {
89
		return Messages.EditorName;
90
	}
91

  
92
	/**
93
	 * Gets the persistable.
94
	 *
95
	 * @return the persistable
96
	 * @see org.eclipse.ui.IEditorInput#getPersistable()
97
	 */
98
	@Override
99
	public IPersistableElement getPersistable() {
100
		return null;
101
	}
102

  
103
	/**
104
	 * Gets the tool tip text.
105
	 *
106
	 * @return the tool tip text
107
	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
108
	 */
109
	@Override
110
	public String getToolTipText() {
111
		return getName();
112
	}
113

  
114
	/**
115
	 * Gets the adapter.
116
	 *
117
	 * @param arg0 the arg0
118
	 * @return the adapter
119
	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
120
	 */
121
	@Override
122
	@SuppressWarnings("unchecked") //$NON-NLS-1$
123
	public Object getAdapter(Class arg0) {
124
		return null;
125
	}
126

  
127

  
128
}
129

  
0 130

  
tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/handlers/ComputeWordCloud.java (revision 88)
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.wordcloud.rcp.handlers;
29

  
30
import java.io.IOException;
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.jface.viewers.IStructuredSelection;
36
import org.eclipse.ui.handlers.HandlerUtil;
37
import org.txm.Toolbox;
38
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
39
import org.txm.functions.index.Index;
40
import org.txm.rcpapplication.StatusLine;
41
import org.txm.rcpapplication.commands.OpenBrowser;
42
import org.txm.rcpapplication.views.CorporaView;
43
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
44
import org.txm.searchengine.cqp.corpus.Corpus;
45
import org.txm.searchengine.cqp.corpus.Lexicon;
46
import org.txm.searchengine.cqp.serverException.CqiServerError;
47
import org.txm.utils.logger.Log;
48
import org.txm.wordcloud.core.functions.WordCloud;
49
import org.txm.wordcloud.core.messages.TBXWordCloudMessages;
50
import org.txm.wordcloud.rcp.editors.WordCloudEditorInput;
51

  
52
// TODO: Auto-generated Javadoc
53
/**
54
 * open the WordCloud Editor 
55
 * @author mdecorde
56
 * @author sjacquot
57
 */
58
public class ComputeWordCloud extends AbstractHandler {
59
	
60

  
61
	// FIXME: should be put in an Activator? or better in an extension point loaded by the corpora view?
62
	// adds a double click listener to the Corpus View
63
	static	{
64
		CorporaView.addDoubleClickListener(WordCloud.class, "ComputeWordCloud"); //$NON-NLS-1$
65
	}
66
	
67
	
68

  
69

  
70
	/* (non-Javadoc)
71
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
72
	 */
73
	@Override
74
	public Object execute(final ExecutionEvent event) throws ExecutionException {
75
		if (!Toolbox.isStatEngineInitialized()) {
76
			System.out.println(TBXWordCloudMessages.Log_Stats_Engine_not_ready);
77
			return null;
78
		};
79

  
80
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
81
		Object s = selection.getFirstElement();
82
		
83
		boolean newResult = true;
84
		Corpus corpus = null;
85
		WordCloud wordCloud = null;
86
		
87
		// opens existing result
88
		if (s instanceof WordCloud) {
89
			wordCloud = (WordCloud) s;
90
			corpus = wordCloud.getCorpus();
91
			newResult = false;
92
		}
93
		else	{
94
				// Inits R packages
95
				if(!WordCloud.initPackages())	{
96
					OpenBrowser.openfile("https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud"); //$NON-NLS-1$
97
					//return Status.CANCEL_STATUS;
98
				}
99

  
100
				// creates new result
101
				if (s instanceof Corpus) {
102
					try {
103
						corpus = (Corpus)s;
104
						wordCloud = new WordCloud(corpus);
105
					}
106
					catch (CqiClientException e) {
107
						Log.printStackTrace(e);
108
						//return null;
109
					}
110
					catch(IOException e) {
111
						// TODO Auto-generated catch block
112
						e.printStackTrace();
113
					}
114
					catch(CqiServerError e) {
115
						// TODO Auto-generated catch block
116
						e.printStackTrace();
117
					}
118
				}
119
				// creates new result
120
				else if (s instanceof Index) {
121
					wordCloud = new WordCloud((Index)s);
122
					corpus = ((Index)s).getCorpus();
123
				}
124
				// creates new result
125
				else if (s instanceof Lexicon) {
126
					wordCloud = new WordCloud((Lexicon)s);
127
					corpus = ((Lexicon)s).getCorpus();
128
				}
129
			}
130
		
131
			if(wordCloud != null)	{
132
				StatusLine.setMessage(TBXWordCloudMessages.StatusBar_Opening_result);
133

  
134
				WordCloudEditorInput editorInput = new WordCloudEditorInput(s, wordCloud);
135
				SWTChartsComponentsProvider.getCurrent().openEditor(editorInput);
136
				
137
				if(newResult && corpus != null)	{
138
					CorporaView.storeResult(corpus, wordCloud);
139
				}
140
			}
141
							
142
		return null;
143
	}
144

  
145
//	public static void openEditor(Object obj) {
146
//		if (obj instanceof Index || 
147
//				obj instanceof Lexicon || 
148
//				//obj instanceof QueryIndex || 
149
//				obj instanceof Corpus) {
150
//			IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
151
//			WordCloudEditorInput editorInput = new WordCloudEditorInput(Application.swtComponentProvider2, obj, null);
152
//			try {
153
//				StatusLine.setMessage(TBXWordCloudMessages.StatusBar_Opening_result);
154
//				WordCloudEditor wceditor = (WordCloudEditor) page.openEditor(editorInput,WordCloudEditor.ID); //$NON-NLS-1$
155
//				//voceditor.initializeFields();
156
//			} catch (Exception e) {
157
//				Log.printStackTrace(e);
158
//			}
159
//		}
160
//	}
161
}
0 162

  
tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/preferences/WordCloudPreferencePage.java (revision 88)
1
package org.txm.wordcloud.rcp.preferences;
2

  
3
// Copyright © 2010-2013 ENS de Lyon.
4
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
5
// Lyon 2, University of Franche-Comté, University of Nice
6
// Sophia Antipolis, University of Paris 3.
7
// 
8
// The TXM platform is free software: you can redistribute it
9
// and/or modify it under the terms of the GNU General Public
10
// License as published by the Free Software Foundation,
11
// either version 2 of the License, or (at your option) any
12
// later version.
13
// 
14
// The TXM platform is distributed in the hope that it will be
15
// useful, but WITHOUT ANY WARRANTY; without even the implied
16
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17
// PURPOSE. See the GNU General Public License for more
18
// details.
19
// 
20
// You should have received a copy of the GNU General
21
// Public License along with the TXM platform. If not, see
22
// http://www.gnu.org/licenses.
23
// 
24
// 
25
// 
26
// $LastChangedDate:$
27
// $LastChangedRevision:$
28
// $LastChangedBy:$ 
29
//
30

  
31

  
32
import org.eclipse.jface.preference.BooleanFieldEditor;
33
import org.eclipse.jface.preference.IntegerFieldEditor;
34
import org.eclipse.swt.widgets.Composite;
35
import org.eclipse.ui.IWorkbench;
36
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
37
import org.txm.rcp.preferences.TXMPreferencePage;
38
import org.txm.rcp.preferences.TXMPreferenceStore;
39
import org.txm.wordcloud.core.preferences.WordCloudPreferences;
40
import org.txm.wordcloud.rcp.adapters.WordCloudAdapterFactory;
41
import org.txm.wordcloud.rcp.messages.Messages;
42

  
43
/**
44
 * Word cloud preference page.
45
 * @author mdecorde
46
 * @author sjacquot
47
 *
48
 */
49
public class WordCloudPreferencePage extends TXMPreferencePage {
50

  
51

  
52
	/**
53
	 * The Constant ID.
54
	 */
55
	public static final String ID = "org.txm.wordcloud.rcp.preferences.WordCloudPreferencePage"; //$NON-NLS-1$
56

  
57
	/**
58
	 * Instantiates a new Wordcloud preference page.
59
	 */
60
	public WordCloudPreferencePage() {
61
		super();
62
	}
63

  
64
	/**
65
	 * Creates the field editors. Field editors are abstractions of the common
66
	 * GUI blocks needed to manipulate various types of preferences. Each field
67
	 * editor knows how to save and restore itself.
68
	 */
69
	@Override
70
	public void createFieldEditors() {
71
		
72
		// Charts rendering
73
		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent());
74
		
75
		this.addField(new IntegerFieldEditor(WordCloudPreferences.MAX_WORDS, Messages.PreferencePage_Number_of_used_words, chartsTab));
76
		this.addField(new IntegerFieldEditor(WordCloudPreferences.FMIN, Messages.PreferencePage_Minimal_frequency, chartsTab));
77
		this.addField(new IntegerFieldEditor(WordCloudPreferences.ROT, Messages.PreferencePage_Percent_of_rotated_words, chartsTab));
78
		this.addField(new BooleanFieldEditor(WordCloudPreferences.RANDOM_POSITION, Messages.PreferencePage_Random_word_positions, chartsTab));
79
		
80
		// other shared preferences
81
		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
82

  
83
	}
84
	
85
	
86
	/*
87
	 * (non-Javadoc)
88
	 * 
89
	 * @see
90
	 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
91
	 */
92
	@Override
93
	public void init(IWorkbench workbench) {
94
		this.setPreferenceStore(new TXMPreferenceStore(WordCloudPreferences.PREFERENCES_NODE));
95
		//this.setTitle("WordCloud");
96
		this.setImageDescriptor(WordCloudAdapterFactory.ICON);
97
	}
98

  
99

  
100
}
0 101

  
tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/adapters/WordCloudAdapterFactory.java (revision 88)
1
// Copyright © 2010-2013 ENS de Lyon.
2
package org.txm.wordcloud.rcp.adapters;
3

  
4
import org.eclipse.jface.resource.ImageDescriptor;
5
import org.eclipse.ui.model.IWorkbenchAdapter;
6
import org.eclipse.ui.plugin.AbstractUIPlugin;
7
import org.osgi.framework.FrameworkUtil;
8
import org.txm.rcp.adapters.BaseAdapterFactory;
9
import org.txm.wordcloud.core.functions.WordCloud;
10

  
11
/**
12
 * A factory for creating Adapter objects.
13
 * 
14
 * @author mdecorde
15
 * @author sjacquot
16
 */
17
public class WordCloudAdapterFactory extends BaseAdapterFactory {
18

  
19
	
20
	public static final ImageDescriptor ICON =
21
			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(WordCloudAdapterFactory.class).getSymbolicName(),
22
					"platform:/plugin/"+ FrameworkUtil.getBundle(WordCloudAdapterFactory.class).getSymbolicName() + "/icons/functions/wordcloud.png"); //$NON-NLS-1$
23

  
24
	
25
	
26
	/**
27
	 * Gets the adapter.
28
	 *
29
	 * @param adaptableObject the adaptable object
30
	 * @param adapterType the adapter type
31
	 * @return the adapter
32
	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
33
	 */
34
	@Override
35
	public Object getAdapter(Object adaptableObject, Class adapterType) {
36
		
37
		if(adapterType == IWorkbenchAdapter.class)	{
38
			if(adaptableObject instanceof WordCloud)	{
39
				return new IWorkbenchAdapter() {
40
					@Override
41
					public Object[] getChildren(Object resultData) {
42
						return new Object[0];
43
					}
44
	
45
					@Override
46
					public ImageDescriptor getImageDescriptor(Object object) {
47
						return ICON;
48
					}
49
	
50
					@Override
51
					public String getLabel(Object resultData) {
52
						return ((WordCloud) resultData).getName();
53
					}
54
	
55
					@Override
56
					public Object getParent(Object resultData) {
57
						return ((WordCloud) resultData).getCorpus();
58
					}
59
				};
60
			}
61
		}
62
		return null;
63
	}
64

  
65

  
66
}
0 67

  
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff