use of com.sencha.gxt.widget.core.client.TabItemConfig in project activityinfo by bedatadriven.
the class SubFormPane method addOrUpdateTab.
private void addOrUpdateTab(FormTree formTree, FormTree.Node node) {
TabItemConfig tabItemConfig = tabs.get(node.getFieldId());
if (tabItemConfig == null) {
SubFormReferenceType subFormType = (SubFormReferenceType) node.getType();
FormClass subForm = formTree.getFormClass(subFormType.getClassId());
TabItemConfig config = new TabItemConfig(subForm.getLabel());
tabs.put(node.getFieldId(), config);
add(new SubFormGrid(viewModel, subForm.getId()), config);
}
}
use of com.sencha.gxt.widget.core.client.TabItemConfig in project mvp4g2-examples by mvp4g.
the class ContentView method createView.
@Override
public void createView() {
this.container = new ContentPanel();
this.container.setHeaderVisible(false);
this.tabPanel = new PlainTabPanel();
this.container.setWidget(this.tabPanel);
this.tabPanel.setTabScroll(true);
this.defaultTabItem = new TabItemConfig("Sample Mail Application");
this.defaultTabItemContent = new HTML("");
this.tabPanel.add(this.defaultTabItemContent, this.defaultTabItem);
}
use of com.sencha.gxt.widget.core.client.TabItemConfig in project mvp4g2-examples by mvp4g.
the class ContentView method addContent.
@Override
public void addContent(String id, String subject, Widget widget) {
if (this.openEmails.get(id) == null) {
TabItemConfig tabItemConfig = new TabItemConfig(subject);
tabItemConfig.setClosable(true);
this.tabPanel.add(widget, tabItemConfig);
this.openEmails.put(id, widget);
}
showContent(id);
container.forceLayout();
}
use of com.sencha.gxt.widget.core.client.TabItemConfig in project activityinfo by bedatadriven.
the class LogicalTabPanel method onTap.
protected void onTap(Event event) {
XElement target = event.getEventTarget().cast();
Element item = findItem(target);
if (item != null) {
int index = itemIndex(item);
if (index < 0) {
return;
}
TabItemConfig config = getConfig(getModel(index));
if (config != null && !config.isEnabled()) {
return;
}
}
onClick(event);
}
use of com.sencha.gxt.widget.core.client.TabItemConfig in project activityinfo by bedatadriven.
the class LogicalTabPanel method onBrowserEvent.
@Override
public void onBrowserEvent(Event event) {
XElement target = event.getEventTarget().cast();
if (target == null) {
return;
}
boolean isbar = appearance.getBar(getElement()).isOrHasChild(target);
boolean orig = disableContextMenu;
// allow right clicks in tab panel body
if (!isbar && disableContextMenu) {
disableContextMenu = false;
}
super.onBrowserEvent(event);
if (!isbar) {
disableContextMenu = orig;
return;
}
Element item = findItem(target);
if (item != null) {
int index = itemIndex(item);
if (index < 0) {
// tab may have already closed
return;
}
TabItemConfig config = getConfig(getModel(index));
if (config != null && !config.isEnabled()) {
return;
}
}
switch(event.getTypeInt()) {
case Event.ONCLICK:
onClick(event);
break;
case Event.ONMOUSEOVER:
appearance.onMouseOver(getElement(), event.getEventTarget().<XElement>cast());
break;
case Event.ONMOUSEOUT:
appearance.onMouseOut(getElement(), event.getEventTarget().<XElement>cast());
break;
}
}
Aggregations