Search in sources :

Example 1 with TabItemConfig

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);
    }
}
Also used : SubFormReferenceType(org.activityinfo.model.type.subform.SubFormReferenceType) FormClass(org.activityinfo.model.form.FormClass) TabItemConfig(com.sencha.gxt.widget.core.client.TabItemConfig)

Example 2 with TabItemConfig

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);
}
Also used : PlainTabPanel(com.sencha.gxt.widget.core.client.PlainTabPanel) TabItemConfig(com.sencha.gxt.widget.core.client.TabItemConfig) HTML(com.google.gwt.user.client.ui.HTML) ContentPanel(com.sencha.gxt.widget.core.client.ContentPanel)

Example 3 with TabItemConfig

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();
}
Also used : TabItemConfig(com.sencha.gxt.widget.core.client.TabItemConfig)

Example 4 with TabItemConfig

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);
}
Also used : XElement(com.sencha.gxt.core.client.dom.XElement) XElement(com.sencha.gxt.core.client.dom.XElement) Element(com.google.gwt.dom.client.Element) FxElement(com.sencha.gxt.fx.client.FxElement) TabItemConfig(com.sencha.gxt.widget.core.client.TabItemConfig) Point(com.sencha.gxt.core.client.util.Point)

Example 5 with TabItemConfig

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;
    }
}
Also used : XElement(com.sencha.gxt.core.client.dom.XElement) XElement(com.sencha.gxt.core.client.dom.XElement) Element(com.google.gwt.dom.client.Element) FxElement(com.sencha.gxt.fx.client.FxElement) TabItemConfig(com.sencha.gxt.widget.core.client.TabItemConfig) Point(com.sencha.gxt.core.client.util.Point)

Aggregations

TabItemConfig (com.sencha.gxt.widget.core.client.TabItemConfig)6 Point (com.sencha.gxt.core.client.util.Point)3 Element (com.google.gwt.dom.client.Element)2 XElement (com.sencha.gxt.core.client.dom.XElement)2 FxElement (com.sencha.gxt.fx.client.FxElement)2 HTML (com.google.gwt.user.client.ui.HTML)1 HasOneWidget (com.google.gwt.user.client.ui.HasOneWidget)1 IsWidget (com.google.gwt.user.client.ui.IsWidget)1 Widget (com.google.gwt.user.client.ui.Widget)1 XDOM (com.sencha.gxt.core.client.dom.XDOM)1 ContentPanel (com.sencha.gxt.widget.core.client.ContentPanel)1 PlainTabPanel (com.sencha.gxt.widget.core.client.PlainTabPanel)1 HideEvent (com.sencha.gxt.widget.core.client.event.HideEvent)1 HideHandler (com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler)1 Menu (com.sencha.gxt.widget.core.client.menu.Menu)1 MenuItem (com.sencha.gxt.widget.core.client.menu.MenuItem)1 ArrayList (java.util.ArrayList)1 FormClass (org.activityinfo.model.form.FormClass)1 SubFormReferenceType (org.activityinfo.model.type.subform.SubFormReferenceType)1