Revision 939829bc
Added by Patrick Plitzner about 7 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java | ||
---|---|---|
51 | 51 |
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior; |
52 | 52 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
53 | 53 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
54 |
import eu.etaxonomy.taxeditor.navigation.l10n.Messages; |
|
54 | 55 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
55 | 56 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
56 | 57 |
import eu.etaxonomy.taxeditor.session.ICdmEntitySession; |
... | ... | |
64 | 65 |
* @author p.ciardelli |
65 | 66 |
* @author n.hoffmann |
66 | 67 |
* @created 02.06.2009 |
67 |
* @version 1.0 |
|
68 |
* @version 1.0+-
|
|
68 | 69 |
*/ |
69 | 70 |
public class TaxonNavigator extends CommonNavigator implements |
70 | 71 |
IPostOperationEnabled, IConversationEnabled, Observer, |
71 | 72 |
ICdmEntitySessionEnabled, ICdmChangeListener { |
72 | 73 |
|
73 |
/** |
|
74 |
private static final String RESTORING_TAXON_NAVIGATOR = Messages.TaxonNavigator_RESTORE; |
|
75 |
|
|
76 |
/** |
|
74 | 77 |
* Constant |
75 | 78 |
* <code>ID="eu.etaxonomy.taxeditor.navigation.navig"{trunked}</code> |
76 | 79 |
*/ |
77 | 80 |
public static final String ID = "eu.etaxonomy.taxeditor.navigation.navigator"; //$NON-NLS-1$ |
78 | 81 |
|
79 |
private static final String TREE_PATH = "treepath"; |
|
82 |
private static final String TREE_PATH = "treepath"; //$NON-NLS-1$
|
|
80 | 83 |
|
81 |
private static final String TREE_PATHS = "treepaths"; |
|
84 |
private static final String TREE_PATHS = "treepaths"; //$NON-NLS-1$
|
|
82 | 85 |
|
83 | 86 |
private ConversationHolder conversation; |
84 | 87 |
|
... | ... | |
226 | 229 |
IProgressMonitor subProgressMonitor = NavigationUtil |
227 | 230 |
.getSubProgressMonitor(monitor, 1); |
228 | 231 |
|
229 |
subProgressMonitor.beginTask("Restoring Taxon Navigator",
|
|
232 |
subProgressMonitor.beginTask(RESTORING_TAXON_NAVIGATOR,
|
|
230 | 233 |
1 + mementoWork + 5); |
231 |
subProgressMonitor.subTask("Restoring Taxon Navigator");
|
|
234 |
subProgressMonitor.subTask(RESTORING_TAXON_NAVIGATOR);
|
|
232 | 235 |
subProgressMonitor.worked(1); |
233 | 236 |
|
234 | 237 |
conversation = CdmStore.createConversation(); |
... | ... | |
270 | 273 |
return null; |
271 | 274 |
} |
272 | 275 |
|
273 |
for (String uuid : string.split(" ")) { |
|
276 |
for (String uuid : string.split(" ")) { //$NON-NLS-1$
|
|
274 | 277 |
CdmBase cdmBaseObject = CdmStore.getService( |
275 | 278 |
IClassificationService.class).getTaxonNodeByUuid( |
276 | 279 |
UUID.fromString(uuid)); |
... | ... | |
317 | 320 |
memento = memento.createChild(TREE_PATHS); |
318 | 321 |
TreePath[] treePaths = this.getCommonViewer().getExpandedTreePaths(); |
319 | 322 |
|
320 |
monitor.beginTask("Saving Taxon Navigator State", treePaths.length);
|
|
323 |
monitor.beginTask(Messages.TaxonNavigator_SAVE_TASK, treePaths.length);
|
|
321 | 324 |
|
322 | 325 |
for (TreePath treePath : treePaths) { |
323 | 326 |
int pathLength = treePath.getSegmentCount(); |
324 |
String path = ""; |
|
327 |
String path = ""; //$NON-NLS-1$
|
|
325 | 328 |
for (int i = 0; i < pathLength; i++) { |
326 | 329 |
Object segment = treePath.getSegment(i); |
327 | 330 |
if (segment instanceof CdmBase) { |
328 |
path += ((CdmBase) segment).getUuid().toString() + " "; |
|
331 |
path += ((CdmBase) segment).getUuid().toString() + " "; //$NON-NLS-1$
|
|
329 | 332 |
monitor.worked(1); |
330 | 333 |
} else { |
331 | 334 |
MessagingUtils.warn(getClass(), |
332 |
"Non-taxon tree path segment " + segment); |
|
335 |
"Non-taxon tree path segment " + segment); //$NON-NLS-1$
|
|
333 | 336 |
} |
334 | 337 |
} |
335 | 338 |
memento.createChild(TREE_PATH, path.trim()); |
... | ... | |
378 | 381 |
@Override |
379 | 382 |
public String getFrameToolTipText(Object element) { |
380 | 383 |
if (element instanceof Root) { |
381 |
return "Taxonomic Tree";
|
|
384 |
return Messages.TaxonNavigator_TAXON_TREE;
|
|
382 | 385 |
} |
383 | 386 |
return super.getFrameToolTipText(element); |
384 | 387 |
} |
... | ... | |
494 | 497 |
getCommonViewer().getControl().setEnabled(!busy); |
495 | 498 |
if (busy) { |
496 | 499 |
partNameCache = getPartName(); |
497 |
setPartName("Loading datasources");
|
|
500 |
setPartName(Messages.TaxonNavigator_LOAD_DATASOURCE);
|
|
498 | 501 |
} else { |
499 | 502 |
if (partNameCache != null) { |
500 | 503 |
setPartName(partNameCache); |
... | ... | |
564 | 567 |
public Map<Object, List<String>> getPropertyPathsMap() { |
565 | 568 |
Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>(); |
566 | 569 |
List<String> taxonNodePropertyPaths = Arrays.asList(new String[] { |
567 |
"taxon.name" |
|
570 |
"taxon.name" //$NON-NLS-1$
|
|
568 | 571 |
}); |
569 |
propertyPathsMap.put("childNodes", taxonNodePropertyPaths); |
|
572 |
propertyPathsMap.put("childNodes", taxonNodePropertyPaths); //$NON-NLS-1$
|
|
570 | 573 |
return propertyPathsMap; |
571 | 574 |
} |
572 | 575 |
} |
Also available in: Unified diff
ref #4611 i18n for taxeditor.navigator plugin