public void setFocusManager(final FocusManager focusManager) { if (focusManager == null) { throw new NakedObjectException("No focus manager set up"); } this.focusManager = focusManager; } }
@Override public void printStackTrace(final PrintStream s) { if (THROWABLE_SUPPORTS_CAUSE) { super.printStackTrace(s); } else { synchronized (s) { super.printStackTrace(s); final Throwable c = getCause(); if (c != null) { s.print("Root cause: "); c.printStackTrace(s); } } } }
public void add(final NakedObject inObject, final NakedObject referencedAdapter) { if (inObject.isPersistent()) { try { final IdentityData targetReference = encoderDecoder.encodeIdentityData(inObject); final IdentityData associateReference = encoderDecoder.encodeIdentityData(referencedAdapter); SetAssociationRequest request = new SetAssociationRequest(getAuthenticationSession(), name, targetReference, associateReference); SetAssociationResponse response = serverFacade.setAssociation(request); ObjectData[] updates = response.getUpdates(); encoderDecoder.decode(updates); } catch (final ConcurrencyException e) { throw ProxyUtil.concurrencyException(e); } catch (final NakedObjectException e) { LOG.error("remote exception: " + e.getMessage(), e); throw e; } } else { underlyingFacet.add(inObject, referencedAdapter); } }
public void add(final NakedObject inObject, final NakedObject referencedAdapter) { if (inObject.isPersistent()) { try { final IdentityData targetReference = encoderDecoder.encodeIdentityData(inObject); final IdentityData associateReference = encoderDecoder.encodeIdentityData(referencedAdapter); SetAssociationRequest request = new SetAssociationRequest(getAuthenticationSession(), name, targetReference, associateReference); SetAssociationResponse response = serverFacade.setAssociation(request); ObjectData[] updates = response.getUpdates(); encoderDecoder.decode(updates); } catch (final ConcurrencyException e) { throw ProxyUtil.concurrencyException(e); } catch (final NakedObjectException e) { LOG.error("remote exception: " + e.getMessage(), e); throw e; } } else { underlyingFacet.add(inObject, referencedAdapter); } }
public void unindent() { if (indent == 0) { throw new NakedObjectException(); } indent--; } }
@Test public void testSetAssociationFailsWhenInvisible() { nameField.setUpIsVisible(false); try { server.setAssociation(authenticationSession, "director", movieData, personData); fail(); } catch (final NakedObjectException expected) { assertEquals("can't modify field as not visible or editable", expected.getMessage()); } }
@Override public void printStackTrace(final PrintStream s) { if (THROWABLE_SUPPORTS_CAUSE) { super.printStackTrace(s); } else { synchronized (s) { super.printStackTrace(s); final Throwable c = getCause(); if (c != null) { s.print("Root cause: "); c.printStackTrace(s); } } } }
public PojoAdapter(final Object pojo, final Oid oid) { if (pojo instanceof NakedObject) { throw new NakedObjectException("Adapter can't be used to adapt an adapter: " + pojo); } this.pojo = pojo; this.oid = oid; resolveState = ResolveState.NEW; }
@Test public void testSetAssociationFailsWhenUnavailable() { nameField.setUpIsUnusableFor(movieAdapter); try { server.setAssociation(authenticationSession, "director", movieData, personData); fail(); } catch (final NakedObjectException expected) { assertEquals("can't modify field as not visible or editable", expected.getMessage()); } }
@Override public void printStackTrace(final PrintWriter s) { if (THROWABLE_SUPPORTS_CAUSE) { super.printStackTrace(s); } else { synchronized (s) { super.printStackTrace(s); final Throwable c = getCause(); if (c != null) { s.println("Root cause: "); c.printStackTrace(s); } } } } }
@Override public void removeView(final View view) { if (view == iconView) { iconView = null; } else { throw new NakedObjectException("No view " + view + " in " + this); } }
@Test public void testSetAssociationFailsWhenInvisible() { nameField.setUpIsVisible(false); try { server.setValue(session, "name", movieData, new DummyEncodeableObjectData("name of movie")); fail(); } catch (final NakedObjectException expected) { assertEquals("can't modify field as not visible or editable", expected.getMessage()); } }
@Override public void printStackTrace(final PrintWriter s) { if (THROWABLE_SUPPORTS_CAUSE) { super.printStackTrace(s); } else { synchronized (s) { super.printStackTrace(s); final Throwable c = getCause(); if (c != null) { s.println("Root cause: "); c.printStackTrace(s); } } } } }
public void unindent() { if (indent == 0) { throw new NakedObjectException(); } indent--; } }
@Test public void testSetAssociationFailsWhenUnavailable() { nameField.setUpIsUnusableFor(object); try { server.setValue(session, "name", movieData, new DummyEncodeableObjectData("test data")); fail(); } catch (final NakedObjectException expected) { assertEquals("can't modify field as not visible or editable", expected.getMessage()); } }
@Override public void setObject(final NakedObject object) { throw new NakedObjectException("Invalid call"); }
@Override public void clear() { throw new NakedObjectException("Invalid call"); }
@Override public void setObject(final NakedObject object) { throw new NakedObjectException("Invalid call"); }
@Override public void clear() { throw new NakedObjectException("Invalid call"); }
public void clear() { throw new NakedObjectException("Invalid call"); }