@Test public void testCanHandle() { Assert.assertFalse(action.canHandle(context)); }
@Override public boolean canHandle(ActionContext context) { ActionContextImpl actionContext = (ActionContextImpl) context; MCTHousing targetHousing = actionContext.getTargetHousing(); if (targetHousing == null) return false; AbstractComponent rootComponent = targetHousing.getWindowComponent(); if (rootComponent == null) return false; if (PlatformAccess.getPlatform().getRootComponent() == rootComponent) return false; List<? extends RadioAction> actions = componentActionsMap.get(rootComponent); if (actions == null) { List<ChangeSpecificViewAction> changeViewActions = new ArrayList<ChangeSpecificViewAction>(); Set<ViewInfo> viewInfos = new LinkedHashSet<ViewInfo>(); viewInfos.addAll(rootComponent.getViewInfos(ViewType.CENTER)); viewInfos.addAll(rootComponent.getViewInfos(ViewType.OBJECT)); for (ViewInfo viewInfo : viewInfos) { changeViewActions.add(new ChangeSpecificViewAction(viewInfo, actionContext)); } setActions(changeViewActions.toArray(new RadioAction[changeViewActions.size()])); componentActionsMap.put(rootComponent, changeViewActions); } else { for (ChangeSpecificViewAction action : actions.toArray(new ChangeSpecificViewAction[actions.size()])) action.setContext(actionContext); setActions(actions.toArray(new RadioAction[actions.size()])); } return true; }
ChangeHousingViewAction extends GroupAction { @Override public boolean canHandle(ActionContext context) { ActionContextImpl actionContext = (ActionContextImpl) context; MCTHousing targetHousing = actionContext.getTargetHousing(); if (targetHousing == null) return false; AbstractComponent rootComponent = targetHousing.getWindowComponent(); if (rootComponent == null) return false; if (PlatformAccess.getPlatform().getRootComponent() == rootComponent) return false; List<? extends RadioAction> actions = componentActionsMap.get(rootComponent); if (actions == null) { List<ChangeSpecificViewAction> changeViewActions = new ArrayList<ChangeSpecificViewAction>(); Set<ViewInfo> viewInfos = new LinkedHashSet<ViewInfo>(); viewInfos.addAll(rootComponent.getViewInfos(ViewType.CENTER)); viewInfos.addAll(rootComponent.getViewInfos(ViewType.OBJECT)); for (ViewInfo viewInfo : viewInfos) { changeViewActions.add(new ChangeSpecificViewAction(viewInfo, actionContext)); } setActions(changeViewActions.toArray(new RadioAction[changeViewActions.size()])); componentActionsMap.put(rootComponent, changeViewActions); } else { for (ChangeSpecificViewAction action : actions.toArray(new ChangeSpecificViewAction[actions.size()])) action.setContext(actionContext); setActions(actions.toArray(new RadioAction[actions.size()])); } return true; } }
ChangeHousingViewAction extends GroupAction { @Override public boolean canHandle(ActionContext context) { ActionContextImpl actionContext = (ActionContextImpl) context; MCTHousing targetHousing = actionContext.getTargetHousing(); if (targetHousing == null) return false; AbstractComponent rootComponent = targetHousing.getWindowComponent(); if (rootComponent == null) return false; if (PlatformAccess.getPlatform().getRootComponent() == rootComponent) return false; List<? extends RadioAction> actions = componentActionsMap.get(rootComponent); if (actions == null) { List<ChangeSpecificViewAction> changeViewActions = new ArrayList<ChangeSpecificViewAction>(); Set<ViewInfo> viewInfos = new LinkedHashSet<ViewInfo>(); viewInfos.addAll(rootComponent.getViewInfos(ViewType.CENTER)); viewInfos.addAll(rootComponent.getViewInfos(ViewType.OBJECT)); for (ViewInfo viewInfo : viewInfos) { changeViewActions.add(new ChangeSpecificViewAction(viewInfo, actionContext)); } setActions(changeViewActions.toArray(new RadioAction[changeViewActions.size()])); componentActionsMap.put(rootComponent, changeViewActions); } else { for (ChangeSpecificViewAction action : actions.toArray(new ChangeSpecificViewAction[actions.size()])) action.setContext(actionContext); setActions(actions.toArray(new RadioAction[actions.size()])); } return true; } ChangeHousingViewAction(); protected  ChangeHousingViewAction(String name); }
ChangeHousingViewAction extends GroupAction { @Override public boolean canHandle(ActionContext context) { ActionContextImpl actionContext = (ActionContextImpl) context; MCTHousing targetHousing = actionContext.getTargetHousing(); if (targetHousing == null) return false; AbstractComponent rootComponent = targetHousing.getWindowComponent(); if (rootComponent == null) return false; if (PlatformAccess.getPlatform().getRootComponent() == rootComponent) return false; List<? extends RadioAction> actions = componentActionsMap.get(rootComponent); if (actions == null) { List<ChangeSpecificViewAction> changeViewActions = new ArrayList<ChangeSpecificViewAction>(); Set<ViewInfo> viewInfos = new LinkedHashSet<ViewInfo>(); viewInfos.addAll(rootComponent.getViewInfos(ViewType.CENTER)); viewInfos.addAll(rootComponent.getViewInfos(ViewType.OBJECT)); for (ViewInfo viewInfo : viewInfos) { changeViewActions.add(new ChangeSpecificViewAction(viewInfo, actionContext)); } setActions(changeViewActions.toArray(new RadioAction[changeViewActions.size()])); componentActionsMap.put(rootComponent, changeViewActions); } else { for (ChangeSpecificViewAction action : actions.toArray(new ChangeSpecificViewAction[actions.size()])) action.setContext(actionContext); setActions(actions.toArray(new RadioAction[actions.size()])); } return true; } ChangeHousingViewAction(); protected  ChangeHousingViewAction(String name); @Override void actionPerformed(ActionEvent e); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled(); }
ChangeHousingViewAction extends GroupAction { @Override public boolean canHandle(ActionContext context) { ActionContextImpl actionContext = (ActionContextImpl) context; MCTHousing targetHousing = actionContext.getTargetHousing(); if (targetHousing == null) return false; AbstractComponent rootComponent = targetHousing.getWindowComponent(); if (rootComponent == null) return false; if (PlatformAccess.getPlatform().getRootComponent() == rootComponent) return false; List<? extends RadioAction> actions = componentActionsMap.get(rootComponent); if (actions == null) { List<ChangeSpecificViewAction> changeViewActions = new ArrayList<ChangeSpecificViewAction>(); Set<ViewInfo> viewInfos = new LinkedHashSet<ViewInfo>(); viewInfos.addAll(rootComponent.getViewInfos(ViewType.CENTER)); viewInfos.addAll(rootComponent.getViewInfos(ViewType.OBJECT)); for (ViewInfo viewInfo : viewInfos) { changeViewActions.add(new ChangeSpecificViewAction(viewInfo, actionContext)); } setActions(changeViewActions.toArray(new RadioAction[changeViewActions.size()])); componentActionsMap.put(rootComponent, changeViewActions); } else { for (ChangeSpecificViewAction action : actions.toArray(new ChangeSpecificViewAction[actions.size()])) action.setContext(actionContext); setActions(actions.toArray(new RadioAction[actions.size()])); } return true; } ChangeHousingViewAction(); protected  ChangeHousingViewAction(String name); @Override void actionPerformed(ActionEvent e); @Override boolean canHandle(ActionContext context); @Override boolean isEnabled();  }