Révision 2345

tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java (revision 2345)
167 167
		if (Toolbox.isInitialized()) {
168 168

  
169 169
			treeViewer.setContentProvider(new CorpusViewContentProvider(this));
170
			treeViewer.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
170
			treeViewer.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()) {
171
				@Override
172
				public String getText(Object element) { // cut label if too long
173
					String txt = super.getText(element);
174
					if (txt != null && txt.length() > TXMEditor.MAX_NAME_LENGTH) {
175
						txt = txt.substring(0, TXMEditor.MAX_NAME_LENGTH-1)+"...";
176
					}
177
					return txt;
178
				}
179
			});
171 180

  
172 181
			Workspace w = Toolbox.workspace;
173 182
			if (w == null) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/ParametersComposite.java (revision 2345)
1 1
package org.txm.rcp.views.cmdparameters;
2 2

  
3 3
import java.util.ArrayList;
4
import java.util.Arrays;
4 5

  
5 6
import org.apache.commons.lang.StringUtils;
6 7
import org.eclipse.core.resources.IProject;
......
22 23
import org.txm.core.preferences.TXMPreferences;
23 24
import org.txm.core.results.TXMResult;
24 25
import org.txm.objects.Project;
26
import org.txm.rcp.preferences.RCPPreferences;
25 27
import org.txm.rcp.swt.GLComposite;
26 28

  
27 29
public class ParametersComposite extends GLComposite {
......
47 49
			public Object[] getElements(Object inputElement) {
48 50
				if (inputElement instanceof String) {
49 51
					String npath = inputElement.toString();
50
					return getChildren(TXMPreferences.preferencesRootNode.node(npath));
52
					Object[] children = getChildren(TXMPreferences.preferencesRootNode.node(npath));
53
					return children;
51 54
				} else if (inputElement instanceof Project) {
52 55
					Project project = (Project)inputElement;
53 56
					IEclipsePreferences prefs = project.getPreferencesScope().getNode("/project/"+project.getName());
......
71 74
					try {
72 75
						ArrayList<Object> children = new ArrayList<Object>();
73 76
						String[] nodes = prefs.childrenNames();
74
						String[] attributes = prefs.keys();
77
						Arrays.sort(nodes);
75 78
						for (String n : nodes) {
76 79
							children.add(prefs.node(n));
77 80
						}
81
						
82
						String[] attributes = null;
83
						if (RCPPreferences.getInstance().getBoolean(RCPPreferences.EXPERT_USER)) {
84
							
85
						} else {
86
							attributes = prefs.keys();
87
						}
88
						Arrays.sort(attributes);
78 89
						for (String name : attributes) {
79 90
							children.add(new Object[] {prefs, name});
80 91
						}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 2345)
111 111
	 * ID defined in plugin.xml for the compute button contribution.
112 112
	 */
113 113
	public final static String TOP_TOOLBAR_COMPUTE_BUTTON_ID = "compute"; //$NON-NLS-1$
114

  
115
	public static final int MAX_NAME_LENGTH = 40;
114 116
	
115 117
	/**
116 118
	 * The editor main tool bar, positioned at the top of the editor.
......
1187 1189
		// this.getContainer().setRedraw(false);
1188 1190
		
1189 1191
		String title = result.getName();
1190
		if (title.length() > 41) { // limit title length
1191
			title = title.substring(0, 40) + "...";
1192
		if (title.length() > MAX_NAME_LENGTH) { // limit title length
1193
			title = title.substring(0, MAX_NAME_LENGTH-1) + "...";
1192 1194
		}
1193 1195
		this.setPartName(title);
1194 1196
		// this.firePropertyChange(TXMEditor.PROP_DIRTY);
......
1207 1209
		// }
1208 1210
		
1209 1211
		// Hide the computing parameter area if the editor wasn't open and the result is computed
1210
		if (!update && !result.isDirty() && !this.topToolBar.isDisposed()) {
1211
			this.topToolBar.setComputingParametersVisible(false);
1212
		}
1212
		//TODO MD: why was the toolbar hidden ?
1213
//		if (!update && !result.isDirty() && !this.topToolBar.isDisposed()) {
1214
//			this.topToolBar.setComputingParametersVisible(false);
1215
//		}
1213 1216
		
1214 1217
		if (!topToolBar.isDisposed()) this.topToolBar.redraw();
1215 1218
		

Formats disponibles : Unified diff