本文整理汇总了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;
}
}
示例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);
}
}
示例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();
}
}
示例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()));
}
}
示例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));
}
}
示例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();
}
示例7: withActionHandler
import com.vaadin.event.Action.Handler; //导入依赖的package包/类
@Override
public PanelBuilder withActionHandler(Handler actionHandler) {
getInstance().addActionHandler(actionHandler);
return builder();
}
示例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();
}
}
}
示例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);
示例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();
}
示例11: addActionHandler
import com.vaadin.event.Action.Handler; //导入依赖的package包/类
public void addActionHandler(Handler actionHandler) {
m_actionHandlers.add(actionHandler);
}
示例12: removeActionHandler
import com.vaadin.event.Action.Handler; //导入依赖的package包/类
public void removeActionHandler(Handler actionHandler) {
m_actionHandlers.remove(actionHandler);
}