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?
SupplementalDataViewPart_VIEWER_NAME=Supplemental Data
-DetailsViewPart_VIEWER_NAME=Details
\ No newline at end of file
+DetailsViewPart_VIEWER_NAME=Details
+
+AuthenticatedUserBar_LOGGED_IN_AS=Logged in as: %s
+AuthenticatedUserBar_NOT_LOGGED_IN=Not logged in
-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.taxeditor.Messages;
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.util.ApplicationUtil;
private Label label_authenticatedUser;
- /**
- * <p>Constructor for AuthenticatedUserBar.</p>
- */
public AuthenticatedUserBar(){
CdmStore.getLoginManager().addObserver(this);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
- */
/** {@inheritDoc} */
@Override
protected Control createControl(Composite parent) {
return label_authenticatedUser;
}
- /* (non-Javadoc)
- * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public void update(Observable o, Object arg) {
User authenticatedUser = CdmStore.getLoginManager().getAuthenticatedUser();
// TODO find a method to recompute width for parental toolbar item
- String text = "";
+ String text = ""; //$NON-NLS-1$
if(authenticatedUser == null) {
- text = "Not logged in " ;
+ text = Messages.AuthenticatedUserBar_NOT_LOGGED_IN ;
} else {
CdmRemoteSource source = (CdmRemoteSource) CdmStore.getActiveCdmSource();
- String loginInfo = authenticatedUser.getUsername() + "@" + source.getName() + ":" + source.getContextPath();
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(ApplicationUtil.getTitle() + " " + loginInfo);
-
- text = "Logged in as: " + authenticatedUser.getUsername() + " ";
+ String loginInfo = String.format("%s@%s:%s",authenticatedUser.getUsername(), source.getName(), source.getContextPath()); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText(ApplicationUtil.getTitle() + " " + loginInfo); //$NON-NLS-1$
+
+ text = String.format(Messages.AuthenticatedUserBar_LOGGED_IN_AS, authenticatedUser.getUsername());
}
label_authenticatedUser.setText(text);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.ContributionItem#dispose()
- */
/** {@inheritDoc} */
@Override
public void dispose() {
CdmStore.getLoginManager().deleteObserver(this);
}
-
}