rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
public static JMenu create(final String text, final Integer mnemonic) { return SINGLETON.doCreate(text, mnemonic); | public static JMenu create(final String text) { return SINGLETON.doCreate(text); | public static JMenu create(final String text, final Integer mnemonic) { return SINGLETON.doCreate(text, mnemonic); } |
if(container.isDraft() && container.isLocalDraft()) { final DraftCell draft = readDraft(container); draftCells.put(container, draft); final List<DraftDocumentCell> draftDocuments = toDisplay(draft, draft.getDocuments()); for(final DraftDocumentCell draftDocument : draftDocuments) { containerIdLookup.put(draftDocument.getId(), container.getId()); } draftDocumentCells.put(draft, draftDocuments); } final List<ContainerVersionCell> versions = readVersions(container); versionCells.put(container, versions); for(final ContainerVersionCell version : versions) { final List<ContainerVersionDocumentCell> versionDocuments = readVersionDocuments(version); for(final ContainerVersionDocumentCell versionDocument : versionDocuments) { containerIdLookup.put(versionDocument.getId(), container.getId()); } versionDocumentCells.put(version, readVersionDocuments(version)); } | private void syncContainerInternal(final Long containerId, final Boolean remote) { final ContainerCell container = readContainer(containerId); // if the container is null; we can assume the container has been // deleted (it's not longer being created by the provider); so we find // the container and remove it if(null == container) { for(int i = 0; i < containerCells.size(); i++) { if(containerCells.get(i).getId().equals(containerId)) { containerCells.remove(i); break; } } } // the container is not null; therefore it is either new; or updated else { // the container is new if(!containerCells.contains(container)) { containerCells.add(0, container); // Get the draft if(container.isDraft() && container.isLocalDraft()) { final DraftCell draft = readDraft(container); draftCells.put(container, draft); final List<DraftDocumentCell> draftDocuments = toDisplay(draft, draft.getDocuments()); for(final DraftDocumentCell draftDocument : draftDocuments) { containerIdLookup.put(draftDocument.getId(), container.getId()); } draftDocumentCells.put(draft, draftDocuments); } // Get the versions final List<ContainerVersionCell> versions = readVersions(container); versionCells.put(container, versions); for(final ContainerVersionCell version : versions) { final List<ContainerVersionDocumentCell> versionDocuments = readVersionDocuments(version); for(final ContainerVersionDocumentCell versionDocument : versionDocuments) { containerIdLookup.put(versionDocument.getId(), container.getId()); } versionDocumentCells.put(version, readVersionDocuments(version)); } } // The container has been updated else { final int index = containerCells.indexOf(container); // if the reload is the result of a remote event add the container // at the top of the list; otherwise add it in the same location // it previously existed containerCells.remove(index); if(remote) { containerCells.add(0, container); } else { containerCells.add(index, container); } } } } |
|
syncDraftInternal(containerId, remote); syncVersionInternal(containerId, remote); | private void syncContainerInternal(final Long containerId, final Boolean remote) { final ContainerCell container = readContainer(containerId); // if the container is null; we can assume the container has been // deleted (it's not longer being created by the provider); so we find // the container and remove it if(null == container) { for(int i = 0; i < containerCells.size(); i++) { if(containerCells.get(i).getId().equals(containerId)) { containerCells.remove(i); break; } } } // the container is not null; therefore it is either new; or updated else { // the container is new if(!containerCells.contains(container)) { containerCells.add(0, container); // Get the draft if(container.isDraft() && container.isLocalDraft()) { final DraftCell draft = readDraft(container); draftCells.put(container, draft); final List<DraftDocumentCell> draftDocuments = toDisplay(draft, draft.getDocuments()); for(final DraftDocumentCell draftDocument : draftDocuments) { containerIdLookup.put(draftDocument.getId(), container.getId()); } draftDocumentCells.put(draft, draftDocuments); } // Get the versions final List<ContainerVersionCell> versions = readVersions(container); versionCells.put(container, versions); for(final ContainerVersionCell version : versions) { final List<ContainerVersionDocumentCell> versionDocuments = readVersionDocuments(version); for(final ContainerVersionDocumentCell versionDocument : versionDocuments) { containerIdLookup.put(versionDocument.getId(), container.getId()); } versionDocumentCells.put(version, readVersionDocuments(version)); } } // The container has been updated else { final int index = containerCells.indexOf(container); // if the reload is the result of a remote event add the container // at the top of the list; otherwise add it in the same location // it previously existed containerCells.remove(index); if(remote) { containerCells.add(0, container); } else { containerCells.add(index, container); } } } } |
|
} | browser.runApplyFlagSeenArtifact(cc.getId(), ArtifactType.CONTAINER); } | protected void triggerExpand(final TabCell mainCell) { if (mainCell instanceof ContainerCell) { final ContainerCell cc = (ContainerCell) mainCell; if(isExpanded(cc)) { cc.setExpanded(Boolean.FALSE); } else { cc.setExpanded(Boolean.TRUE); } synchronize(); } else if (mainCell instanceof DraftCell) { final DraftCell draft = (DraftCell) mainCell; if(isExpanded(draft)) { draft.setExpanded(Boolean.FALSE); } else { draft.setExpanded(Boolean.TRUE); } synchronize(); } else if (mainCell instanceof ContainerVersionCell) { final ContainerVersionCell cv = (ContainerVersionCell) mainCell; if(isExpanded(cv)) { cv.setExpanded(Boolean.FALSE); } else { cv.setExpanded(Boolean.TRUE); } synchronize(); } } |
this.localization = new MainCellL18n("DraftDocumentCell"); | public DraftDocumentCell(final DraftCell draft, final Document document) { super(document.getCreatedBy(), document.getCreatedOn(), document.getDescription(), document.getFlags(), document.getUniqueId(), document.getName(), document.getUpdatedBy(), document.getUpdatedOn()); setId(document.getId()); setRemoteInfo(document.getRemoteInfo()); setState(document.getState()); this.draft = draft; this.imageCache = new MainCellImageCache(); this.popupItemFactory = PopupItemFactory.getInstance(); } |
|
final StringBuffer sbuf = new StringBuffer(); char[] cbuf = new char[READ_BUFFER_SIZE]; int chars; while((chars = br.read(cbuf)) > 0) { sbuf.append(cbuf, 0, chars); | try { final StringBuffer sbuf = new StringBuffer(); char[] cbuf = new char[READ_BUFFER_SIZE]; int chars; while((chars = br.read(cbuf)) > 0) { sbuf.append(cbuf, 0, chars); } return sbuf.toString(); | public static String read(final File file) throws FileNotFoundException, IOException { final BufferedReader br = new BufferedReader(new FileReader(file), READ_BUFFER_SIZE); final StringBuffer sbuf = new StringBuffer(); char[] cbuf = new char[READ_BUFFER_SIZE]; int chars; while((chars = br.read(cbuf)) > 0) { sbuf.append(cbuf, 0, chars); } return sbuf.toString(); } |
return sbuf.toString(); | finally { br.close(); } | public static String read(final File file) throws FileNotFoundException, IOException { final BufferedReader br = new BufferedReader(new FileReader(file), READ_BUFFER_SIZE); final StringBuffer sbuf = new StringBuffer(); char[] cbuf = new char[READ_BUFFER_SIZE]; int chars; while((chars = br.read(cbuf)) > 0) { sbuf.append(cbuf, 0, chars); } return sbuf.toString(); } |
logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
|
xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { | xmppSession.addListener(ArtifactDraftCreatedEvent.class, new XMPPEventListener<ArtifactDraftCreatedEvent>() { public void handleEvent(final ArtifactDraftCreatedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { | }}); xmppSession.addListener(ArtifactDraftDeletedEvent.class, new XMPPEventListener<ArtifactDraftDeletedEvent>() { public void handleEvent(final ArtifactDraftDeletedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} public void handlePublished(final ArtifactPublishedEvent event) { | }}); xmppSession.addListener(ArtifactPublishedEvent.class, new XMPPEventListener<ArtifactPublishedEvent>() { public void handleEvent(final ArtifactPublishedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} public void handleReceived(final ArtifactReceivedEvent event) { | }}); xmppSession.addListener(ArtifactReceivedEvent.class, new XMPPEventListener<ArtifactReceivedEvent>() { public void handleEvent(final ArtifactReceivedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { | }}); xmppSession.addListener(ArtifactTeamMemberAddedEvent.class, new XMPPEventListener<ArtifactTeamMemberAddedEvent>() { public void handleEvent(final ArtifactTeamMemberAddedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { | }}); xmppSession.addListener(ArtifactTeamMemberRemovedEvent.class, new XMPPEventListener<ArtifactTeamMemberRemovedEvent>() { public void handleEvent(final ArtifactTeamMemberRemovedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { | }}); xmppSession.addListener(ContactDeletedEvent.class, new XMPPEventListener<ContactDeletedEvent>() { public void handleEvent(final ContactDeletedEvent event) { logger.logApiId(); getContactModel().handleContactDeleted(event); }}); xmppSession.addListener(ContactDeletedEvent.class, new XMPPEventListener<ContactDeletedEvent>() { public void handleEvent(final ContactDeletedEvent event) { logger.logApiId(); getContactModel().handleContactDeleted(event); }}); xmppSession.addListener(ContactInvitationAcceptedEvent.class, new XMPPEventListener<ContactInvitationAcceptedEvent>() { public void handleEvent(final ContactInvitationAcceptedEvent event) { logger.logApiId(); getContactModel().handleInvitationAccepted(event); }}); xmppSession.addListener(ContactInvitationDeclinedEvent.class, new XMPPEventListener<ContactInvitationDeclinedEvent>() { public void handleEvent(final ContactInvitationDeclinedEvent event) { logger.logApiId(); getContactModel().handleInvitationDeclined(event); }}); xmppSession.addListener(ContactInvitationDeletedEvent.class, new XMPPEventListener<ContactInvitationDeletedEvent>() { public void handleEvent(final ContactInvitationDeletedEvent event) { logger.logApiId(); getContactModel().handleInvitationDeleted(event); }}); xmppSession.addListener(ContactInvitationExtendedEvent.class, new XMPPEventListener<ContactInvitationExtendedEvent>() { public void handleEvent(final ContactInvitationExtendedEvent event) { logger.logApiId(); getContactModel().handleInvitationExtended(event); }}); xmppSession.addListener(ContactUpdatedEvent.class, new XMPPEventListener<ContactUpdatedEvent>() { public void handleEvent(final ContactUpdatedEvent event) { logger.logApiId(); getContactModel().handleContactUpdated(event); }}); xmppSession.addListener(ContainerArtifactPublishedEvent.class, new XMPPEventListener<ContainerArtifactPublishedEvent>() { public void handleEvent(final ContainerArtifactPublishedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} public void handlePublished(final ContainerPublishedEvent event) { | }}); xmppSession.addListener(ContainerPublishedEvent.class, new XMPPEventListener<ContainerPublishedEvent>() { public void handleEvent(final ContainerPublishedEvent event) { logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
} }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); | }}); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
logger.logApiId(); | SessionModelEventDispatcher(final Workspace workspace, final InternalModelFactory modelFactory, final XMPPSession xmppSession) { super(); this.logger = new Log4JWrapper(); this.modelFactory = modelFactory; logger.logApiId(); xmppSession.clearListeners(); xmppSession.addListener(new ArtifactListener() { public void handleDraftCreated(final ArtifactDraftCreatedEvent event) { getArtifactModel().handleDraftCreated(event); } public void handleDraftDeleted(final ArtifactDraftDeletedEvent event) { getArtifactModel().handleDraftDeleted(event); } public void handlePublished(final ArtifactPublishedEvent event) { getArtifactModel().handlePublished(event); } public void handleReceived(final ArtifactReceivedEvent event) { getArtifactModel().handleReceived(event); } public void handleTeamMemberAdded(final ArtifactTeamMemberAddedEvent event) { getArtifactModel().handleTeamMemberAdded(event); } public void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { getArtifactModel().handleTeamMemberRemoved(event); } }); xmppSession.addListener(new ContainerListener() { public void handleArtifactPublished( final ContainerArtifactPublishedEvent event) { getContainerModel().handleArtifactPublished(event); } public void handlePublished(final ContainerPublishedEvent event) { getContainerModel().handlePublished(event); } }); xmppSession.addListener(new ContactListener() { public void handleDeleted(final ContactDeletedEvent event) { getContactModel().handleContactDeleted(event); } public void handleUpdated(final ContactUpdatedEvent event) { getContactModel().handleContactUpdated(event); } public void handleInvitationAccepted( final ContactInvitationAcceptedEvent event) { getContactModel().handleInvitationAccepted(event); } public void handleInvitationDeclined( final ContactInvitationDeclinedEvent event) { getContactModel().handleInvitationDeclined(event); } public void handleInvitationDeleted( final ContactInvitationDeletedEvent event) { getContactModel().handleInvitationDeleted(event); } public void handleInvitationExtended( final ContactInvitationExtendedEvent event) { getContactModel().handleInvitationExtended(event); } }); xmppSession.addListener(new SessionListener() { public void sessionEstablished() { getSessionModel().handleSessionEstablished(); } public void sessionTerminated() { getSessionModel().handleSessionTerminated(); } public void sessionTerminated(final Exception x) { getSessionModel().handleSessionTerminated(x); } }); } |
|
public Document(final Project parent, final String name, | public Document(final String name, | public Document(final Project parent, final String name, final Calendar createdOn, final String createdBy, final String keyHolder, final String description, final File directory, final UUID id, final byte[] content) { super(parent, name, description, createdOn, createdBy, keyHolder, id); this.directory = directory; this.content = content; this.contentChecksum = MD5Util.md5Hex(content); this.versions = new Vector<DocumentVersion>(1); } |
final File directory, final UUID id, final byte[] content) { super(parent, name, description, createdOn, createdBy, keyHolder, id); | final File directory, final UUID id, final byte[] content, final String contentChecksum) { super(null, name, description, createdOn, createdBy, id); | public Document(final Project parent, final String name, final Calendar createdOn, final String createdBy, final String keyHolder, final String description, final File directory, final UUID id, final byte[] content) { super(parent, name, description, createdOn, createdBy, keyHolder, id); this.directory = directory; this.content = content; this.contentChecksum = MD5Util.md5Hex(content); this.versions = new Vector<DocumentVersion>(1); } |
this.contentChecksum = MD5Util.md5Hex(content); this.versions = new Vector<DocumentVersion>(1); | this.contentChecksum = contentChecksum; this.versions = new Vector<DocumentVersion>(3); | public Document(final Project parent, final String name, final Calendar createdOn, final String createdBy, final String keyHolder, final String description, final File directory, final UUID id, final byte[] content) { super(parent, name, description, createdOn, createdBy, keyHolder, id); this.directory = directory; this.content = content; this.contentChecksum = MD5Util.md5Hex(content); this.versions = new Vector<DocumentVersion>(1); } |
protected String render(final Object o) { | protected Object render(final Object o) { | protected String render(final Object o) { return Log4JHelper.render(logger, o); } |
PropertiesUtil.store(properties, new File(Directories.ParityInstall, FileNames.ThinkParityProperties), Sundry.ThinKParityHeader); | PropertiesUtil.store(properties, new File(Directories.ParityInstall, FileNames.ThinkParityProperties), Sundry.ThinkParityHeader); | private void saveProperties() throws IOException { properties.setProperty(PropertyNames.ParityImageName, image.getName()); PropertiesUtil.store(properties, new File(Directories.ParityInstall, FileNames.ThinkParityProperties), Sundry.ThinKParityHeader); } |
final Index index = readIndex(getIndexXmlFile()); final File xmlFile = index.lookupXmlFile(id); | final File xmlFile = lookupXmlFile(id); | public Document get(final UUID id) throws FileNotFoundException, IOException { logger.info("get(UUID)"); logger.debug(id); final Index index = readIndex(getIndexXmlFile()); final File xmlFile = index.lookupXmlFile(id); if(null == xmlFile) { return null; } else { return readDocument(xmlFile); } } |
directoryJTextField = new javax.swing.JTextField(); | private void initComponents() { explanationJLabel = new javax.swing.JLabel(); directoryJLabel = new javax.swing.JLabel(); directoryJTextField = new javax.swing.JTextField(); directoryJButton = new javax.swing.JButton(); openWhenDoneCheckBox = new javax.swing.JCheckBox(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("ExportDialog.ExplanationContainer")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); explanationJLabel.setFocusable(false); directoryJLabel.setText(bundle.getString("ExportDialog.Directory")); // NOI18N directoryJLabel.setFocusable(false); directoryJTextField.setEditable(false); directoryJTextField.setFocusable(false); directoryJButton.setText(bundle.getString("ExportDialog.DirectoryButton")); // NOI18N directoryJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { directoryJButtonActionPerformed(evt); } }); openWhenDoneCheckBox.setText(bundle.getString("ExportDialog.RunWhenDoneCheckbox")); // NOI18N openWhenDoneCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); openWhenDoneCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); okJButton.setText(bundle.getString("ExportDialog.OK")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("ExportDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, openWhenDoneCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(directoryJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(directoryJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(directoryJButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(directoryJLabel) .add(directoryJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(directoryJButton)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(openWhenDoneCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents |
|
directoryJTextField.setEditable(false); directoryJTextField.setFocusable(false); | private void initComponents() { explanationJLabel = new javax.swing.JLabel(); directoryJLabel = new javax.swing.JLabel(); directoryJTextField = new javax.swing.JTextField(); directoryJButton = new javax.swing.JButton(); openWhenDoneCheckBox = new javax.swing.JCheckBox(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("ExportDialog.ExplanationContainer")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); explanationJLabel.setFocusable(false); directoryJLabel.setText(bundle.getString("ExportDialog.Directory")); // NOI18N directoryJLabel.setFocusable(false); directoryJTextField.setEditable(false); directoryJTextField.setFocusable(false); directoryJButton.setText(bundle.getString("ExportDialog.DirectoryButton")); // NOI18N directoryJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { directoryJButtonActionPerformed(evt); } }); openWhenDoneCheckBox.setText(bundle.getString("ExportDialog.RunWhenDoneCheckbox")); // NOI18N openWhenDoneCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); openWhenDoneCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); okJButton.setText(bundle.getString("ExportDialog.OK")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("ExportDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, openWhenDoneCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(directoryJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(directoryJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(directoryJButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(directoryJLabel) .add(directoryJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(directoryJButton)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(openWhenDoneCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents |
|
.add(directoryJButton)) | .add(directoryJButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) | private void initComponents() { explanationJLabel = new javax.swing.JLabel(); directoryJLabel = new javax.swing.JLabel(); directoryJTextField = new javax.swing.JTextField(); directoryJButton = new javax.swing.JButton(); openWhenDoneCheckBox = new javax.swing.JCheckBox(); okJButton = new javax.swing.JButton(); cancelJButton = new javax.swing.JButton(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/JPanel_Messages"); // NOI18N explanationJLabel.setText(bundle.getString("ExportDialog.ExplanationContainer")); // NOI18N explanationJLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); explanationJLabel.setFocusable(false); directoryJLabel.setText(bundle.getString("ExportDialog.Directory")); // NOI18N directoryJLabel.setFocusable(false); directoryJTextField.setEditable(false); directoryJTextField.setFocusable(false); directoryJButton.setText(bundle.getString("ExportDialog.DirectoryButton")); // NOI18N directoryJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { directoryJButtonActionPerformed(evt); } }); openWhenDoneCheckBox.setText(bundle.getString("ExportDialog.RunWhenDoneCheckbox")); // NOI18N openWhenDoneCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); openWhenDoneCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); okJButton.setText(bundle.getString("ExportDialog.OK")); // NOI18N okJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okJButtonActionPerformed(evt); } }); cancelJButton.setText(bundle.getString("ExportDialog.Cancel")); // NOI18N cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelJButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, explanationJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, openWhenDoneCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(directoryJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(directoryJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(directoryJButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(layout.createSequentialGroup() .add(okJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelJButton))) .addContainerGap()) ); layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(explanationJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(directoryJLabel) .add(directoryJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(directoryJButton)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(openWhenDoneCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(okJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents |
directoryJButton.requestFocusInWindow(); | public void reload() { // If input is null then this call to reload() is too early, // the input isn't set up yet. if (input!=null) { reloadExplanation(); reloadDirectory(); okJButton.setEnabled(isInputValid()); } } |
|
customize(item, event); | protected DocumentHistoryItem createItem(final AuditEvent event) { final DocumentHistoryItem item = new DocumentHistoryItem(); item.setDocumentId(event.getArtifactId()); if(event instanceof AuditVersionEvent) item.setVersionId(((AuditVersionEvent) event).getArtifactVersionId()); return item; } |
|
catch(final SmackException sx) { unexpectedOccured(sx); } | private void handleKeyRequestDenied(final UUID artifactUniqueId, final JabberId deniedBy) { try { SessionModelImpl.notifyKeyRequestDenied(artifactUniqueId, deniedBy); } catch(final ParityException px) { unexpectedOccured(px); } catch(final RuntimeException rx) { unexpectedOccured(rx); } } |
|
setBorder(new MultiLineBorder(new Color[] {BC_1, BC_2})); | public HistoryItems() { super("DocumentHistory", Color.WHITE); initComponents(); } |
|
gridBagConstraints.weightx = 1.0; | private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; javax.swing.JScrollPane historyListScrollPane; historyListScrollPane = ScrollPaneFactory.create(); historyList = ListFactory.create(); setLayout(new java.awt.GridBagLayout()); historyListScrollPane.setBorder(null); historyListScrollPane.setViewportView(historyList); historyListScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); historyModel = new DefaultListModel(); historyList.setCellRenderer(new ActiveCellRenderer()); // HEIGHT History List Cell 21 historyList.setFixedCellHeight(21); historyList.setLayoutOrientation(JList.VERTICAL); historyList.setModel(historyModel); historyList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); historyList.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent e) { historyListMouseReleased(e); } }); historyListScrollPane.setViewportView(historyList); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(2, 2, 0, 2); add(historyListScrollPane, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents |
|
if(historyList.isSelectionEmpty()) historyList.setSelectedIndex(0); | private void loadHistory(final DefaultListModel listModel, final HistoryItem[] history) { DisplayHistoryItem display; for (final HistoryItem hi : history) { display = new DisplayHistoryItem(); display.setAvatar(this); display.setHistoryItem(hi); listModel.addElement(display); } } |
|
logout(); | protected void tearDown() throws Exception { datum = null; super.tearDown(); } |
|
public List<User> readPublishedTo(final Long containerId, | public Map<User, Calendar> readPublishedTo(final Long containerId, | public List<User> readPublishedTo(final Long containerId, final Long versionId); |
this.xmppConnection = xmppConnection; | public XMPPSessionDebugger(final XMPPConnection xmppConnection, final Writer writer, final Reader reader) { super(); this.writer = writer; this.reader = reader; } |
|
login(); | protected void setUp() throws Exception { super.setUp(); login(); final ContainerModel cModel = getContainerModel(); datum = new Fixture(cModel, NAME); cModel.addListener(datum); } |
|
logout(); | protected void tearDown() throws Exception { getContainerModel().removeListener(datum); logout(); datum = null; super.tearDown(); } |
|
case 16: return REACTIVATE; | public static AuditEventType fromId(final Integer id) { switch(id) { case 11: return ADD_TEAM_MEMBER; case 13: return ADD_TEAM_MEMBER_CONFIRM; case 0: return ARCHIVE; case 1: return CLOSE; case 2: return CREATE; case 14: return CREATE_REMOTE; case 8: return KEY_REQUEST_DENIED; case 9: return KEY_RESPONSE_DENIED; case 12: return PUBLISH; case 3: return RECEIVE; case 4: return RECEIVE_KEY; case 15: return RENAME; case 5: return REQUEST_KEY; case 6: return SEND; case 10: return SEND_CONFIRM; case 7: return SEND_KEY; default: throw Assert.createUnreachable("Could not determine audit type: " + id); } } |
|
final IQArtifact delete = new IQDeleteArtifact(artifactUniqueId); delete.setType(IQ.Type.SET); sendAndConfirmPacket(delete); | final XMPPMethod method = new XMPPMethod("unsubscribeuser"); method.setParameter(Xml.Artifact.UNIQUE_ID, artifactUniqueId); method.execute(getConnection()); | public void removeArtifactTeamMember(final UUID artifactUniqueId) throws SmackException { logger.info("sendDelete(UUID)"); logger.debug(artifactUniqueId); final IQArtifact delete = new IQDeleteArtifact(artifactUniqueId); delete.setType(IQ.Type.SET); sendAndConfirmPacket(delete); } |
logger.debug("JMenuItem.Mnemonic[" + mnemonic + "]"); | private void applyMnemonic(final JMenuItem jMenuItem, final Integer mnemonic) { jMenuItem.setMnemonic(mnemonic); } |
|
logger.debug("JMenuItem[" + text + "]"); | private JMenuItem doCreate(final String text) { final JMenuItem jMenuItem = new JMenuItem(text); applyDefaultFont(jMenuItem); applyHandCursor(jMenuItem); return jMenuItem; } |
|
initBrowserTitleComponents(); | initComponents(); | BrowserTitleAvatar() { super("BrowserTitleAvatar"); this.mouseInputAdapter = new MouseInputAdapter() { int offsetX; int offsetY; public void mouseDragged(final MouseEvent e) { getController().moveMainWindow( new Point(e.getPoint().x - offsetX, e.getPoint().y - offsetY)); } public void mousePressed(MouseEvent e) { offsetX = e.getPoint().x; offsetY = e.getPoint().y; } }; addMouseListener(mouseInputAdapter); addMouseMotionListener(mouseInputAdapter); setLayout(new GridBagLayout()); initBrowserTitleComponents(); } |
getController().end(); } | infoJLabel.setText(""); } | public void actionPerformed(final ActionEvent e) { getController().end(); } |
setMinimumSize(getMainWindowSize()); | setMinimumSize(Dimensions.BrowserWindow.MIN_SIZE); | BrowserWindow(final Browser browser) throws HeadlessException { super("BrowserWindow"); this.browser = browser; this.logger = Logger.getLogger(getClass()); this.persistence = PersistenceFactory.getPersistence(getClass()); final Boolean maximized = persistence.get("maximized", Boolean.FALSE); getRootPane().setBorder(new WindowBorder2()); addWindowListener(new WindowAdapter() { public void windowClosing(final WindowEvent e) { persist(); browser.hibernate(); }}); initMenu(maximized); setIconImage(com.thinkparity.ophelia.browser.Constants.Images.WINDOW_ICON_IMAGE); setTitle(java.util.ResourceBundle.getBundle("localization/JFrame_Messages").getString("BrowserWindow.Title")); setUndecorated(true); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); final Point location = persistence.get("location", getMainWindowLocation()); location.x = (location.x < 0 ? 0 : location.x ); location.y = (location.y < 0 ? 0 : location.y ); setLocation(location.x, location.y); mainWindowLocation.setLocation(location); final Dimension size = persistence.get("size", getMainWindowSize()); mainWindowSize.setSize(size); if (maximized) { setMaximizedBounds(SwingUtil.getPrimaryDesktopBounds()); setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH); } setResizable(true); setMinimumSize(getMainWindowSize()); setSize(getMainWindowSize()); initComponents(); if (!maximized) { roundCorners(); } // Set up the semi-transparent JPanel semiTransparentJPanel = new SemiTransparentJPanel(Boolean.FALSE); getLayeredPane().add(semiTransparentJPanel, JLayeredPane.PALETTE_LAYER); new Resizer(browser, this, Boolean.FALSE, Resizer.ResizeEdges.ALL_EDGES); } |
setMinimumSize(dFinal); | public void setMainWindowSize(final Dimension d) { final Dimension dFinal = new Dimension(d); // Honour the minimum window size. if (dFinal.getWidth() < Dimensions.BrowserWindow.MIN_SIZE.getWidth()) { dFinal.width = (int)Dimensions.BrowserWindow.MIN_SIZE.getWidth(); } if (dFinal.getHeight() < Dimensions.BrowserWindow.MIN_SIZE.getHeight()) { dFinal.height = (int)Dimensions.BrowserWindow.MIN_SIZE.getHeight(); } if (!getSize().equals(dFinal)) { setMinimumSize(dFinal); setSize(dFinal); mainWindowSize.setSize(dFinal); roundCorners(); validate(); } } |
|
setMinimumSize(dFinal); | public void setMainWindowSizeAndLocation(final Point p, final Dimension d) { final Point pFinal = new Point(p); final Dimension dFinal = new Dimension(d); // Honour the minimum window size. When going below the size limit in // either x or y, limit both the resize and the move in that direction. if (dFinal.getWidth() < Dimensions.BrowserWindow.MIN_SIZE.getWidth()) { if (pFinal.x != getLocation().x) { pFinal.x += (dFinal.getWidth() - Dimensions.BrowserWindow.MIN_SIZE.getWidth()); } dFinal.width = (int)Dimensions.BrowserWindow.MIN_SIZE.getWidth(); } if (dFinal.getHeight() < Dimensions.BrowserWindow.MIN_SIZE.getHeight()) { if (pFinal.y != getLocation().y) { pFinal.y += (dFinal.getHeight() - Dimensions.BrowserWindow.MIN_SIZE.getHeight()); } dFinal.height = (int)Dimensions.BrowserWindow.MIN_SIZE.getHeight(); } final Boolean move = !getLocation().equals(pFinal); final Boolean resize = !getSize().equals(dFinal); if (resize) { if (move) { // Move and resize setBounds(pFinal.x, pFinal.y, (int)dFinal.getWidth(), (int)dFinal.getHeight()); } else { // Resize only setSize(dFinal); } setMinimumSize(dFinal); mainWindowSize.setSize(dFinal); mainWindowLocation.setLocation(pFinal); roundCorners(); validate(); } else if (move) { // Move only setLocation(pFinal); mainWindowLocation.setLocation(pFinal); } } |
|
modifyDocument(OpheliaTestUser.JUNIT, document); | modifyDocument(OpheliaTestUser.JUNIT, document.getId()); | protected void setUp() throws Exception { super.setUp(); final Integer VERSION_COUNT = 3; final DocumentModel documentModel = getDocumentModel(OpheliaTestUser.JUNIT); data = new Vector<Fixture>(getInputFilesLength()); for(final File testFile : getInputFiles()) { final Document document = createDocument(OpheliaTestUser.JUNIT, testFile); for(int i = 0; i < VERSION_COUNT; i++) { modifyDocument(OpheliaTestUser.JUNIT, document); documentModel.createVersion(document.getId()); } data.add(new Fixture(document, documentModel, VERSION_COUNT)); } } |
SessionModelImpl.notifyArtifactClosed(artifactUniqueId, artifactClosedBy); | try { SessionModelImpl.notifyArtifactClosed( artifactUniqueId, artifactClosedBy); } catch(final ParityException px) { unexpectedOccured(px); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleArtifactClosed(final UUID artifactUniqueId, final JabberId artifactClosedBy) { SessionModelImpl.notifyArtifactClosed(artifactUniqueId, artifactClosedBy); } |
SessionModelImpl.notifyDocumentReceived(xmppDocument); | try { SessionModelImpl.notifyDocumentReceived(xmppDocument); } catch(final ParityException px) { unexpectedOccured(px); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleDocumentReceived(final XMPPDocument xmppDocument) { SessionModelImpl.notifyDocumentReceived(xmppDocument); } |
SessionModelImpl.notifyInvitationAccepted(acceptedBy); | try { SessionModelImpl.notifyInvitationAccepted(acceptedBy); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleInvitationAccepted(final JabberId acceptedBy) { SessionModelImpl.notifyInvitationAccepted(acceptedBy); } |
SessionModelImpl.notifyInvitationDeclined(declinedBy); | try { SessionModelImpl.notifyInvitationDeclined(declinedBy); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleInvitationDeclined(final JabberId declinedBy) { SessionModelImpl.notifyInvitationDeclined(declinedBy); } |
SessionModelImpl.notifyInvitationExtended(invitedBy); | try { SessionModelImpl.notifyInvitationExtended(invitedBy); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleInvitationExtended(final JabberId invitedBy) { SessionModelImpl.notifyInvitationExtended(invitedBy); } |
SessionModelImpl.notifyKeyRequestAccepted(artifactUniqueId, acceptedBy); | try { SessionModelImpl.notifyKeyRequestAccepted( artifactUniqueId, acceptedBy); } catch(final ParityException px) { unexpectedOccured(px); } catch(final RuntimeException rx) { unexpectedOccured(rx); } catch(final SmackException sx) { unexpectedOccured(sx); } | private void handleKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { SessionModelImpl.notifyKeyRequestAccepted(artifactUniqueId, acceptedBy); } |
SessionModelImpl.notifyKeyRequestDenied(artifactUniqueId, deniedBy); | try { SessionModelImpl.notifyKeyRequestDenied(artifactUniqueId, deniedBy); } catch(final ParityException px) { unexpectedOccured(px); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleKeyRequestDenied(final UUID artifactUniqueId, final JabberId deniedBy) { SessionModelImpl.notifyKeyRequestDenied(artifactUniqueId, deniedBy); } |
SessionModelImpl.notifyKeyRequested(artifactUniqueId, requestedBy); | try { SessionModelImpl.notifyKeyRequested(artifactUniqueId, requestedBy); } catch(final ParityException px) { unexpectedOccured(px); } catch(final RuntimeException rx) { unexpectedOccured(rx); } catch(final SmackException sx) { unexpectedOccured(sx); } | private void handleKeyRequested(final UUID artifactUniqueId, final JabberId requestedBy) { SessionModelImpl.notifyKeyRequested(artifactUniqueId, requestedBy); } |
SessionModelImpl.notifySessionEstablished(); | try { SessionModelImpl.notifySessionEstablished(); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleSessionEstablished() { SessionModelImpl.notifySessionEstablished(); } |
SessionModelImpl.notifySessionTerminated(); | try { SessionModelImpl.notifySessionTerminated(); } catch(final RuntimeException rx) { unexpectedOccured(rx); } | private void handleSessionTerminated() { SessionModelImpl.notifySessionTerminated(); } |
for(final Long metaDataId : metaDataIds) metaDataIO.delete(session, metaDataId); | public void delete(final Long artifactId) throws HypersonicException { final Session session = openSession(); try { final Long[] auditIds = listAuditIds(session, artifactId); final Long[] metaDataIds = listMetaDataIds(session, auditIds); for(final Long metaDataId : metaDataIds) metaDataIO.delete(session, metaDataId); session.prepareStatement(SQL_DELETE_AUDIT_META_DATA); for(final Long metaDataId : metaDataIds) { session.setLong(1, metaDataId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit meta data."); } session.prepareStatement(SQL_DELETE_AUDIT_VERSION); session.setLong(1, artifactId); int rowsDeleted = session.executeUpdate(); if(0 != rowsDeleted && 1 != rowsDeleted) throw new HypersonicException("Could not delete audit version."); session.prepareStatement(SQL_DELETE_AUDIT); session.setLong(1, artifactId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit."); session.commit(); } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } } |
|
for(final Long metaDataId : metaDataIds) metaDataIO.delete(session, metaDataId); | public void delete(final Long artifactId) throws HypersonicException { final Session session = openSession(); try { final Long[] auditIds = listAuditIds(session, artifactId); final Long[] metaDataIds = listMetaDataIds(session, auditIds); for(final Long metaDataId : metaDataIds) metaDataIO.delete(session, metaDataId); session.prepareStatement(SQL_DELETE_AUDIT_META_DATA); for(final Long metaDataId : metaDataIds) { session.setLong(1, metaDataId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit meta data."); } session.prepareStatement(SQL_DELETE_AUDIT_VERSION); session.setLong(1, artifactId); int rowsDeleted = session.executeUpdate(); if(0 != rowsDeleted && 1 != rowsDeleted) throw new HypersonicException("Could not delete audit version."); session.prepareStatement(SQL_DELETE_AUDIT); session.setLong(1, artifactId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit."); session.commit(); } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } } |
|
digester.addBeanPropertySetter("toolbox/tool/request-path", "requestPath"); | protected void addToolRules(Digester digester) { super.addToolRules(digester); digester.addBeanPropertySetter("toolbox/tool/scope", "scope"); } |
|
l.artifactClosed(artifactClose.getArtifactUUID()); | l.artifactClosed( artifactClose.getArtifactUUID(), artifactClose.getClosedBy()); | private void notifyXMPPExtension_closeArtifact( final IQCloseArtifact artifactClose) { synchronized(xmppExtensionListenersLock) { for(final XMPPExtensionListener l : xmppExtensionListeners) { l.artifactClosed(artifactClose.getArtifactUUID()); } } } |
xmppSession.addListener(xmppArtifactListener); | SessionModelXMPPHelper() { super(); this.xmppSession = XMPPSessionFactory.createSession(); this.xmppExtensionListener = new XMPPExtensionListener() { public void artifactClosed(final UUID artifactUniqueId, final JabberId artifactClosedBy) { handleArtifactClosed(artifactUniqueId, artifactClosedBy); } public void documentReceived(final XMPPDocument xmppDocument) { handleDocumentReceived(xmppDocument); } public void keyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { handleKeyRequestAccepted(artifactUniqueId, acceptedBy); } public void keyRequestDenied(final UUID artifactUniqueId, final JabberId deniedBy) { handleKeyRequestDenied(artifactUniqueId, deniedBy); } public void keyRequested(final UUID artifactUniqueId, final JabberId requestedBy) { handleKeyRequested(artifactUniqueId, requestedBy); } }; this.xmppPresenceListener = new XMPPContactListener() { public void invitationAccepted(final JabberId acceptedBy) { handleInvitationAccepted(acceptedBy); } public void invitationDeclined(final JabberId declinedBy) { handleInvitationDeclined(declinedBy); } public void invitationExtended(final JabberId invitedBy) { handleInvitationExtended(invitedBy); } }; this.xmppSessionListener = new XMPPSessionListener() { public void sessionEstablished() { handleSessionEstablished(); } public void sessionTerminated() { handleSessionTerminated(); } public void sessionTerminated(final Exception x) { handleSessionTerminated(x); } }; xmppSession.addListener(xmppExtensionListener); xmppSession.addListener(xmppPresenceListener); xmppSession.addListener(xmppSessionListener); } |
|
public PopupHistoryItem(final MainCellHistoryItem historyItem) { | public PopupHistoryItem(final MainCellHistoryItem historyItem, final Connection connection) { | public PopupHistoryItem(final MainCellHistoryItem historyItem) { super(); this.historyItem = historyItem; this.l18n = new PopupL18n("HistoryListItem"); } |
this.connection = connection; | public PopupHistoryItem(final MainCellHistoryItem historyItem) { super(); this.historyItem = historyItem; this.l18n = new PopupL18n("HistoryListItem"); } |
|
if(historyItem.isSetVersionId()) { jPopupMenu.add(new OpenVersion(application)); if(!historyItem.getDocument().isClosed()) { final Set<User> team = historyItem.getDocumentTeam(); if(0 < team.size()) { final JMenu jMenu = MenuFactory.create(getString("SendVersion")); for(final User teamMember : team) jMenu.add(new Send(application, teamMember)); jPopupMenu.add(jMenu); } } } | if(Connection.ONLINE == connection) { triggerOnline(application, jPopupMenu, e); } else if(Connection.OFFLINE == connection) { triggerOffline(application, jPopupMenu, e); } else { Assert.assertUnreachable("[LBROWSER] [APPLICATION] [BROWSER] [AVATAR] [HISTORY ITEM POPUP] [TRIGGER] [UNKNOWN CONNECTION STATUS]"); } | public void trigger(final Browser application, final JPopupMenu jPopupMenu, final MouseEvent e) { if(historyItem.isSetVersionId()) { jPopupMenu.add(new OpenVersion(application)); if(!historyItem.getDocument().isClosed()) { final Set<User> team = historyItem.getDocumentTeam(); if(0 < team.size()) { final JMenu jMenu = MenuFactory.create(getString("SendVersion")); for(final User teamMember : team) jMenu.add(new Send(application, teamMember)); jPopupMenu.add(jMenu); } } } } |
String idAula=aula.dameValor(Constantes.ID_ISAULA); String idHorario= horario.dameValor(Constantes.ID_ISHORARIO); if(idAula!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISAULA_IDISAULA,idAula); | if(aula!=null){ String idAula=aula.dameValor(Constantes.ID_ISAULA); if(idAula!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISAULA_IDISAULA,idAula); else horCursoAula.cambiaValor(Constantes.ID_HAS_ISAULA_IDISAULA,""); } | public ListaObjetoBean dameCursosCumplan(ObjetoBean curso,ObjetoBean aula,ObjetoBean horario ){ try{ //primera hacemos una consulta para ver los cursos que cumplen los criterios del bean curso ObjetoBBDD iscurso= ConversorBeanBBDD.convierteBeanABBDD(curso); ObjetoCriterio critCurso = this.crearObjetoCriterioAdecuado(iscurso); ListaObjetoBBDD cursosCumplenCurso= this.inicializaTabla(this.crearTablaAdecuada(iscurso)).consultar(critCurso); ListaObjetoBBDD cursosResultado= this.creador.getCreadorListaObjetoBBDD().crear(); ObjetoBBDD cursoActual; ObjetoBBDD horCursoAula; ObjetoCriterio critHorAulaCurso; ListaObjetoBBDD cursosHorAula; // Para cada curso que cumple los criterios establecidos por el bean curso pasado como parmtero, vemos si tambien cumplen // los criterios de aula y horario y si es asi lo incluimos a la lista de cursos que cumplen todos los requisitos. for(int i=0;i<cursosCumplenCurso.tamanio();i++){ cursoActual = cursosCumplenCurso.dameObjeto(i); horCursoAula= this.creador.getCreadorObjetoBBDD().crear(this.creador.getCreadorObjetoBBDD().IshorarioHasIsaula); horCursoAula.cambiaValor(Constantes.ID_HAS_ISCURSO_IDISCURSO,cursoActual.dameValor(Constantes.ID_ISCURSO_IDISCURSO)); String idAula=aula.dameValor(Constantes.ID_ISAULA); String idHorario= horario.dameValor(Constantes.ID_ISHORARIO); if(idAula!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISAULA_IDISAULA,idAula); else horCursoAula.cambiaValor(Constantes.ID_HAS_ISAULA_IDISAULA,""); if (idHorario!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISHORARIO_IDISHORARIO,idHorario); else horCursoAula.cambiaValor(Constantes.ID_HAS_ISHORARIO_IDISHORARIO,""); critHorAulaCurso = this.crearObjetoCriterioAdecuado(horCursoAula); cursosHorAula= this.inicializaTabla(this.crearTablaAdecuada(horCursoAula)).consultar(critHorAulaCurso); if(!cursosHorAula.esVacio()) cursosResultado.insertar(cursosResultado.tamanio(),cursoActual); } return ConversorBeanBBDD.convierteListaBBDD(cursosResultado); } catch(Exception e){ e.printStackTrace(); return null; } } |
if (idHorario!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISHORARIO_IDISHORARIO,idHorario); | if(horario!=null){ String idHorario= horario.dameValor(Constantes.ID_ISHORARIO); if (idHorario!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISHORARIO_IDISHORARIO,idHorario); else horCursoAula.cambiaValor(Constantes.ID_HAS_ISHORARIO_IDISHORARIO,""); } | public ListaObjetoBean dameCursosCumplan(ObjetoBean curso,ObjetoBean aula,ObjetoBean horario ){ try{ //primera hacemos una consulta para ver los cursos que cumplen los criterios del bean curso ObjetoBBDD iscurso= ConversorBeanBBDD.convierteBeanABBDD(curso); ObjetoCriterio critCurso = this.crearObjetoCriterioAdecuado(iscurso); ListaObjetoBBDD cursosCumplenCurso= this.inicializaTabla(this.crearTablaAdecuada(iscurso)).consultar(critCurso); ListaObjetoBBDD cursosResultado= this.creador.getCreadorListaObjetoBBDD().crear(); ObjetoBBDD cursoActual; ObjetoBBDD horCursoAula; ObjetoCriterio critHorAulaCurso; ListaObjetoBBDD cursosHorAula; // Para cada curso que cumple los criterios establecidos por el bean curso pasado como parmtero, vemos si tambien cumplen // los criterios de aula y horario y si es asi lo incluimos a la lista de cursos que cumplen todos los requisitos. for(int i=0;i<cursosCumplenCurso.tamanio();i++){ cursoActual = cursosCumplenCurso.dameObjeto(i); horCursoAula= this.creador.getCreadorObjetoBBDD().crear(this.creador.getCreadorObjetoBBDD().IshorarioHasIsaula); horCursoAula.cambiaValor(Constantes.ID_HAS_ISCURSO_IDISCURSO,cursoActual.dameValor(Constantes.ID_ISCURSO_IDISCURSO)); String idAula=aula.dameValor(Constantes.ID_ISAULA); String idHorario= horario.dameValor(Constantes.ID_ISHORARIO); if(idAula!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISAULA_IDISAULA,idAula); else horCursoAula.cambiaValor(Constantes.ID_HAS_ISAULA_IDISAULA,""); if (idHorario!=null) horCursoAula.cambiaValor(Constantes.ID_HAS_ISHORARIO_IDISHORARIO,idHorario); else horCursoAula.cambiaValor(Constantes.ID_HAS_ISHORARIO_IDISHORARIO,""); critHorAulaCurso = this.crearObjetoCriterioAdecuado(horCursoAula); cursosHorAula= this.inicializaTabla(this.crearTablaAdecuada(horCursoAula)).consultar(critHorAulaCurso); if(!cursosHorAula.esVacio()) cursosResultado.insertar(cursosResultado.tamanio(),cursoActual); } return ConversorBeanBBDD.convierteListaBBDD(cursosResultado); } catch(Exception e){ e.printStackTrace(); return null; } } |
this.logger = new Log4JWrapper(getClass()); | this.logger = new Log4JWrapper("TEST_DEBUGGER"); | protected TestCase(final String name) { super(name); this.testCaseHelper = new TestCaseHelper(this); this.logger = new Log4JWrapper(getClass()); } |
public List<User> readPublishedTo(final Long containerId, | public Map<User, Calendar> readPublishedTo(final Long containerId, | public List<User> readPublishedTo(final Long containerId, final Long versionId) { final Session session = openSession(); try { session.prepareStatement(SQL_READ_PUBLISHED_TO); session.setLong(1, containerId); session.setLong(2, versionId); session.executeQuery(); final List<User> publishedTo = new ArrayList<User>(); while (session.nextResult()) { publishedTo.add(userIO.extractUser(session)); } return publishedTo; } finally { session.close(); } } |
final List<User> publishedTo = new ArrayList<User>(); | final Map<User, Calendar> publishedTo = new HashMap<User, Calendar>(); | public List<User> readPublishedTo(final Long containerId, final Long versionId) { final Session session = openSession(); try { session.prepareStatement(SQL_READ_PUBLISHED_TO); session.setLong(1, containerId); session.setLong(2, versionId); session.executeQuery(); final List<User> publishedTo = new ArrayList<User>(); while (session.nextResult()) { publishedTo.add(userIO.extractUser(session)); } return publishedTo; } finally { session.close(); } } |
publishedTo.add(userIO.extractUser(session)); | publishedTo.put(userIO.extractUser(session), session.getCalendar("RECEIVED_ON")); | public List<User> readPublishedTo(final Long containerId, final Long versionId) { final Session session = openSession(); try { session.prepareStatement(SQL_READ_PUBLISHED_TO); session.setLong(1, containerId); session.setLong(2, versionId); session.executeQuery(); final List<User> publishedTo = new ArrayList<User>(); while (session.nextResult()) { publishedTo.add(userIO.extractUser(session)); } return publishedTo; } finally { session.close(); } } |
final StreamSession streamSession = streamModel.createSession(userId); final StreamWriter writer = new StreamWriter(streamSession); writer.open(); try { writer.write(streamId, stream, streamSize); } finally { try { stream.close(); } finally { writer.close(); | final StreamSession streamSession = streamModel.createArchiveSession(archiveId); uploadStream(new UploadMonitor() { public void chunkUploaded(final int chunkSize) { logger.logApiId(); logger.logVariable("chunkSize", chunkSize); | void createStream(final JabberId userId, final String streamId, final UUID uniqueId, final Long versionId) { logApiId(); logVariable("userId", userId); logVariable("streamId", streamId); logVariable("uniqueId", uniqueId); logVariable("versionId", versionId); try { assertIsAuthenticatedUser(userId); final JabberId archiveId = readArchiveId(userId); if (null == archiveId) { logger.logWarning("User {0} has no archive.", userId); } else { final ClientModelFactory modelFactory = getModelFactory(archiveId); final InternalArtifactModel artifactModel = modelFactory.getArtifactModel(getClass()); final InternalDocumentModel documentModel = modelFactory.getDocumentModel(getClass()); final Long documentId = artifactModel.readId(uniqueId); final InputStream stream = documentModel.openVersionStream(documentId, versionId); final Long streamSize = documentModel.readVersionSize(documentId, versionId); final InternalStreamModel streamModel = getStreamModel(); final StreamSession streamSession = streamModel.createSession(userId); final StreamWriter writer = new StreamWriter(streamSession); writer.open(); try { writer.write(streamId, stream, streamSize); } finally { try { stream.close(); } finally { writer.close(); } } } } catch (final Throwable t) { throw translateError(t); } } |
} | }, streamId, streamSession, stream, streamSize); | void createStream(final JabberId userId, final String streamId, final UUID uniqueId, final Long versionId) { logApiId(); logVariable("userId", userId); logVariable("streamId", streamId); logVariable("uniqueId", uniqueId); logVariable("versionId", versionId); try { assertIsAuthenticatedUser(userId); final JabberId archiveId = readArchiveId(userId); if (null == archiveId) { logger.logWarning("User {0} has no archive.", userId); } else { final ClientModelFactory modelFactory = getModelFactory(archiveId); final InternalArtifactModel artifactModel = modelFactory.getArtifactModel(getClass()); final InternalDocumentModel documentModel = modelFactory.getDocumentModel(getClass()); final Long documentId = artifactModel.readId(uniqueId); final InputStream stream = documentModel.openVersionStream(documentId, versionId); final Long streamSize = documentModel.readVersionSize(documentId, versionId); final InternalStreamModel streamModel = getStreamModel(); final StreamSession streamSession = streamModel.createSession(userId); final StreamWriter writer = new StreamWriter(streamSession); writer.open(); try { writer.write(streamId, stream, streamSize); } finally { try { stream.close(); } finally { writer.close(); } } } } catch (final Throwable t) { throw translateError(t); } } |
protected Map<User, ArtifactReceipt> readPublishedTo(final UUID uniqueId, final Long versionId) { | public Map<User, ArtifactReceipt> readPublishedTo( final UUID uniqueId, final Long versionId) { | static <T extends Artifact, U extends ArtifactVersion> ArchiveReader<T, U> emptyReader() { return new ArchiveReader<T, U>() { @Override public List<T> read() { return Collections.emptyList(); } @Override public T read(final UUID uniqueId) { return null; } @Override public List<U> readVersions(final UUID uniqueId) { return Collections.emptyList(); } @Override protected Map<User, ArtifactReceipt> readPublishedTo(final UUID uniqueId, final Long versionId) { return Collections.emptyMap(); } }; } |
if (null==this.resizer) { this.resizer = new Resizer(getController(), this, isSupportMouseMove(), getResizeEdges()); final List<Component> componentsThatSupportMouseMove = getComponentsThatSupportMouseMove(); if (null!=componentsThatSupportMouseMove) { resizer.addComponentsThatSupportMouseMove(componentsThatSupportMouseMove); } | if (null!=this.resizer) { resizer.removeAllListeners(); } this.resizer = new Resizer(getController(), this, isSupportMouseMove(), getResizeEdges()); final List<Component> componentsThatSupportMouseMove = getComponentsThatSupportMouseMove(); if (null!=componentsThatSupportMouseMove) { resizer.addComponentsThatSupportMouseMove(componentsThatSupportMouseMove); | public void installResizer() { if (null==this.resizer) { this.resizer = new Resizer(getController(), this, isSupportMouseMove(), getResizeEdges()); final List<Component> componentsThatSupportMouseMove = getComponentsThatSupportMouseMove(); if (null!=componentsThatSupportMouseMove) { resizer.addComponentsThatSupportMouseMove(componentsThatSupportMouseMove); } } } |
configureRenderer(configuration, HistoryItem.class, HistoryItemRenderer.class); | private static void configureRenderers(final Properties configuration) { // TODO Change the class\renderer class reference to be absolute instead // of an import. configureRenderer(configuration, User.class, UserRenderer.class); configureRenderer(configuration, Document.class, DocumentRenderer.class); configureRenderer(configuration, DocumentContent.class, DocumentContentRenderer.class); configureRenderer(configuration, DocumentVersion.class, DocumentVersionRenderer.class); configureRenderer(configuration, Message.class, MessageRenderer.class); configureRenderer(configuration, Packet.class, PacketRenderer.class); configureRenderer(configuration, PacketExtension.class, PacketExtensionRenderer.class); configureRenderer(configuration, XMPPDocument.class, XMPPDocumentRenderer.class); configureRenderer(configuration, XmlPullParser.class, XmlPullParserRenderer.class); } |
|
StreamUtil.copy(stream, output, streamSession.getBufferSize()); | int len; final byte[] b = new byte[streamSession.getBufferSize()]; try { while((len = stream.read(b)) > 0) { logger.logDebug("{0}/{1}", len, total); output.write(b, 0, len); output.flush(); } } finally { stream.close(); output.flush(); output.close(); } | private void doRun() throws IOException { final InputStream stream = streamServer.openInputStream(streamSession, streamId); StreamUtil.copy(stream, output, streamSession.getBufferSize()); } |
public static Listable[] queryListMultiple(Frame parent, String title, String message, String helpString, String okButton, boolean hasDefault, ListableVector vector, boolean[] selected) { if (vector==null) return null; Listable[] names = vector.getListables(); if (names==null) return null; ListDialog id = new ListDialog(parent, title, message, true,helpString, names, null, okButton,null,hasDefault, true); id.list.setMultipleMode(true); id.setSelected(selected); IntegerArray result = id.indicesSelected; if (result==null || result.getSize()==0) { id.dispose(); return null; } Listable[] L = new Listable[result.getSize()]; for (int i=0; i<result.getSize(); i++) L[i] = (Listable)vector.elementAt(result.getValue(i)); id.dispose(); return L; | public static Listable[] queryListMultiple(Frame parent, String title, String message, String helpString, ListableVector vector, boolean[] selected) { return queryListMultiple(parent, title, message, helpString, null, true, vector, selected); | public static Listable[] queryListMultiple(Frame parent, String title, String message, String helpString, String okButton, boolean hasDefault, ListableVector vector, boolean[] selected) { if (vector==null) return null; Listable[] names = vector.getListables(); if (names==null) return null; ListDialog id = new ListDialog(parent, title, message, true,helpString, names, null, okButton,null,hasDefault, true);// if (okButton!=null)// id.ok.setLabel(okButton); id.list.setMultipleMode(true); id.setSelected(selected); //id.setVisible(true); IntegerArray result = id.indicesSelected; if (result==null || result.getSize()==0) { id.dispose(); return null; } Listable[] L = new Listable[result.getSize()]; for (int i=0; i<result.getSize(); i++) L[i] = (Listable)vector.elementAt(result.getValue(i)); id.dispose(); return L; } |
final File modFile = modifyDocument(OpheliaTestUser.JUNIT, document); | final File modFile = modifyDocument(OpheliaTestUser.JUNIT, document.getId()); | protected void setUp() throws Exception { super.setUp(); final File inputFile = getInputFile("JUnitTestFramework.txt"); final InternalDocumentModel documentModel = getDocumentModel(OpheliaTestUser.JUNIT); final Document document = createDocument(OpheliaTestUser.JUNIT, inputFile); final File modFile = modifyDocument(OpheliaTestUser.JUNIT, document); final DocumentVersion version = createDocumentVersion(OpheliaTestUser.JUNIT, document); datum = new Fixture(documentModel, modFile, version); } |
version = datum.documentModel.createVersion( | datum.documentModel.createVersion( | public void testCreateVersion() { try { DocumentVersion version; DocumentVersionContent versionContent; for(Fixture datum : data) { version = datum.documentModel.createVersion( datum.document, datum.action, datum.actionData); assertNotNull(version); assertEquals(datum.action, version.getAction()); assertEquals(datum.actionData, version.getActionData()); assertEquals(datum.document.getId(), version.getDocumentId()); assertEquals(datum.document, version.getSnapshot()); versionContent = datum.documentModel.getVersionContent(version); assertNotNull(versionContent); assertEquals(datum.document.getId(), versionContent.getDocumentId()); assertEquals(datum.content, versionContent.getSnapshot()); } } catch(Throwable t) { fail(getFailMessage(t)); } } |
iVersions = datum.documentModel.listVersions(datum.document).iterator(); version = null; while(iVersions.hasNext()) { version = iVersions.next(); } | public void testCreateVersion() { try { DocumentVersion version; DocumentVersionContent versionContent; for(Fixture datum : data) { version = datum.documentModel.createVersion( datum.document, datum.action, datum.actionData); assertNotNull(version); assertEquals(datum.action, version.getAction()); assertEquals(datum.actionData, version.getActionData()); assertEquals(datum.document.getId(), version.getDocumentId()); assertEquals(datum.document, version.getSnapshot()); versionContent = datum.documentModel.getVersionContent(version); assertNotNull(versionContent); assertEquals(datum.document.getId(), versionContent.getDocumentId()); assertEquals(datum.content, versionContent.getSnapshot()); } } catch(Throwable t) { fail(getFailMessage(t)); } } |
|
EventDispatcher.getInstance().initialize(); | static void initialize() { System.setProperty("sun.awt.noerasebackground", "true"); System.setProperty("parity.insecure", "true"); LoggerFactory.getLogger(Browser2PlatformInitializer.class); ModelFactory.getInstance().initialize(); EventDispatcher.getInstance().initialize(); // Set the application lnf try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch(final UnsupportedLookAndFeelException ulafx) { throw new RuntimeException(ulafx); } // ensure a session is established// if(Status.ONLINE != ModelSession.getStatus()) {// ModelSession.establishSession();// }// if(Status.ONLINE != ModelSession.getStatus()) {// System.out.println("Must be logged in to use the parity browser.");// System.exit(1);// } } |
|
final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); | assertDeleted(datum.junit, c); | public void testDelete() { final Container c = createContainer(datum.junit, NAME); getContainerModel(datum.junit).addListener(datum); logger.logInfo("Deleting container \"{0}\" as \"{1}.\"", c.getName(), datum.junit_x.getSimpleUsername()); getContainerModel(datum.junit).delete(c.getId()); getContainerModel(datum.junit).removeListener(datum); final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); } |
final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); | assertDeleted(datum.junit, c, d); | public void testDeletePostAdd() { final Container c = createContainer(datum.junit, NAME); addDocument(datum.junit, c.getId(), "JUnitTestFramework.doc"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.odt"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.pdf"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.txt"); getContainerModel(datum.junit).addListener(datum); logger.logInfo("Deleting container \"{0}\" as \"{1}.\"", c.getName(), datum.junit_x.getSimpleUsername()); getContainerModel(datum.junit).delete(c.getId()); getContainerModel(datum.junit).removeListener(datum); final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); } |
final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); | assertDeleted(datum.junit, c, d); | public void testDeletePostMultiPublish() { final Container c = createContainer(datum.junit, NAME); final Document d_doc = addDocument(datum.junit, c.getId(), "JUnitTestFramework.doc"); final Document d_odt = addDocument(datum.junit, c.getId(), "JUnitTestFramework.odt"); final Document d_pdf = addDocument(datum.junit, c.getId(), "JUnitTestFramework.pdf"); final Document d_txt = addDocument(datum.junit, c.getId(), "JUnitTestFramework.txt"); publishToContacts(datum.junit, c.getId(), "JUnit.X thinkParity", "JUnit.Y thinkParity"); datum.waitForEvents(); createDraft(datum.junit, c.getId()); datum.waitForEvents(); modifyDocument(datum.junit, d_doc.getId()); modifyDocument(datum.junit, d_odt.getId()); modifyDocument(datum.junit, d_pdf.getId()); modifyDocument(datum.junit, d_txt.getId()); publishToTeam(datum.junit, c.getId()); datum.waitForEvents(); getContainerModel(datum.junit).addListener(datum); logger.logInfo("Deleting container \"{0}\" as \"{1}.\"", c.getName(), datum.junit.getSimpleUsername()); getContainerModel(datum.junit).delete(c.getId()); getContainerModel(datum.junit).removeListener(datum); datum.waitForEvents(); final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); } |
final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); | assertDeleted(datum.junit, c, d); | public void testDeletePostPublish() { final Container c = createContainer(datum.junit, NAME); addDocument(datum.junit, c.getId(), "JUnitTestFramework.doc"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.odt"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.pdf"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.txt"); publishToContacts(datum.junit, c.getId(), "JUnit.X thinkParity", "JUnit.Y thinkParity"); datum.waitForEvents(); getContainerModel(datum.junit).addListener(datum); logger.logInfo("Deleting container \"{0}\" as \"{1}.\"", c.getName(), datum.junit.getSimpleUsername()); getContainerModel(datum.junit).delete(c.getId()); getContainerModel(datum.junit).removeListener(datum); datum.waitForEvents(); final Container cRead = getContainerModel(datum.junit).read(c.getId()); assertNull("Container \"" + c.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c.getName() + ".\"", datum.didNotify); } |
final Container cRead = getContainerModel(datum.junit_x).read(c_x.getId()); assertNull("Container \"" + c_x.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c_x.getName() + ".\"", datum.didNotify); | assertDeleted(datum.junit_x, c_x, d_x); | public void testDeletePostPublishAsRecipient() { final Container c = createContainer(datum.junit, NAME); addDocument(datum.junit, c.getId(), "JUnitTestFramework.doc"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.odt"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.pdf"); addDocument(datum.junit, c.getId(), "JUnitTestFramework.txt"); publishToContacts(datum.junit, c.getId(), "JUnit.X thinkParity", "JUnit.Y thinkParity"); datum.waitForEvents(); final Container c_x = readContainer(datum.junit_x, c.getUniqueId()); getContainerModel(datum.junit_x).addListener(datum); logger.logInfo("Deleting container \"{0}\" as \"{1}.\"", c_x.getName(), datum.junit_x.getSimpleUsername()); getContainerModel(datum.junit_x).delete(c_x.getId()); getContainerModel(datum.junit_x).removeListener(datum); datum.waitForEvents(); final Container cRead = getContainerModel(datum.junit_x).read(c_x.getId()); assertNull("Container \"" + c_x.getName() + "\" was not deleted.", cRead); assertTrue("Container deleted event was not fired for container \"" + c_x.getName() + ".\"", datum.didNotify); } |
add(new WindowTitle(), c.clone()); | void addPanel(final AbstractJPanel jPanel) { final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; add(new WindowTitle(), c.clone()); jPanels.add(jPanel); ac.gridy++; add((Component) jPanel, ac.clone()); } |
|
ac.gridy++; | void addPanel(final AbstractJPanel jPanel) { final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; add(new WindowTitle(), c.clone()); jPanels.add(jPanel); ac.gridy++; add((Component) jPanel, ac.clone()); } |
|
finally { session.close(); } | public DocumentVersion getVersion(final Long documentId, final Long versionId) { final Session session = openSession(); try { session.prepareStatement(SQL_GET_VERSION); session.setLong(1, documentId); session.setLong(2, versionId); session.executeQuery(); if(session.nextResult()) { return extractVersion(session); } else { return null; } } catch(final RuntimeException rx) { session.rollback(); throw rx; } finally { session.close(); } } |
|
void deleteRemoteInfo(final Session session, final Long artifactId) { session.prepareStatement(SQL_DELETE_REMOTE_INFO); session.setLong(1, artifactId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete remote info."); } | public void deleteRemoteInfo(final Long artifactId) throws HypersonicException { final Session session = openSession(); try { deleteRemoteInfo(session, artifactId); session.commit(); } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } } | void deleteRemoteInfo(final Session session, final Long artifactId) { session.prepareStatement(SQL_DELETE_REMOTE_INFO); session.setLong(1, artifactId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete remote info."); } |
public KeywordSpotter() { super("Sieve.KeywordSpotter"); | public KeywordSpotter(String name, String hostname, Integer port) { super("KeywordSpotter." + name, hostname, port); | public KeywordSpotter() { super("Sieve.KeywordSpotter"); } |
public void airBrushReceiveMessage(Message msg) { super.airBrushReceiveMessage(msg); if (msg.type.equals("Keywords")) { | public boolean airBrushReceiveMessage(Message msg) { if (super.airBrushReceiveMessage(msg)) return true; if (msg.to.equals("WB.Control")) { if (msg.type.equals("KeywordSpotter.Keywords.Contents")) { contentMatchString = msg.content; System.out.println("Content match string: " + contentMatchString); return true; } else if (msg.type.equals("KeywordSpotter.Keywords.Author")) { authorMatchString = msg.content; System.out.println("Author match string: " + authorMatchString); return true; } | public void airBrushReceiveMessage(Message msg) { super.airBrushReceiveMessage(msg); if (msg.type.equals("Keywords")) { // FIXME: Do something } } |
return false; | public void airBrushReceiveMessage(Message msg) { super.airBrushReceiveMessage(msg); if (msg.type.equals("Keywords")) { // FIXME: Do something } } |
|
if (content.matches("IJsland")) { | if (content.matches(contentMatchString)) { | public Analysis doAnalysis(Story story, String topic) { Analysis a = new Analysis(); a.setID(story.getID()); a.setTopic(topic); String content = story.getContent(); if (content.matches("IJsland")) { // If the string IJsland appears in the text, it's definitely about // Iceland a.setTopicRelevance(1.0); } String author = story.getAuthor(); if (author.matches("Christian")) { // Christian writes 75% of the time about the topic a.setTopicRelevance(0.75); } return a; } |
if (author.matches("Christian")) { a.setTopicRelevance(0.75); | if (author.matches(authorMatchString)) { a.setAuthorRelevance(1.0); | public Analysis doAnalysis(Story story, String topic) { Analysis a = new Analysis(); a.setID(story.getID()); a.setTopic(topic); String content = story.getContent(); if (content.matches("IJsland")) { // If the string IJsland appears in the text, it's definitely about // Iceland a.setTopicRelevance(1.0); } String author = story.getAuthor(); if (author.matches("Christian")) { // Christian writes 75% of the time about the topic a.setTopicRelevance(0.75); } return a; } |
public SieveObject(String moduleName) { super(moduleName); | public SieveObject(String moduleName, String hostname, Integer port) { super("Sieve." + moduleName, hostname, port); | public SieveObject(String moduleName) { super(moduleName); } |
public void airBrushReceiveMessage(Message msg) { if (msg.type.equals("Story")) { System.out.println("Story received"); handleIncomingStory(msg); | public boolean airBrushReceiveMessage(Message msg) { if (super.airBrushReceiveMessage(msg)) return true; if (msg.to.equals("WB.Stories")) { if (msg.type.equals("Story")) { System.out.println("Story received"); handleIncomingStory(msg); return true; } } else if (msg.to.equals("WB.Control")) { if (msg.type.equals("Sieve.Topic")) { topicString = msg.content; System.out.println("Topic set to: " + topicString); return true; } | public void airBrushReceiveMessage(Message msg) { if (msg.type.equals("Story")) { System.out.println("Story received"); handleIncomingStory(msg); } } |
return false; | public void airBrushReceiveMessage(Message msg) { if (msg.type.equals("Story")) { System.out.println("Story received"); handleIncomingStory(msg); } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.