当前位置: 首页>>代码示例>>Java>>正文


Java Handler类代码示例

本文整理汇总了Java中com.vaadin.event.Action.Handler的典型用法代码示例。如果您正苦于以下问题:Java Handler类的具体用法?Java Handler怎么用?Java Handler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Handler类属于com.vaadin.event.Action包,在下文中一共展示了Handler类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setActionsForEachHalfHour

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
private void setActionsForEachHalfHour(Map<CalendarDateRange, Set<Action>> actionMap,
                                       ZonedDateTime start, ZonedDateTime end, Action.Handler actionHandler) {

    ZonedDateTime actionTime = start;
    while (actionTime.isBefore(end)) {

        ZonedDateTime endTime = actionTime.plus(30, ChronoUnit.MINUTES);

        CalendarDateRange range = new CalendarDateRange(actionTime, endTime);

        Action[] actions = actionHandler.getActions(range, this);
        if (actions != null) {
            Set<Action> actionSet = new LinkedHashSet<>(Arrays.asList(actions));
            actionMap.put(range, actionSet);
        }

        actionTime = endTime;
    }
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:20,代码来源:Calendar.java

示例2: setActionsForDay

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
private void setActionsForDay(Map<CalendarDateRange, Set<Action>> actionMap,
                              ZonedDateTime start, ZonedDateTime end, Action.Handler actionHandler) {

    CalendarDateRange range = new CalendarDateRange(start, end);
    Action[] actions = actionHandler.getActions(range, this);
    if (actions != null) {
        Set<Action> actionSet = new LinkedHashSet<>(Arrays.asList(actions));
        actionMap.put(range, actionSet);
    }
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:11,代码来源:Calendar.java

示例3: removeActionHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
@Override
public void removeActionHandler(Handler actionHandler) {
    if (actionHandlers != null && actionHandlers.contains(actionHandler)) {
        actionHandlers.remove(actionHandler);
        if (actionHandlers.isEmpty()) {
            actionHandlers = null;
            actionMapper = null;
        }
        markAsDirty();
    }
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:12,代码来源:Calendar.java

示例4: actionOnEmptyCell

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
@Override
public void actionOnEmptyCell(String actionKey, CalDate startDate, CalDate endDate) {

    Action action = actionMapper.get(actionKey);

    for (Action.Handler ah : actionHandlers) {
        ah.handleAction(action, Calendar.this,
                ZonedDateTime.of(startDate.y, startDate.m, startDate.d,
                        startDate.t.h, startDate.t.m, startDate.t.s, 0, getZoneId()));
    }

}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:13,代码来源:Calendar.java

示例5: actionOnItem

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
@Override
public void actionOnItem(String actionKey, CalDate startDate, CalDate endDate, int itemIndex) {

    Action action = actionMapper.get(actionKey);

    for (Action.Handler ah : actionHandlers) {
        ah.handleAction(action, Calendar.this, items.get(itemIndex));
    }
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:10,代码来源:Calendar.java

示例6: withActionHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
@Override
public B withActionHandler(Handler actionHandler) {
	ObjectUtils.argumentNotNull(actionHandler, "Handler must be not null");
	getInstance().getTable().addActionHandler(actionHandler);
	return builder();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:7,代码来源:AbstractTableItemListingBuilder.java

示例7: withActionHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
@Override
public PanelBuilder withActionHandler(Handler actionHandler) {
	getInstance().addActionHandler(actionHandler);
	return builder();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:6,代码来源:DefaultPanelBuilder.java

示例8: addActionHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
/**
 * Adds an action handler to the calendar that handles event produced by the
 * context menu.
 *
 * <p>
 * The {@link Handler#getActions(Object, Object)} parameters depend on what
 * view the Calendar is in:
 * <ul>
 * <li>If the Calendar is in <i>Day or Week View</i> then the target
 * parameter will be a {@link CalendarDateRange} with a range of
 * half-an-hour. The {@link Handler#getActions(Object, Object)} method will
 * be called once per half-hour slot.</li>
 * <li>If the Calendar is in <i>Month View</i> then the target parameter
 * will be a {@link CalendarDateRange} with a range of one day. The
 * {@link Handler#getActions(Object, Object)} will be called once for each
 * day.
 * </ul>
 * The Dates passed into the {@link CalendarDateRange} are in the same
 * timezone as the calendar is.
 * </p>
 *
 * <p>
 * The {@link Handler#handleAction(Action, Object, Object)} parameters
 * depend on what the context menu is called upon:
 * <ul>
 * <li>If the context menu is called upon an item then the target parameter
 * is the item, i.e. instanceof {@link CalendarItem}</li>
 * <li>If the context menu is called upon an empty slot then the target is a
 * {@link Date} representing that slot
 * </ul>
 * </p>
 */
@Override
public void addActionHandler(Handler actionHandler) {
    if (actionHandler != null) {
        if (actionHandlers == null) {
            actionHandlers = new LinkedList<>();
            actionMapper = new KeyMapper<>();
        }

        if (!actionHandlers.contains(actionHandler)) {
            actionHandlers.add(actionHandler);
            markAsDirty();
        }
    }
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:47,代码来源:Calendar.java

示例9: withActionHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
/**
 * Adds an Action {@link Handler} to the panel
 * @param actionHandler Action handler to add
 * @return this
 */
PanelBuilder withActionHandler(Handler actionHandler);
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:7,代码来源:PanelBuilder.java

示例10: getShortCutKeysHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
/**
 * Get the action handler for the short cut keys.
 * 
 * @return reference of {@link Handler} to handler the short cut keys.
 *         Default is null.
 */
protected Handler getShortCutKeysHandler() {
    return new TableShortCutHandler();
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:10,代码来源:AbstractTableLayout.java

示例11: addActionHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
public void addActionHandler(Handler actionHandler) {
	m_actionHandlers.add(actionHandler);
	
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:5,代码来源:TopologyComponent.java

示例12: removeActionHandler

import com.vaadin.event.Action.Handler; //导入依赖的package包/类
public void removeActionHandler(Handler actionHandler) {
	m_actionHandlers.remove(actionHandler);
	
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:5,代码来源:TopologyComponent.java


注:本文中的com.vaadin.event.Action.Handler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。