Created
August 26, 2015 14:02
-
-
Save peterdresslar/afc146dea4184588379a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gwtplatform.samples.tab.client.application.dialog; | |
import javax.inject.Inject; | |
import com.google.gwt.uibinder.client.UiBinder; | |
import com.google.gwt.uibinder.client.UiField; | |
import com.google.gwt.user.client.ui.IsWidget; | |
import com.google.gwt.user.client.ui.Widget; | |
import com.gwtplatform.mvp.client.Tab; | |
import com.gwtplatform.mvp.client.TabData; | |
import com.gwtplatform.mvp.client.ViewImpl; | |
import com.gwtplatform.samples.tab.client.application.home.HomePresenter; | |
import com.gwtplatform.samples.tab.client.application.ui.tabs.SimpleTabPanel; | |
/** | |
* The view implementation for {@link com.gwtplatform.samples.tab.client.application.dialog.DialogSamplePresenter}. | |
*/ | |
public class DialogSampleView extends ViewImpl implements DialogSamplePresenter.MyView { | |
interface Binder extends UiBinder<Widget, DialogSampleView> { | |
} | |
@UiField(provided = true) | |
SimpleTabPanel tabPanel; | |
@Inject | |
DialogSampleView( | |
Binder uiBinder, | |
SimpleTabPanel tabPanel) { | |
this.tabPanel = tabPanel; | |
initWidget(uiBinder.createAndBindUi(this)); | |
} | |
@Override | |
public Tab addTab(TabData tabData, String historyToken) { | |
return tabPanel.addTab(tabData, historyToken); | |
} | |
@Override | |
public void removeTab(Tab tab) { | |
tabPanel.removeTab(tab); | |
} | |
@Override | |
public void removeTabs() { | |
tabPanel.removeTabs(); | |
} | |
@Override | |
public void setActiveTab(Tab tab) { | |
tabPanel.setActiveTab(tab); | |
} | |
@Override | |
public void changeTab(Tab tab, TabData tabData, String historyToken) { | |
tabPanel.changeTab(tab, tabData, historyToken); | |
} | |
@Override | |
public void setInSlot(Object slot, IsWidget content) { | |
if (slot == HomePresenter.SLOT_SetTabContent) { | |
tabPanel.setPanelContent(content); | |
} else { | |
super.setInSlot(slot, content); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment