Skip to content
Snippets Groups Projects
Commit f15108dc authored by buczekp's avatar buczekp
Browse files

[LMS-1597] change page title when accessing detail view of an entity in simple view mode

SVN: 17864
parent a2576ad6
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,11 @@ public abstract class AbstractPluginViewContext<T extends IClientServiceAsync> i
return commonViewContext.getPageController();
}
public final String getBasicPageTitle()
{
return commonViewContext.getBasicPageTitle();
}
public final IClientPluginFactoryProvider getClientPluginFactoryProvider()
{
return commonViewContext.getClientPluginFactoryProvider();
......
......@@ -103,12 +103,17 @@ public class Client implements EntryPoint, ValueChangeHandler<String>
CommonViewContext commonContext =
new CommonViewContext(service, imageBundle, pageController, isLoggingEnabled(),
isSimpleMode());
isSimpleMode(), getPageTitle());
commonContext.setClientPluginFactoryProvider(createPluginFactoryProvider(commonContext));
initializeLocatorHandlerRegistry(commonContext.getLocatorResolverRegistry(), commonContext);
return commonContext;
}
private String getPageTitle()
{
return Window.getTitle();
}
private boolean isSimpleMode()
{
String viewModeParameter = Window.Location.getParameter(BasicConstant.VIEW_MODE_KEY);
......
......@@ -79,14 +79,17 @@ public final class CommonViewContext implements IViewContext<ICommonClientServic
private final IProfilingTable profilingTable;
private final String basicPageTitle;
CommonViewContext(final ICommonClientServiceAsync service,
final IGenericImageBundle imageBundle, final IPageController pageController,
boolean isLoggingEnabled, boolean isSimpleMode)
boolean isLoggingEnabled, boolean isSimpleMode, String basicPageTitle)
{
this.service = service;
this.imageBundle = imageBundle;
this.pageController = pageController;
this.profilingTable = ProfilingTable.create(isLoggingEnabled);
this.basicPageTitle = basicPageTitle;
messageProvider = new CompositeMessageProvider();
messageProvider.add(new DictonaryBasedMessageProvider(TECHNOLOGY_NAME));
viewModel = new GenericViewModel();
......@@ -162,6 +165,11 @@ public final class CommonViewContext implements IViewContext<ICommonClientServic
return pageController;
}
public final String getBasicPageTitle()
{
return basicPageTitle;
}
public final IClientPluginFactoryProvider getClientPluginFactoryProvider()
{
return clientPluginFactoryProvider;
......
......@@ -48,6 +48,8 @@ public interface IViewContext<T extends IClientServiceAsync> extends IMessagePro
public IPageController getPageController();
public String getBasicPageTitle();
public IClientPluginFactoryProvider getClientPluginFactoryProvider();
public ICommonClientServiceAsync getCommonService();
......
......@@ -16,6 +16,8 @@
package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.listener;
import com.google.gwt.user.client.Window;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper;
......@@ -66,6 +68,13 @@ public final class OpenEntityDetailsTabAction implements IDelegatedAction
final AbstractTabItemFactory tabView =
createClientPlugin.createEntityViewer(entityType, entity);
tabView.setInBackground(keyPressed);
if (viewContext.isSimpleMode())
{
Window.setTitle(entityKind + ": " + entity.getCode() + " [" + entityType + "]" + " - "
+ viewContext.getBasicPageTitle());
}
DispatcherHelper.dispatchNaviEvent(tabView);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment