Révision 862

tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java (revision 862)
40 40

  
41 41
/**
42 42
 * Opens a Concordance editor.
43
 * Computes the result according to its parameters.
43 44
 * 
44 45
 * @author mdecorde
45 46
 * @author sjacquot
......
57 58
		
58 59
		Concordance concordance = null;
59 60

  
60
		// From link: creating from UUID and preferences nodes
61
		// From link: creating from UUID and preferences node
61 62
		String uuid = event.getParameter(TXMPreferences.RESULT_UUID);
62 63
		if (uuid != null && !uuid.isEmpty()) {
63 64
			concordance = new Concordance(uuid);
......
82 83
		StatusLine.setMessage(ConcordanceUIMessages.ComputeConcordance_0);
83 84
		TXMEditor.openEditor(concordance, ConcordanceEditor.class.getName());
84 85
		return null;
85
		
86
		// FIXME: old version
87
		// if a TXMParameters is linked to the command call, uses its parent to create the concordance
88
//		TXMParameters parameters = null;
89
//		Map cmdparameters = event.getParameters();
90
//		System.out.println(cmdparameters);
91
//		if (cmdparameters.containsKey(TXMParameters.class.getName())) {
92
//			Object iparam = cmdparameters.get(TXMParameters.class.getName());
93
//			if (iparam instanceof TXMParameters) {
94
//				parameters = (TXMParameters)iparam;
95
//			}
96
//		}
97
//		Object selection = null;
98
//		if (parameters == null) { // no parameters provided
99
//			selection = this.getSelection(event);
100
//		} else {
101
//			selection = parameters;
102
//		}
103
//		
104
//		if (openEditor(selection) == null) {
105
//			System.out.println(ConcordanceUIMessages.ComputeConcordance_1);
106
//		}
107
//
108
//		return null;
109 86
	}
110

  
111
	// FIXME: old version
112
//	@Inject
113
//	public static IEditorPart openEditor(Object o) {
114
//		
115
//		if (!CQPSearchEngine.isInitialized()) {
116
//			System.out.println("SearchEngine is not ready. Aborting.");
117
//			return null;
118
//		}
119
//		
120
//		Concordance concordance = null;
121
//
122
//		// Creating from UUID and preferences nodes
123
//		String uuid = event.getParameter(TXMPreferences.RESULT_UUID);
124
//		if (uuid != null && !uuid.isEmpty()) {
125
//			progression = new Progression(uuid);
126
//		}
127
//
128
//		// Creating from Corpus
129
//		if (o instanceof Corpus) {
130
//			Corpus corpus = (Corpus) o;
131
//			concordance = new Concordance(corpus);
132
//		}
133
//		// Reopening existing result
134
//		else if (o instanceof Concordance) {
135
//			concordance = (Concordance)o;
136
//		}
137
//		else {
138
//			System.out.println("Could not call ComputeConcordance with: "+o);
139
//			return null;
140
//		}
141
//		
142
//		StatusLine.setMessage(ConcordanceUIMessages.ComputeConcordance_0);
143
//		TXMEditor.openEditor(concordance, ConcordanceEditor.class.getName());
144
//		return null;
145
//	}
146 87
}

Formats disponibles : Unified diff