Revision 49bb0781
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties | ||
---|---|---|
113 | 113 |
SearchManager_LONG_SEARCH_WARNING=The current search will return %s objects. This will take a long time and/or might render the editor unusable. Please consider refining your search.\nSearch anyway? |
114 | 114 |
|
115 | 115 |
SupplementalDataViewPart_VIEWER_NAME=Supplemental Data |
116 |
DetailsViewPart_VIEWER_NAME=Details |
|
116 |
DetailsViewPart_VIEWER_NAME=Details |
|
117 |
|
|
118 |
AuthenticatedUserBar_LOGGED_IN_AS=Logged in as: %s |
|
119 |
AuthenticatedUserBar_NOT_LOGGED_IN=Not logged in |
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties | ||
---|---|---|
114 | 114 |
|
115 | 115 |
SupplementalDataViewPart_VIEWER_NAME=Zusatzdaten |
116 | 116 |
DetailsViewPart_VIEWER_NAME=Details |
117 |
|
|
118 |
AuthenticatedUserBar_LOGGED_IN_AS=Angemeldet als: %s |
|
119 |
AuthenticatedUserBar_NOT_LOGGED_IN=Nicht angemeldet |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java | ||
---|---|---|
18 | 18 |
*/ |
19 | 19 |
public class Messages extends NLS { |
20 | 20 |
private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$ |
21 |
public static String AuthenticatedUserBar_LOGGED_IN_AS; |
|
22 |
public static String AuthenticatedUserBar_NOT_LOGGED_IN; |
|
21 | 23 |
public static String LanguageEditorPreferencePage_ChooseDefaultLanguage; |
22 | 24 |
public static String LanguageEditorPreferencePage_EditorHasToRestart; |
23 | 25 |
public static String LanguageEditorPreferencePage_PleaseRestart; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java | ||
---|---|---|
1 |
// $Id$ |
|
2 | 1 |
/** |
3 | 2 |
* Copyright (C) 2007 EDIT |
4 | 3 |
* European Distributed Institute of Taxonomy |
... | ... | |
21 | 20 |
import org.eclipse.ui.menus.WorkbenchWindowControlContribution; |
22 | 21 |
|
23 | 22 |
import eu.etaxonomy.cdm.model.common.User; |
23 |
import eu.etaxonomy.taxeditor.Messages; |
|
24 | 24 |
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource; |
25 | 25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
26 | 26 |
import eu.etaxonomy.taxeditor.util.ApplicationUtil; |
... | ... | |
36 | 36 |
|
37 | 37 |
private Label label_authenticatedUser; |
38 | 38 |
|
39 |
/** |
|
40 |
* <p>Constructor for AuthenticatedUserBar.</p> |
|
41 |
*/ |
|
42 | 39 |
public AuthenticatedUserBar(){ |
43 | 40 |
CdmStore.getLoginManager().addObserver(this); |
44 | 41 |
} |
45 | 42 |
|
46 |
/* (non-Javadoc) |
|
47 |
* @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite) |
|
48 |
*/ |
|
49 | 43 |
/** {@inheritDoc} */ |
50 | 44 |
@Override |
51 | 45 |
protected Control createControl(Composite parent) { |
... | ... | |
57 | 51 |
return label_authenticatedUser; |
58 | 52 |
} |
59 | 53 |
|
60 |
/* (non-Javadoc) |
|
61 |
* @see java.util.Observer#update(java.util.Observable, java.lang.Object) |
|
62 |
*/ |
|
63 | 54 |
/** {@inheritDoc} */ |
64 | 55 |
@Override |
65 | 56 |
public void update(Observable o, Object arg) { |
66 | 57 |
User authenticatedUser = CdmStore.getLoginManager().getAuthenticatedUser(); |
67 | 58 |
// TODO find a method to recompute width for parental toolbar item |
68 |
String text = ""; |
|
59 |
String text = ""; //$NON-NLS-1$
|
|
69 | 60 |
if(authenticatedUser == null) { |
70 |
text = "Not logged in " ;
|
|
61 |
text = Messages.AuthenticatedUserBar_NOT_LOGGED_IN ;
|
|
71 | 62 |
} else { |
72 | 63 |
CdmRemoteSource source = (CdmRemoteSource) CdmStore.getActiveCdmSource(); |
73 |
String loginInfo = authenticatedUser.getUsername() + "@" + source.getName() + ":" + source.getContextPath();
|
|
74 |
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(ApplicationUtil.getTitle() + " " + loginInfo); |
|
75 |
|
|
76 |
text = "Logged in as: " + authenticatedUser.getUsername() + " ";
|
|
64 |
String loginInfo = String.format("%s@%s:%s",authenticatedUser.getUsername(), source.getName(), source.getContextPath()); //$NON-NLS-1$
|
|
65 |
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(ApplicationUtil.getTitle() + " " + loginInfo); //$NON-NLS-1$
|
|
66 |
|
|
67 |
text = String.format(Messages.AuthenticatedUserBar_LOGGED_IN_AS, authenticatedUser.getUsername());
|
|
77 | 68 |
} |
78 | 69 |
|
79 | 70 |
label_authenticatedUser.setText(text); |
80 | 71 |
} |
81 | 72 |
|
82 |
/* (non-Javadoc) |
|
83 |
* @see org.eclipse.jface.action.ContributionItem#dispose() |
|
84 |
*/ |
|
85 | 73 |
/** {@inheritDoc} */ |
86 | 74 |
@Override |
87 | 75 |
public void dispose() { |
... | ... | |
89 | 77 |
CdmStore.getLoginManager().deleteObserver(this); |
90 | 78 |
} |
91 | 79 |
|
92 |
|
|
93 | 80 |
} |
Also available in: Unified diff
i18n for AuthenticationUserBar