/** * {@inheritDoc} * * @return the object */ @Override public Object actualValue() { return getState().getValue(); }
@Override protected void attachBackgroundListener(RComponent viewComponent, IValueConnector backgroundConnector) { if (viewComponent.getBackgroundState() == null) { // Not previously set by view creation if (backgroundConnector instanceof IRemoteStateOwner) { viewComponent.setBackgroundState(((IRemoteStateOwner) backgroundConnector).getState()); } } }
@Override protected void attachFontListener(RComponent viewComponent, IValueConnector fontConnector) { ((RemoteValueConnector) fontConnector).setRemoteStateValueMapper(FONT_MAPPER); if (viewComponent.getFontState() == null) { // Not previously set by view creation if (fontConnector instanceof IRemoteStateOwner) { viewComponent.setFontState(((IRemoteStateOwner) fontConnector).getState()); } } }
@Override protected void attachToolTipListener(RComponent viewComponent, IValueConnector toolTipConnector) { if (viewComponent.getToolTipState() == null) { // Not previously set by view creation if (toolTipConnector instanceof IRemoteStateOwner) { viewComponent.setToolTipState(((IRemoteStateOwner) toolTipConnector).getState()); } } } }
@Override protected void attachLabelListener(RComponent viewComponent, IValueConnector labelConnector) { if (viewComponent.getLabelState() == null) { // Not previously set by view creation if (labelConnector instanceof IRemoteStateOwner) { viewComponent.setLabelState(((IRemoteStateOwner) labelConnector).getState()); } } }
/** * {@inheritDoc} */ @Override public IView<RComponent> constructView(RComponent viewComponent, IViewDescriptor descriptor, IValueConnector connector) { IView<RComponent> view = super.constructView(viewComponent, descriptor, connector); if (connector instanceof IPermIdSource) { ((IPermIdSource) connector).setPermId(descriptor.getPermId()); } if (viewComponent.getState() == null) { viewComponent.setState(((IRemoteStateOwner) connector).getState()); } viewComponent.setPermId(descriptor.getPermId()); return view; }
actionHandler.pushToSecurityContext(actionMap); RActionList[] defaultActionLists = peer.getActionLists(); List<RActionList> declaredActionLists = createViewActionMap(actionMap, view, actionHandler, locale); if (defaultActionLists != null || declaredActionLists != null) { viewActionLists.addAll(declaredActionLists); peer.setActionLists(viewActionLists.toArray(new RActionList[viewActionLists.size()])); actionHandler.pushToSecurityContext(secondaryActionMap); RActionList[] defaultSecondaryActionLists = peer.getSecondaryActionLists(); List<RActionList> declaredSecondaryActionLists = createViewActionMap(secondaryActionMap, view, actionHandler, locale); viewSecondaryActionLists.addAll(declaredSecondaryActionLists); peer.setSecondaryActionLists( viewSecondaryActionLists.toArray(new RActionList[viewSecondaryActionLists.size()]));
@Override protected void attachForegroundListener(RComponent viewComponent, IValueConnector foregroundConnector) { if (viewComponent.getForegroundState() == null) { // Not previously set by view creation if (foregroundConnector instanceof IRemoteStateOwner) { viewComponent.setForegroundState(((IRemoteStateOwner) foregroundConnector).getState()); } } }
/** * {@inheritDoc} */ @Override protected BasicIndexedView<RComponent> constructIndexedView(RComponent viewComponent, ITabViewDescriptor descriptor) { BasicIndexedView<RComponent> indexedView = super.constructIndexedView(viewComponent, descriptor); indexedView.addPropertyChangeListener(IView.CONNECTOR_PROPERTY, connectorStateListener); getRemotePeerRegistry().register(viewComponent); viewComponent.setPermId(getRemotePeerRegistry().registerPermId(descriptor.getPermId(), viewComponent.getGuid())); return indexedView; }
/** * 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); }
hardReferences.add(remoteActionAdapter); } else { view.getPeer().addReferencedAction(remoteActionAdapter);
/** * {@inheritDoc} */ @Override public void edit(RComponent component) { RemoteEditCommand editCommand = new RemoteEditCommand(); editCommand.setTargetPeerGuid(component.getGuid()); getRemoteCommandHandler().registerCommand(editCommand); }
/** * translates an index excluding hidden children. * * @param index * the currently displayed view. */ public int translateExcludingHiddenChildren(int index) { RComponent[] tabs = getTabs(); int indexWithoutHidden = index; for (int i = 0; i <= index; i++) { RemoteValueState tabState = tabs[i].getState(); if (tabState != null && !tabState.isReadable()) { indexWithoutHidden--; } } return indexWithoutHidden; } }
/** * {@inheritDoc} */ @Override public void focus(RComponent component) { RemoteFocusCommand focusCommand = new RemoteFocusCommand(); focusCommand.setTargetPeerGuid(component.getGuid()); getRemoteCommandHandler().registerCommand(focusCommand); }
/** * translates an index including hidden children. * * @param index * the currently displayed view. */ public int translateIncludingHiddenChildren(int index) { RComponent[] tabs = getTabs(); int indexWithHidden = index; for (int i = 0; i <= indexWithHidden; i++) { RemoteValueState tabState = tabs[i].getState(); if (tabState != null && !tabState.isReadable()) { indexWithHidden++; } } return indexWithHidden; }
/** * {@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); }