Revision 997
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 997) | ||
---|---|---|
206 | 206 |
|
207 | 207 |
// Corpus global lexicon |
208 | 208 |
Lexicon corpusLexicon = Lexicon.getLexicon(partition.getCorpus(), this.property, this.monitor); |
209 |
|
|
209 |
|
|
210 | 210 |
ArrayList<String> filteredForms = new ArrayList<String>(); |
211 | 211 |
//create a copy and filter line with Fmin; |
212 | 212 |
for (int i = 0 ; i < corpusLexicon.getFreq().length ; i++) { |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/RenameResult.java (revision 997) | ||
---|---|---|
8 | 8 |
import org.eclipse.jface.viewers.IStructuredSelection; |
9 | 9 |
import org.eclipse.ui.IWorkbenchWindow; |
10 | 10 |
import org.eclipse.ui.handlers.HandlerUtil; |
11 |
import org.txm.core.preferences.TXMPreferences; |
|
11 | 12 |
import org.txm.core.results.TXMResult; |
12 | 13 |
import org.txm.rcp.swt.dialog.TextDialog; |
13 | 14 |
import org.txm.rcp.views.corpora.CorporaView; |
... | ... | |
25 | 26 |
final TXMResult r = (TXMResult)first; |
26 | 27 |
|
27 | 28 |
final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); |
28 |
TextDialog dialog = new TextDialog(window.getShell(), "Rename "+r, "Enter the new name to show in the Corpus view", r.getUserName());
|
|
29 |
TextDialog dialog = new TextDialog(window.getShell(), "Rename " + r, "Enter the new name to show in the Corpus view", r.getUserOrSimpleName());
|
|
29 | 30 |
if (dialog.open() == TextDialog.OK) { |
30 | 31 |
String newName = dialog.getText(); |
31 | 32 |
if (newName.length() > 0) { |
32 | 33 |
r.setUserName(newName); |
34 |
try { |
|
35 |
r.autoSaveParametersFromAnnotations(); |
|
36 |
} |
|
37 |
catch (Exception e) { |
|
38 |
// TODO Auto-generated catch block |
|
39 |
e.printStackTrace(); |
|
40 |
} |
|
41 |
TXMPreferences.flush(r); |
|
33 | 42 |
|
43 |
|
|
34 | 44 |
window.getShell().getDisplay().syncExec(new Runnable() { |
35 | 45 |
@Override |
36 | 46 |
public void run() { |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/adapters/TXMResultAdapter.java (revision 997) | ||
---|---|---|
31 | 31 |
@Override |
32 | 32 |
public String getLabel(Object result) { |
33 | 33 |
if (result instanceof TXMResult) { |
34 |
TXMResult r = (TXMResult)result; |
|
35 |
|
|
36 |
if(r.getUserName() != null) { |
|
37 |
return r.getUserName(); |
|
38 |
} |
|
39 |
else { |
|
40 |
return r.getSimpleName(); |
|
41 |
} |
|
42 |
} else { |
|
34 |
return ((TXMResult) result).getUserOrSimpleName(); |
|
35 |
} |
|
36 |
else { |
|
43 | 37 |
return result.toString(); |
44 | 38 |
} |
45 | 39 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/TextDialog.java (revision 997) | ||
---|---|---|
21 | 21 |
import org.eclipse.swt.widgets.Shell; |
22 | 22 |
import org.eclipse.swt.widgets.Text; |
23 | 23 |
|
24 |
/** |
|
25 |
* |
|
26 |
* |
|
27 |
* |
|
28 |
*/ |
|
24 | 29 |
public class TextDialog extends Dialog { |
30 |
|
|
25 | 31 |
private static final int RESET_ID = IDialogConstants.NO_TO_ALL_ID + 1; |
26 | 32 |
|
27 | 33 |
private Text textField; |
... | ... | |
29 | 35 |
String question; |
30 | 36 |
String text; |
31 | 37 |
|
38 |
/** |
|
39 |
* |
|
40 |
* @param parentShell |
|
41 |
* @param title |
|
42 |
* @param question |
|
43 |
* @param text |
|
44 |
*/ |
|
32 | 45 |
public TextDialog(Shell parentShell, String title, String question, String text) { |
33 | 46 |
super(parentShell); |
34 | 47 |
this.title = title; |
... | ... | |
36 | 49 |
this.text = text; |
37 | 50 |
} |
38 | 51 |
|
39 |
/* (non-Javadoc) |
|
40 |
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) |
|
41 |
*/ |
|
42 | 52 |
@Override |
43 | 53 |
protected void configureShell(Shell newShell) { |
44 | 54 |
super.configureShell(newShell); |
45 | 55 |
newShell.setText(title); |
46 | 56 |
} |
47 | 57 |
|
58 |
@Override |
|
48 | 59 |
protected Control createDialogArea(Composite parent) { |
49 | 60 |
Composite comp = (Composite) super.createDialogArea(parent); |
50 | 61 |
|
... | ... | |
59 | 70 |
|
60 | 71 |
textField = new Text(comp, SWT.SINGLE); |
61 | 72 |
textField.setLayoutData(data); |
73 |
if(this.text != null) { |
|
74 |
textField.setText(this.text); |
|
75 |
textField.setSelection(0, this.text.length()); |
|
76 |
} |
|
62 | 77 |
return comp; |
63 | 78 |
} |
64 | 79 |
|
80 |
@Override |
|
65 | 81 |
protected void buttonPressed(int buttonId) { |
66 | 82 |
if (buttonId == Dialog.OK) { |
67 | 83 |
text = textField.getText(); |
tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java (revision 997) | ||
---|---|---|
636 | 636 |
if(lexicon == null || lexicon.getProperty() != property) { |
637 | 637 |
lexicon = new Lexicon(corpus); |
638 | 638 |
lexicon.setProperty(property); |
639 |
} |
|
640 |
|
|
641 |
if(!lexicon.hasBeenComputedOnce()) { |
|
639 | 642 |
lexicon.compute(monitor); |
640 | 643 |
} |
644 |
|
|
641 | 645 |
return lexicon; |
642 | 646 |
} |
643 | 647 |
|
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 997) | ||
---|---|---|
61 | 61 |
|
62 | 62 |
float cex = 0.7f; |
63 | 63 |
|
64 |
String colfilter="cos2 0.0", rowfilter="cos2 0.0"; |
|
64 |
String colfilter="cos2 0.0", rowfilter="cos2 0.0"; //$NON-NLS-1$ //$NON-NLS-2$
|
|
65 | 65 |
|
66 | 66 |
/** The colnames. */ |
67 | 67 |
String[] colnames = null; |
... | ... | |
72 | 72 |
/** The coltitles. */ |
73 | 73 |
String[] coltitles; // of the colinfo table |
74 | 74 |
|
75 |
String pattern = "(cos2|contrib) (([0-9]+\\.[0-9]+)|([0-9]+))"; |
|
75 |
String pattern = "(cos2|contrib) (([0-9]+\\.[0-9]+)|([0-9]+))"; //$NON-NLS-1$
|
|
76 | 76 |
|
77 | 77 |
/** The rownames. */ |
78 | 78 |
String[] rownames = null; |
... | ... | |
173 | 173 |
this.colfilter = col; |
174 | 174 |
} |
175 | 175 |
else { |
176 |
System.out.println("Columns filter malformed follow this pattern " + pattern);
|
|
176 |
Log.severe("Columns filter malformed follow this pattern " + pattern + ".");
|
|
177 | 177 |
} |
178 | 178 |
|
179 | 179 |
if (row.matches(pattern)) { |
180 | 180 |
this.rowfilter = row; |
181 | 181 |
} |
182 | 182 |
else { |
183 |
System.out.println("Rows filter malformed follow this pattern " + pattern);
|
|
183 |
Log.severe("Rows filter malformed follow this pattern " + pattern + ".");
|
|
184 | 184 |
} |
185 | 185 |
} |
186 | 186 |
|
tmp/org.txm.para.rcp/src/org/txm/para/rcp/handlers/OpenParaBrowser.java (revision 997) | ||
---|---|---|
45 | 45 |
|
46 | 46 |
// TODO: Auto-generated Javadoc |
47 | 47 |
/** |
48 |
* Display and browse text of structural unit of parallel corpora @ author |
|
49 |
* mdecorde. |
|
48 |
* Display and browse text of structural unit of parallel corpora |
|
49 |
* |
|
50 |
* @author mdecorde |
|
50 | 51 |
*/ |
51 | 52 |
public class OpenParaBrowser extends AbstractHandler { |
52 | 53 |
|
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 997) | ||
---|---|---|
719 | 719 |
*/ |
720 | 720 |
public boolean autoSaveParametersFromAnnotations() throws Exception { |
721 | 721 |
|
722 |
System.out.println("TXMResult.autoSaveParametersFromAnnotations(): " + this.getClass().getSimpleName() + ": saving parameters to local node...");
|
|
722 |
Log.finest("TXMResult.autoSaveParametersFromAnnotations(): " + this.getClass().getSimpleName() + ": saving parameters to local node...");
|
|
723 | 723 |
|
724 | 724 |
// internal data to save for unserialization |
725 | 725 |
this.saveParameter("class", this.getClass().getName()); //$NON-NLS-1$ |
726 |
// store the user name if exists otherwise the simple name |
|
727 |
if(this.userName != null) { |
|
728 |
this.saveParameter(TXMPreferences.NAME, this.userName); |
|
729 |
} |
|
730 |
else { |
|
731 |
this.saveParameter(TXMPreferences.NAME, this.getSimpleName()); |
|
732 |
} |
|
726 |
// store the user name if exists it otherwise the simple name (to display something at reloading otherwise the simple name can leads to error because the result is not computed until it will be reopen) |
|
727 |
this.saveParameter(TXMPreferences.NAME, this.getUserOrSimpleName()); |
|
728 |
|
|
733 | 729 |
this.saveParameter(TXMPreferences.RESULT_UUID, this.uniqueID); |
734 | 730 |
this.saveParameter(TXMPreferences.BUNDLE_ID, this.preferencesNodeQualifier); |
735 | 731 |
if(this.parent != null) { |
... | ... | |
1171 | 1167 |
for (int i = 0; i < results.size(); i++) { |
1172 | 1168 |
|
1173 | 1169 |
// FIXME: skipping invisible results |
1174 |
if(!results.get(i).isVisible()) { |
|
1175 |
continue; |
|
1176 |
} |
|
1170 |
// if(!results.get(i).isVisible()) {
|
|
1171 |
// continue;
|
|
1172 |
// }
|
|
1177 | 1173 |
|
1178 | 1174 |
if(results.get(i).getUUID().equals(UUID)) { |
1179 | 1175 |
result = results.get(i); |
... | ... | |
1331 | 1327 |
public abstract String getName(); |
1332 | 1328 |
|
1333 | 1329 |
/** |
1334 |
* Gets the simple name of the result. Shown in small UI area
|
|
1330 |
* Gets the simple name of the result. Dedicated to be displayed in a small UI area.
|
|
1335 | 1331 |
* |
1336 | 1332 |
* @return |
1337 | 1333 |
*/ |
1338 | 1334 |
public abstract String getSimpleName(); |
1339 | 1335 |
|
1340 | 1336 |
/** |
1341 |
* Gets some details about how the result has been computed (eg. additional parameters, etc.). Shown in large UI area.
|
|
1337 |
* Gets some details about how the result has been computed (eg. additional parameters, etc.). Dedicated to be displayed in a large UI area.
|
|
1342 | 1338 |
* |
1343 | 1339 |
* @return |
1344 | 1340 |
*/ |
1345 | 1341 |
public abstract String getDetails(); |
1346 | 1342 |
|
1347 | 1343 |
/** |
1344 |
* Gets the user name if exists otherwise the simple name. |
|
1345 |
* @return the user name if exists otherwise the simple name |
|
1346 |
*/ |
|
1347 |
public String getUserOrSimpleName() { |
|
1348 |
if(this.userName != null) { |
|
1349 |
return this.userName; |
|
1350 |
} |
|
1351 |
else { |
|
1352 |
return this.getSimpleName(); |
|
1353 |
} |
|
1354 |
} |
|
1355 |
|
|
1356 |
|
|
1357 |
/** |
|
1348 | 1358 |
* Convenience method to get a shared name when the result is empty (not yet computed). |
1349 | 1359 |
* @return the String "*" |
1350 | 1360 |
*/ |
... | ... | |
1362 | 1372 |
} |
1363 | 1373 |
|
1364 | 1374 |
/** |
1365 |
* Gets a string representing the result and that can be used as a file name.
|
|
1375 |
* Gets a string representing the result that can be used as a file name (eg. for exporting in file).
|
|
1366 | 1376 |
* |
1367 | 1377 |
* @return |
1368 | 1378 |
*/ |
Also available in: Unified diff