/** * {@inheritDoc} */ @Override public void displayUrl(String urlSpec, String target) { RemoteOpenUrlCommand openUrlCommand = new RemoteOpenUrlCommand(); openUrlCommand.setUrlSpec(urlSpec); openUrlCommand.setTarget(target); registerCommand(openUrlCommand); }
/** * {@inheritDoc} */ @Override public void setClipboardContent(String plainContent, String htmlContent) { RemoteClipboardCommand clipboardCommand = new RemoteClipboardCommand(); clipboardCommand.setPlainContent(plainContent); clipboardCommand.setHtmlContent(htmlContent); registerCommand(clipboardCommand); }
/** * {@inheritDoc} */ @Override public void setStatusInfo(String statusInfo) { RemoteUpdateStatusCommand updateStatusCommand = new RemoteUpdateStatusCommand(); updateStatusCommand.setStatus(statusInfo); registerCommand(updateStatusCommand); }
@Override public void valueChange(ValueChangeEvent evt) { IValueConnector connector = (IValueConnector) evt.getSource(); if (!isRecycling(connector)) { RemoteFormattedValueState state = (RemoteFormattedValueState) ((IRemoteStateOwner) connector).getState(); RemoteValueCommand command = new RemoteValueCommand(); command.setTargetPeerGuid(state.getGuid()); command.setValue(state.getValue()); command.setValueAsObject(state.getValueAsObject()); remoteCommandHandler.registerCommand(command); } } };
private void createAndRegisterRemoveChildrenCommand(RemoteCompositeValueState parentState, List<RemoteValueState> removedChildren) { RemoteChildrenCommand parentRemoveCommand = new RemoteChildrenCommand(); parentRemoveCommand.setTargetPeerGuid(parentState.getGuid()); parentRemoveCommand.setRemove(true); String[] removedChildrenGuids = new String[removedChildren.size()]; for (int i = 0; i < removedChildren.size(); i++) { removedChildrenGuids[i] = removedChildren.get(i).getGuid(); } parentRemoveCommand.setRemovedChildrenGuids(removedChildrenGuids); remoteCommandHandler.registerCommand(parentRemoveCommand); }
/** * {@inheritDoc} */ @Override protected void selectChildViewIndex(RComponent viewComponent, int index) { if (viewComponent instanceof RTabContainer) { RTabContainer rTab = ((RTabContainer) viewComponent); if (rTab.getSelectedIndex() != index) { rTab.setSelectedIndex(index); RemoteSelectionCommand selectionCommand = new RemoteSelectionCommand(); selectionCommand.setTargetPeerGuid(rTab.getGuid()); selectionCommand.setLeadingIndex(rTab.translateExcludingHiddenChildren(index)); getRemoteCommandHandler().registerCommand(selectionCommand); } } }
/** * {@inheritDoc} */ @Override public void setActionEnabled(RAction action, boolean enabled) { action.setEnabled(enabled); RemoteEnablementCommand command = new RemoteEnablementCommand(); command.setTargetPeerGuid(action.getGuid()); command.setEnabled(action.isEnabled()); remoteCommandHandler.registerCommand(command); }
/** * Add repeated sections. * * @param repeater * the repeater * @param extraSections * the extra sections */ protected void addRepeatedSections(RComponent repeater, List<RComponent> extraSections) { RemoteAddRepeatedCommand addRepeatedCommand = new RemoteAddRepeatedCommand(); addRepeatedCommand.setTargetPeerGuid(repeater.getGuid()); addRepeatedCommand.setNewSections(extraSections.toArray(new RComponent[extraSections.size()])); getRemoteCommandHandler().registerCommand(addRepeatedCommand); }
/** * {@inheritDoc} */ @Override public void edit(RComponent component) { RemoteEditCommand editCommand = new RemoteEditCommand(); editCommand.setTargetPeerGuid(component.getGuid()); getRemoteCommandHandler().registerCommand(editCommand); }
/** * {@inheritDoc} */ @Override public void focus(RComponent component) { RemoteFocusCommand focusCommand = new RemoteFocusCommand(); focusCommand.setTargetPeerGuid(component.getGuid()); getRemoteCommandHandler().registerCommand(focusCommand); }
/** * Creates an empty error message command. * * @return a empty error message command. */ protected RemoteErrorMessageCommand createDetailedErrorMessageCommand() { RemoteErrorMessageCommand messageCommand = new RemoteErrorMessageCommand(); messageCommand.setTitle(getTranslation("error", getLocale())); messageCommand.setTitleIcon(getIconFactory().getErrorIcon(getIconFactory().getTinyIconSize())); messageCommand.setMessageIcon(getIconFactory().getErrorIcon(getIconFactory().getLargeIconSize())); return messageCommand; }
/** * Notify application description change. */ @Override public void notifyApplicationDescriptionChange() { RemoteApplicationDescriptionCommand radCommand = new RemoteApplicationDescriptionCommand(); radCommand.setApplicationName(getI18nName(this, getLocale())); radCommand.setApplicationDescription(getI18nDescription(this, getLocale())); registerCommand(radCommand); } }
/** * Delegates to the frontend controller. * <p> * {@inheritDoc} */ @Override public void registerCommand(RemoteCommand command) { ((IRemoteCommandHandler) getFrontendController()).registerCommand(command); }
/** * Callback after a failed login. */ protected void loginFailed() { RemoteMessageCommand errorMessageCommand = createErrorMessageCommand(); errorMessageCommand.setMessage(getTranslation(LoginUtils.LOGIN_FAILED, getLocale())); registerCommand(errorMessageCommand); }
/** * Is idempotent boolean. * * @param command * the command * @return the boolean */ public boolean isIdempotent(RemoteCommand command) { return getRegistered(command.getTargetPeerGuid()) != null; }
@Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { RemoteEditCommand editCommand = new RemoteEditCommand(); registerCommand(editCommand, context); return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ @Override public boolean disposeModalDialog(RComponent sourceWidget, Map<String, Object> context) { if (super.disposeModalDialog(sourceWidget, context)) { registerCommand(new RemoteCloseDialogCommand()); transferFocus(context); return true; } return false; }
/** * {@inheritDoc} */ @Override protected void showCardInPanel(RComponent cardsPeer, String cardName) { RemoteValueState cardState = cardsPeer.getState(); cardState.setValue(cardName); RemoteValueCommand command = new RemoteValueCommand(); command.setTargetPeerGuid(cardState.getGuid()); command.setValue(cardState.getValue()); getRemoteCommandHandler().registerCommand(command); }
/** * {@inheritDoc} */ @Override protected void selectChildViewIndex(RComponent viewComponent, int index) { if (viewComponent instanceof RTabContainer) { RTabContainer rTab = ((RTabContainer) viewComponent); if (rTab.getSelectedIndex() != index) { rTab.setSelectedIndex(index); RemoteSelectionCommand selectionCommand = new RemoteSelectionCommand(); selectionCommand.setTargetPeerGuid(rTab.getGuid()); selectionCommand.setLeadingIndex(rTab.translateExcludingHiddenChildren(index)); getRemoteCommandHandler().registerCommand(selectionCommand); } } }
/** * Registers a command for remote execution. * * @param command * the command to register. * @param context * the action context. */ protected void registerCommand(RemoteCommand command, Map<String, Object> context) { ((IRemoteCommandHandler) getController(context)).registerCommand(command); } }