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

[LMS-1597] use tab onActivate method to invoke changing title also in aplication mode

SVN: 17877
parent ca39bb1f
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,9 @@ public abstract class AbstractTabItemFactory
/**
* Returns a short description of contents of the tab that can be used in tab or page title.
* <p>
* NOTE: implementation has been changed such that it is used only internally and page title is
* always exactly the same as the tab title.
*/
public abstract String getTabTitle();
......
......@@ -114,7 +114,7 @@ public final class ComponentProvider
IDisposableComponent browser =
SampleBrowserGrid.create(viewContext, initialGroupOrNull,
initialSampleTypeOrNull);
return createTab(getMessage(Dict.SAMPLE_BROWSER), browser);
return createTab(getTabTitle(), browser);
}
@Override
......@@ -132,16 +132,8 @@ public final class ComponentProvider
@Override
public String getTabTitle()
{
StringBuilder sb = new StringBuilder();
if (initialGroupOrNull != null)
{
sb.append(getMessage(Dict.GROUP) + "=" + initialGroupOrNull);
}
if (initialSampleTypeOrNull != null)
{
sb.append("type=" + initialSampleTypeOrNull);
}
return getMessage(Dict.SAMPLE_BROWSER) + " " + sb.toString();
return getMessage(Dict.SAMPLE_BROWSER);
}
};
}
......@@ -166,7 +158,7 @@ public final class ComponentProvider
IDisposableComponent browser =
MaterialBrowserGrid.createWithTypeChooser(viewContext,
initialMaterialTypeOrNull);
return createTab(getMessage(Dict.MATERIAL_BROWSER), browser);
return createTab(getTabTitle(), browser);
}
@Override
......@@ -184,12 +176,7 @@ public final class ComponentProvider
@Override
public String getTabTitle()
{
StringBuilder sb = new StringBuilder();
if (initialMaterialTypeOrNull != null)
{
sb.append("type=" + initialMaterialTypeOrNull);
}
return getMessage(Dict.MATERIAL_BROWSER) + " " + sb.toString();
return getMessage(Dict.MATERIAL_BROWSER);
}
};
......@@ -680,7 +667,6 @@ public final class ComponentProvider
return new HelpPageIdentifier(HelpPageDomain.EXPERIMENT, HelpPageAction.BROWSE);
}
// FIXME
@Override
public String getTabTitle()
{
......@@ -870,7 +856,6 @@ public final class ComponentProvider
return new HelpPageIdentifier(HelpPageDomain.DATA_SET, HelpPageAction.SEARCH);
}
// FIXME
@Override
public String getTabTitle()
{
......@@ -902,7 +887,6 @@ public final class ComponentProvider
return new HelpPageIdentifier(HelpPageDomain.SAMPLE, HelpPageAction.SEARCH);
}
// FIXME
@Override
public String getTabTitle()
{
......
......@@ -19,7 +19,9 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Header;
import com.google.gwt.user.client.Window;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.CommonViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction;
......@@ -150,6 +152,8 @@ public class DefaultTabItem implements ITabItem
{
lastModificationStateUpdaterOrNull.update();
}
Window.setTitle(getTabTitleUpdater().getCurrentTitle() + " - "
+ CommonViewContext.ClientStaticState.getPageTitleSuffix());
}
public void onClose()
......
......@@ -19,9 +19,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Dispatcher;
import com.google.gwt.user.client.Window;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.CommonViewContext;
/**
* A helper for using {@link Dispatcher}.
......@@ -52,8 +49,6 @@ public final class DispatcherHelper
{
AppEvent event = createEvent(AppEvents.NAVI_EVENT, tabItemFactory);
Dispatcher.get().dispatch(event);
Window.setTitle(tabItemFactory.getTabTitle() + " "
+ CommonViewContext.ClientStaticState.getPageTitleSuffix());
}
private final static AppEvent createEvent(EventType eventType, Object data)
......
......@@ -18,6 +18,14 @@ public class TabTitleUpdater
this.title = initialTitle;
}
/**
* Returns current title of the tab.
*/
String getCurrentTitle()
{
return title;
}
/**
* Updates the tab title if binded, stores the title value otherwise.
*/
......
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