當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.Ordered方法代碼示例

本文整理匯總了Java中com.vaadin.data.Container.Ordered方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.Ordered方法的具體用法?Java Container.Ordered怎麽用?Java Container.Ordered使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.data.Container的用法示例。


在下文中一共展示了Container.Ordered方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateButtonStatus

import com.vaadin.data.Container; //導入方法依賴的package包/類
private void updateButtonStatus() {
    Container.Ordered ctr = nav.getContainer();
    if (ctr == null) {
        disable(allActions);
        return;
    } else {
        enable(allActions);
    }

    Object currentId = nav.getCurrentItemId();

    boolean hasNext = false;
    boolean hasPrev = false;

    if(currentId != null){
        hasNext = null != ctr.nextItemId(currentId);
        hasPrev = null != ctr.prevItemId(currentId);
    }

    next.setEnabled(hasNext);
    prev.setEnabled(hasPrev);
    first.setEnabled(hasPrev);
    last.setEnabled(hasNext);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:25,代碼來源:KeyBinder.java

示例2: withDefaultBehavior

import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
 * Assign a default behavior according to the current known container type.
 *
 * Uses a {@link org.tylproject.vaadin.addon.fieldbinder.behavior.BehaviorFactory}.
 * There are two BehaviorFactories:
 *
 *  <ul>
 *      <li>{@link org.tylproject.vaadin.addon.fieldbinder.behavior.DefaultBehaviorFactory}</li>
 *      <li>{@link org.tylproject.vaadin.addon.fieldbinder.behavior.DefaultTableBehaviorFactory}</li>
 *  </ul>
 *
 */
public BasicDataNavigation withDefaultBehavior() {

    if (behaviorFactory == null) {
        throw new IllegalStateException(
                "Cannot automatically assign a default behavior: no BehaviorFactory");
    }

    try {
        Class<? extends Container.Ordered> containerClass = getContainerType();
        Behavior behavior = behaviorFactory.forContainerType(containerClass);
        return this.withBehavior(behavior);

    } catch (IllegalStateException ex) {
        throw new IllegalStateException(
                "Cannot automatically assign a default behavior.", ex);
    }


}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:32,代碼來源:BasicDataNavigation.java

示例3: updateButtonStatus

import com.vaadin.data.Container; //導入方法依賴的package包/類
protected void updateButtonStatus() {
    Container.Ordered ctr = getNavigation().getContainer();
    if (ctr == null || !getNavigation().isNavigationEnabled()) {
        disable(navButtons);
        return;
    } else {
        enable(navButtons);
    }

    Object currentId = getNavigation().getCurrentItemId();
    if (currentId == null) {
        disable(navButtons);
        return;
    }

    boolean hasNext = false;
    boolean hasPrev = false;

    if(currentId != null){
        hasNext = null != ctr.nextItemId(currentId);
        hasPrev = null != ctr.prevItemId(currentId);
    }

    nextButton.setEnabled(hasNext);
    prevButton.setEnabled(hasPrev);
    firstButton.setEnabled(hasPrev);
    lastButton.setEnabled(hasNext);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:29,代碼來源:NavButtonBar.java

示例4: getContainerType

import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
 * Return the container type for this DataNavigation
 */
public @Nonnull Class<? extends Container.Ordered> getContainerType() {
    if (container != null) {
        return container.getClass();
    }
    else {
        throw new IllegalStateException("The container type is currently unknown: " +
                "a container must be set with setContainer(), " +
                "or an upper bound must be given with restrictContainerType()");
    }
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:14,代碼來源:BasicDataNavigation.java

示例5: setContainer

import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
public void setContainer(Container.Ordered container) {

    this.container = container;
    this.currentItemId = null;
    if (container == null || container.size() == 0) disableNavigation();
    if (container instanceof Container.Filterable) enableFind();
    else disableFind();

    first();
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:12,代碼來源:BasicDataNavigation.java

示例6: FieldBinder

import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
 * Creates a FieldBinder that will use the given container as the backing
 * for the values of its fields.
 *
 * {@link #getNavigation()} returns a controller on top of that container
 *
 *
 * @param beanClass
 * @param container
 */
public FieldBinder(Class<T> beanClass, Container.Ordered container) {
    super(new FieldGroup());
    this.beanClass = beanClass;
    this.dynaClass = WrapDynaClass.createDynaClass(beanClass);

    BasicDataNavigation nav = new BasicDataNavigation(container);
    nav.setBehaviorFactory(new DefaultBehaviorFactory<>(this));

    this.navigation = nav;

}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:22,代碼來源:FieldBinder.java

示例7: BasicDataNavigation

import com.vaadin.data.Container; //導入方法依賴的package包/類
public BasicDataNavigation(@Nonnull final Container.Ordered container) {
    setContainer(container);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:4,代碼來源:BasicDataNavigation.java

示例8: getContainer

import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
public Container.Ordered getContainer() {
    return container;
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:5,代碼來源:BasicDataNavigation.java

示例9: getContainerDataSource

import com.vaadin.data.Container; //導入方法依賴的package包/類
public Container.Ordered getContainerDataSource() {
    return getListContainer();
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:4,代碼來源:CollectionTabularView.java

示例10: setContainerDataSource

import com.vaadin.data.Container; //導入方法依賴的package包/類
public void setContainerDataSource(Container.Ordered container) {
    this.getTable().setContainerDataSource(container);
    getNavigation().setContainer(container);
    getNavigation().enableNavigation();
    getNavigation().first();
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:7,代碼來源:BeanTable.java

示例11: getContainerDataSource

import com.vaadin.data.Container; //導入方法依賴的package包/類
public Container.Ordered getContainerDataSource() {
    return (Container.Ordered) this.getTable().getContainerDataSource();
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:4,代碼來源:BeanTable.java

示例12: TableZoomDialog

import com.vaadin.data.Container; //導入方法依賴的package包/類
public TableZoomDialog(Object propertyId, Container.Ordered zoomCollection) {
    this(new BeanTable<>(Object.class, zoomCollection));
    withContainerPropertyId(propertyId, zoomCollection.getType(propertyId));
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:5,代碼來源:TableZoomDialog.java

示例13: setContainer

import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
 * Bind the Navigation to the given Container.
 *
 * Container may cleared by passing null.
 * The method may invoke first() to bring the Navigation to a consistent state.
 *
 */
public void setContainer(Container.Ordered container);
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:9,代碼來源:DataNavigation.java

示例14: buildDefaultButtonBar

import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
 * Generates a default button bar implementation binding to this FieldBinder's built-in
 * {@link org.tylproject.vaadin.addon.datanav.DataNavigation} instance
 *
 */
public ButtonBar buildDefaultButtonBar(Container.Ordered container) {
    getNavigation().setContainer(container);
    return new ButtonBar(navigation);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:10,代碼來源:FieldBinder.java

示例15: BeanTable

import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
 * Constructs a BeanTable  for the given class, the given container,
 * and the given table instance
 *
 * @param beanClass
 * @param container
 */
public BeanTable(final Class<T> beanClass, final Container.Ordered container) {
    super(beanClass);
    setContainerDataSource(container);
}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:12,代碼來源:BeanTable.java


注:本文中的com.vaadin.data.Container.Ordered方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。