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


Java Action类代码示例

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


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

示例1: getActions

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public Action[] getActions(Object target, Object sender) {
    // The target should be a CalendarDateRage for the
    // entire day from midnight to midnight.
    if (!(target instanceof CalendarDateRange))
        return null;
    CalendarDateRange dateRange = (CalendarDateRange) target;

    // The sender is the Calendar object
    if (!(sender instanceof Calendar))
        return null;
    Calendar calendar = (Calendar) sender;

    // List all the events on the requested day
    List<CalendarEvent> events = calendar.getEvents(dateRange.getStart(), dateRange.getEnd());

    if (events.size() == 0)
        return new Action[]{addEventAction};
    else
        return new Action[]{addEventAction, copyEventAction, deleteEventAction};
}
 
开发者ID:Haulmont,项目名称:platform-sample-timesheets,代码行数:22,代码来源:CalendarScreen.java

示例2: handleAction

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
        public void handleAction(final Action action, final Object sender,
                final Object target) {
            if (action == report) {
//                createNewReportFromSelection();
            } else if (action == discard) {
                Notification.show("Not implemented in this demo");
            } else if (action == details) {
                Item item = ((Table) sender).getItem(target);
                if (item != null) {
                    Long movieId = (Long) item.getItemProperty("movieId")
                            .getValue();
                    MovieDetailsWindow.open(DashboardUI.getDataProvider()
                            .getMovie(movieId), null, null);
                }
            }
        }
 
开发者ID:imotSpot,项目名称:imotSpot,代码行数:18,代码来源:TransactionsView.java

示例3: handleAction

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public void handleAction(final Action action, final Object sender,
        final Object target) {
    if (action == report) {
        createNewReportFromSelection();
    } else if (action == discard) {
        Notification.show("Not implemented in this demo");
    } else if (action == details) {
        Item item = ((Table) sender).getItem(target);
        if (item != null) {
            Long movieId = (Long) item.getItemProperty("movieId")
                    .getValue();
            MovieDetailsWindow.open(DashboardUI.getDataProvider()
                    .getMovie(movieId), null, null);
        }
    }
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:18,代码来源:TransactionsView.java

示例4: getActions

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public Action[] getActions(Object target, Object sender) {
    if (target instanceof Folder) {
        if (isGlobalAppFolderPermitted()) {
            return new Action[] {openAction, createAction, copyAction,
                    editAction, removeAction, exportAction, importAction};
        } else {
            return new Action[] {openAction};
        }
    } else {
        if (isGlobalAppFolderPermitted()) {
            return new Action[] {importAction};
        } else {
            return null;
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:CubaFoldersPane.java

示例5: onTabContextMenu

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public void onTabContextMenu(int tabIndex) {
    Tab tab = getTab(tabIndex);
    if (tab != null) {
        Set<Action> actions = getActions(CubaTabSheet.this.getActionTarget(tab));

        if (!actions.isEmpty()) {
            actionMapper = new KeyMapper<>();

            List<ClientAction> actionsList = new ArrayList<>(actions.size());
            for (Action action : actions) {
                ClientAction clientAction = new ClientAction(action.getCaption());
                clientAction.setActionId(actionMapper.key(action));
                actionsList.add(clientAction);
            }

            ClientAction[] clientActions = actionsList.toArray(new ClientAction[actions.size()]);

            getRpcProxy(CubaTabSheetClientRpc.class).showTabContextMenu(tabIndex, clientActions);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:CubaTabSheet.java

示例6: performAction

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public void performAction(int tabIndex, String actionKey) {
    Tab tab = getTab(tabIndex);
    if (tab != null) {
        if (actionMapper != null) {
            Action action = actionMapper.get(actionKey);
            Action.Handler[] handlers;

            if (actionHandlers != null) {
                handlers = actionHandlers.toArray(new Action.Handler[actionHandlers.size()]);
            } else {
                handlers = new Action.Handler[0];
            }

            for (Action.Handler handler : handlers) {
                handler.handleAction(action, this, CubaTabSheet.this.getActionTarget(tab));
            }

            // forget all painted actions after perform one
            actionMapper = null;
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:24,代码来源:CubaTabSheet.java

示例7: onWindowContextMenu

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public void onWindowContextMenu() {
    HashSet<Action> actions = getContextActions(CubaWindow.this);

    if (!actions.isEmpty()) {
        contextActionMapper = new KeyMapper<>();

        List<ClientAction> actionsList = new ArrayList<>(actions.size());
        for (Action action : actions) {
            ClientAction clientAction = new ClientAction(action.getCaption());
            clientAction.setActionId(contextActionMapper.key(action));
            actionsList.add(clientAction);
        }

        ClientAction[] clientActions = actionsList.toArray(new ClientAction[actions.size()]);

        getRpcProxy(CubaWindowClientRpc.class).showTabContextMenu(clientActions);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:CubaWindow.java

示例8: handleAction

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public void handleAction(Action action, Object sender, Object target) {
    TabSheetBehaviour tabSheetBehaviour = tabSheet.getTabSheetBehaviour();
    if (initialized) {
        if (closeCurrentTab == action) {
            tabSheetBehaviour.closeTab((com.vaadin.ui.Component) target);
        } else if (closeOtherTabs == action) {
            tabSheetBehaviour.closeOtherTabs((com.vaadin.ui.Component) target);
        } else if (closeAllTabs == action) {
            tabSheetBehaviour.closeAllTabs();
        } else if (showInfo == action) {
            showInfo(target);
        } else if (analyzeLayout == action) {
            analyzeLayout(target);
        } else if (saveSettings == action) {
            saveSettings(target);
        } else if (restoreToDefaults == action) {
            restoreToDefaults(target);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:MainTabSheetActionHandler.java

示例9: paintActions

import com.vaadin.event.Action; //导入依赖的package包/类
private void paintActions(PaintTarget target, final Set<Action> actionSet)
        throws PaintException {
    if (!actionSet.isEmpty()) {
        target.addVariable(this, "action", "");
        target.startTag("actions");
        for (Action a : actionSet) {
            target.startTag("action");
            if (a.getCaption() != null) {
                target.addAttribute("caption", a.getCaption());
            }
            if (a.getIcon() != null) {
                target.addAttribute("icon", a.getIcon());
            }
            target.addAttribute("key", actionMapper.key(a));
            target.endTag("action");
        }
        target.endTag("actions");
    }
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:20,代码来源:OpenLayersMap.java

示例10: findAndPaintBodyActions

import com.vaadin.event.Action; //导入依赖的package包/类
private Set<Action> findAndPaintBodyActions(PaintTarget target) {
    Set<Action> actionSet = new LinkedHashSet<Action>();
    if (actionHandlers != null) {
        final ArrayList<String> keys = new ArrayList<String>();
        for (Action.Handler ah : actionHandlers) {
            // Getting actions for the null item, which in this case means
            // the body item
            final Action[] actions = ah.getActions(this, this);
            if (actions != null) {
                for (Action action : actions) {
                    actionSet.add(action);
                    keys.add(actionMapper.key(action));
                }
            }
        }
        target.addAttribute("alb", keys.toArray());
    }
    return actionSet;
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:20,代码来源:OpenLayersMap.java

示例11: getActions

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public Action[] getActions(Object target, Object sender) {
	
	Action[] actions;
	
	if(crudComponent.isReadOnly()) {
		actions = new Action[] {
			ACTION_REFRESH,
			ACTION_EXPORT_TO_EXCEL,
			ACTION_SHOW_COUNT
		};
	} else {
		actions = new Action[] {
			ACTION_REFRESH,
			ACTION_IMPORT_FROM_CLIPBOARD,
			ACTION_EXPORT_TO_EXCEL,
			ACTION_SHOW_COUNT
		};
	}
	
	return actions;
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:23,代码来源:CrudListener.java

示例12: getActions

import com.vaadin.event.Action; //导入依赖的package包/类
@Override
public Action[] getActions(Object target, Object sender) {
	List<Action> actions = new ArrayList<Action>();
	
	actions.add(ACTION_COPY_CELL_REGISTER);
	actions.add(ACTION_ADD_FILTER_REGISTER);
	actions.add(ACTION_REMOVE_FILTER_REGISTER);
	actions.add(ACTION_REMOVE_ALL_FILTER_REGISTER);				 
	 
	if (listenerAddButton != null)
		 actions.add(ACTION_ADD_REGISTER);

	if (listenerEditButton != null)
		 actions.add(ACTION_EDIT_REGISTER);

	if (listenerRemoveButton != null)
		 actions.add(ACTION_DELETE_REGISTER);
			
	return actions.toArray(new Action[actions.size()]);
	
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:22,代码来源:DataGridView.java

示例13: setActionsForEachHalfHour

import com.vaadin.event.Action; //导入依赖的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

示例14: setActionsForDay

import com.vaadin.event.Action; //导入依赖的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

示例15: createActionsList

import com.vaadin.event.Action; //导入依赖的package包/类
private List<CalendarState.Action> createActionsList(Map<CalendarDateRange, Set<Action>> actionMap) {

        if (actionMap.isEmpty()) {
            return null;
        }

        List<CalendarState.Action> calendarActions = new ArrayList<>();

        for (Entry<CalendarDateRange, Set<Action>> entry : actionMap.entrySet()) {

            CalendarDateRange range = entry.getKey();

            for (Action action : entry.getValue()) {
                String key = actionMapper.key(action);
                CalendarState.Action calendarAction = new CalendarState.Action();
                calendarAction.actionKey = key;
                calendarAction.caption = action.getCaption();
                setResource(key, action.getIcon());
                calendarAction.iconKey = key;
                calendarAction.startDate = ACTION_DATE_TIME_FORMAT.format(range.getStart());
                calendarAction.endDate = ACTION_DATE_TIME_FORMAT.format(range.getEnd());
                calendarActions.add(calendarAction);
            }
        }

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


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