Révision 120

tmp/org.txm.partition.rcp/build.properties (revision 120)
1
source.. = src/
2
output.. = bin/
3
bin.includes = plugin.xml,\
4
               META-INF/,\
5
               .,\
6
               icons/,\
7
               OSGI-INF/l10n/bundle.properties
0 8

  
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 120)
1
command.name=\u0420\u0430\u0437\u043c\u0435\u0440\u044b
2
command.tooltip=\u0420\u0430\u0437\u043c\u0435\u0440\u044b
0 3

  
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 120)
1
Bundle-Name = Partition RCP
2
Bundle-Vendor = TXM
3
command.name = Dimensions
4
editor.name = Dimensions
5
page.name = Partition
6
command.tooltip=Visualiser la taille des parties
7
PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE=Afficher le nombre de parties dans le titre du graphique
8
PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE=Trier par taille de partie
0 9

  
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties (revision 120)
1
command.name=Размеры
2
command.tooltip=Размеры
0 3

  
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle.properties (revision 120)
1
Bundle-Name = Partition RCP
2
Bundle-Vendor = TXM
3
command.name = Dimensions
4
editor.name = Dimensions
5
page.name = Partition
6
command.tooltip=Dimensions
7
PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE=Display parts count in chart title
8
PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE=Sort by part size
0 9

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

  
5
   <extension
6
         point="org.eclipse.ui.commands">
7
      <command
8
            categoryId="org.txm.rcpapplication.category.txm"
9
            defaultHandler="org.txm.partition.rcp.handlers.ComputePartitionDimensionsBarChart"
10
            id="ComputePartitionDimensionsBarChart"
11
            name="%command.name">
12
      </command>
13
   </extension>
14
   <extension
15
         point="org.eclipse.ui.menus">
16
      <menuContribution
17
            allPopups="false"
18
            locationURI="toolbar:org.txm.rcpapplication.toolbartools">
19
         <command
20
               commandId="ComputePartitionDimensionsBarChart"
21
               icon="icons/dimensions.png"
22
               style="push"
23
               tooltip="%command.tooltip">
24
            <visibleWhen
25
                  checkEnabled="false">
26
               <or>
27
                  <reference
28
                        definitionId="OnePartitionSelected">
29
                  </reference>
30
               </or>
31
            </visibleWhen>
32
         </command>
33
      </menuContribution>
34
      <menuContribution
35
            allPopups="false"
36
            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
37
         <command
38
               commandId="ComputePartitionDimensionsBarChart"
39
               icon="icons/dimensions.png"
40
               style="push">
41
            <visibleWhen
42
                  checkEnabled="false">
43
               <or>
44
                  <reference
45
                        definitionId="OnePartitionSelected">
46
                  </reference>
47
               </or>
48
            </visibleWhen>
49
         </command>
50
      </menuContribution>
51
      <menuContribution
52
            locationURI="menu:menu.tools">
53
         <command
54
               commandId="ComputePartitionDimensionsBarChart"
55
               icon="icons/dimensions.png"
56
               style="push">
57
            <visibleWhen
58
                  checkEnabled="false">
59
               <or>
60
                  <reference
61
                        definitionId="OnePartitionSelected">
62
                  </reference>
63
               </or>
64
            </visibleWhen>
65
         </command>
66
      </menuContribution>
67
   </extension>
68
   <extension
69
         point="org.eclipse.ui.preferencePages">
70
      <page
71
            category="org.txm.rcpapplication.preferences.UserPreferencePage"
72
            class="org.txm.partition.rcp.preferences.PartitionPreferencePage"
73
            id="org.txm.rcp.partition.preferences.PartitionPreferencePage"
74
            name="%page.name">
75
      </page>
76
   </extension>
77
   <extension
78
         point="org.eclipse.ui.editors">
79
      <editor
80
            class="org.txm.chartsengine.rcp.editors.ChartEditorPart"
81
            default="false"
82
            icon="icons/dimensions.png"
83
            id="org.txm.searchengine.cqp.corpus.Partition"
84
            name="%editor.name">
85
      </editor>
86
   </extension>
87

  
88
</plugin>
0 89

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

  
tmp/org.txm.partition.rcp/.settings/org.eclipse.jdt.core.prefs (revision 120)
1
eclipse.preferences.version=1
2
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4
org.eclipse.jdt.core.compiler.compliance=1.7
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.7
0 8

  
tmp/org.txm.partition.rcp/.classpath (revision 120)
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.7"/>
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.partition.rcp/META-INF/MANIFEST.MF (revision 120)
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %Bundle-Name
4
Bundle-SymbolicName: org.txm.partition.rcp;singleton:=true
5
Bundle-Version: 1.0.0.qualifier
6
Require-Bundle: org.txm.chartsengine.rcp,
7
 org.eclipse.ui,
8
 org.eclipse.core.runtime,
9
 org.txm.core;bundle-version="0.7.0",
10
 org.txm.rcp;bundle-version="0.7.8",
11
 org.txm.partition.core;bundle-version="1.0.0",
12
 org.txm.chartsengine.core
13
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
14
Bundle-ActivationPolicy: lazy
15
Bundle-Vendor: %Bundle-Vendor
0 16

  
tmp/org.txm.partition.rcp/.project (revision 120)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.txm.partition.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
		<buildCommand>
24
			<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
25
			<arguments>
26
			</arguments>
27
		</buildCommand>
28
	</buildSpec>
29
	<natures>
30
		<nature>org.eclipse.pde.PluginNature</nature>
31
		<nature>org.eclipse.jdt.core.javanature</nature>
32
		<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
33
	</natures>
34
</projectDescription>
0 35

  
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/messages/RCPPartitionMessages.java (revision 120)
1
package org.txm.partition.rcp.messages;
2

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

  
5

  
6

  
7
public class RCPPartitionMessages extends NLS {
8

  
9
	// FIXME: use the same properties file than the bundle	
10
	private static final String BUNDLE_NAME = "l10n.bundle"; //$NON-NLS-1$
11

  
12
	public static String PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE;
13
	public static String PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE;
14
	
15

  
16
	static {
17
		// initialize resource bundle
18
		NLS.initializeMessages(BUNDLE_NAME, RCPPartitionMessages.class);
19
	}
20

  
21
	private RCPPartitionMessages() {
22
	}
23
}
0 24

  
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/handlers/ComputePartitionDimensionsBarChart.java (revision 120)
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.partition.rcp.handlers;
29

  
30
import java.util.List;
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.partition.core.preferences.PartitionDimensionsPreferences;
40
import org.txm.rcpapplication.JobsTimer;
41
import org.txm.rcpapplication.Messages;
42
import org.txm.searchengine.cqp.corpus.Part;
43
import org.txm.searchengine.cqp.corpus.Partition;
44

  
45
/**
46
 * Creates and opens a bar chart editor with the dimensions of the selected partition.
47
 * 
48
 * @author mdecorde
49
 * @author sjacquot
50
 * 
51
 */
52
public class ComputePartitionDimensionsBarChart extends AbstractHandler {
53

  
54

  
55
	/* (non-Javadoc)
56
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
57
	 */
58
	@Override
59
	public Object execute(ExecutionEvent event) throws ExecutionException {
60
		if (!Toolbox.isSearchEngineInitialized()) return false;
61
		
62
		if (!Toolbox.isStatEngineInitialized()) {
63
			System.out.println(Messages.PartsSize_0);
64
			return null;
65
		}
66
		
67
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
68

  
69
		if (selection.getFirstElement() instanceof Partition) {
70
			final Partition partition = (Partition) selection.getFirstElement();
71
			try {
72

  
73
				JobsTimer.start();
74

  
75
				List<Part> parts = partition.getParts();
76
				if(parts.size() == 0)	{
77
					return false;
78
				}
79

  
80
				// Creates and opens the chart editor
81
				SWTChartsComponentsProvider.getCurrent().openEditor(Messages.bind(Messages.PartsSize_18, partition.getName()), partition, PartitionDimensionsPreferences.PREFERENCES_NODE,
82
						"Partition Dimensions Bar Chart");
83

  
84
				// FIXME: Pie chart tests
85
//				SWTChartsComponentsProvider.getCurrent().openEditor(Messages.bind(Messages.PartsSize_18, partition.getName()), partition, PartitionDimensionsPreferences.PREFERENCES_NODE,
86
//						"Partition Dimensions Pie Chart");
87
				
88
				
89
				JobsTimer.stopAndPrint();
90
			} catch (Exception e) {
91
				org.txm.rcpapplication.utils.Logger.printStackTrace(e);
92
			}
93
		}
94

  
95
		return null;
96
	}
97
	
98
}
0 99

  
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionPreferencePage.java (revision 120)
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.partition.rcp.preferences;
29

  
30
import org.eclipse.jface.preference.BooleanFieldEditor;
31
import org.eclipse.swt.widgets.Composite;
32
import org.eclipse.ui.IWorkbench;
33
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
34
import org.txm.partition.core.preferences.PartitionDimensionsPreferences;
35
import org.txm.partition.rcp.messages.RCPPartitionMessages;
36
import org.txm.rcp.preferences.TXMPreferencePage;
37
import org.txm.rcp.preferences.TXMPreferenceStore;
38
import org.txm.rcpapplication.Messages;
39

  
40
/**
41
 * Partition preference page.
42
 * @author mdecorde
43
 * @author sjacquot
44
 *
45
 */
46
public class PartitionPreferencePage extends TXMPreferencePage {
47

  
48

  
49
	/**
50
	 * Creates the field editors. Field editors are abstractions of the common
51
	 * GUI blocks needed to manipulate various types of preferences. Each field
52
	 * editor knows how to save and restore itself.
53
	 */
54
	@Override
55
	public void createFieldEditors() {
56
		
57
		// Charts rendering
58
		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent());
59
		
60
		this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE, RCPPartitionMessages.PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE, chartsTab));
61
		this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE, RCPPartitionMessages.PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE, chartsTab));
62
		
63
		// other shared preferences
64
		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
65

  
66
	}
67

  
68
	
69
	/*
70
	 * (non-Javadoc)
71
	 * 
72
	 * @see
73
	 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
74
	 */
75
	@Override
76
	public void init(IWorkbench workbench) {
77
		this.setPreferenceStore(new TXMPreferenceStore(PartitionDimensionsPreferences.PREFERENCES_NODE));
78
		//this.setDescription(Messages.DiagnosticPreferencePage_1);
79
		this.setTitle(Messages.DiagnosticPreferencePage_1);
80
	}
81

  
82

  
83
}
0 84

  

Formats disponibles : Unified diff