/** * {@inheritDoc} */ public void handleMessage(String msg) { if (msg.startsWith(MESSAGE_ROOT)) { String[] messageParts = msg.split(SEPARATOR); if (messageParts.length != 2) { throw new IllegalArgumentException("usage: " + MESSAGE_ROOT + " <file>"); } String pathname = messageParts[1]; File file = new File(pathname); UISession.currentSession().sendMessage(Boolean.toString(file.exists())); } } }
private void handleSetActions(Anything args) { List<UIIcon> icons = new ArrayList<UIIcon>(); List<Action> actions = new ArrayList<Action>(); Anything iconsAnything = args.get(ActionFieldConstants.ICONS_KEY); for (int index = 0; index < iconsAnything.size(); index++) { icons.add((UIIcon) getSession().getManaged(UIIcon.class, iconsAnything.get(index))); } Anything actionsAnything = args.get(ActionFieldConstants.ACTIONS_KEY); for (int index = 0; index < actionsAnything.size(); index++) { actions.add(anythingToAction(index, actionsAnything.get(index), icons .get(index))); } getBasicObject().setActions(actions); }
private void handleSetActions(Anything args) { List<UIIcon> icons = new ArrayList<UIIcon>(); List<Action> actions = new ArrayList<Action>(); Anything iconsAnything = args.get(ActionFieldConstants.ICONS_KEY); for (int index = 0; index < iconsAnything.size(); index++) { icons.add((UIIcon) getSession().getManaged(UIIcon.class, iconsAnything.get(index))); } Anything actionsAnything = args.get(ActionFieldConstants.ACTIONS_KEY); for (int index = 0; index < actionsAnything.size(); index++) { actions.add(anythingToAction(index, actionsAnything.get(index), icons .get(index))); } getBasicObject().setActions(actions); }
/** * {@inheritDoc} */ public void handleMessage(String msg) { if (msg.startsWith(MESSAGE_ROOT)) { String[] messageParts = msg.split(SEPARATOR); if (messageParts.length != 2) { throw new IllegalArgumentException("usage: " + MESSAGE_ROOT + " <file>"); } String pathname = messageParts[1]; File file = new File(pathname); UISession.currentSession().sendMessage(Boolean.toString(file.exists())); } } }