rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { return xmppArchive.readDocumentVersions(userId, uniqueId, versionId, documentUniqueId); | final JabberId userId, final UUID uniqueId, final Long versionId) { return xmppArchive.readDocumentVersions(userId, uniqueId, versionId); | public List<DocumentVersion> readArchiveDocumentVersions( final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { return xmppArchive.readDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } |
final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { return xmppBackup.readDocumentVersions(userId, uniqueId, versionId, documentUniqueId); | final JabberId userId, final UUID uniqueId, final Long versionId) { return xmppBackup.readDocumentVersions(userId, uniqueId, versionId); | public List<DocumentVersion> readBackupDocumentVersions( final JabberId userId, final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { return xmppBackup.readDocumentVersions(userId, uniqueId, versionId, documentUniqueId); } |
this(new TestSuite((Class<? extends TestCase>) klass)); | this(new TestSuite(klass.asSubclass(TestCase.class))); | public OldTestClassRunner(Class<?> klass) { this(new TestSuite((Class<? extends TestCase>) klass)); } |
name = "Prj.2"; | name = "Prj.1"; | protected void setUpDelete() throws Exception { final ProjectModel projectModel = getProjectModel(); final DocumentModel documentModel = getDocumentModel(); final Project testProject = createTestProject("testDelete"); deleteData = new Vector<DeleteData>(3); String name, description; Project project; // scenario 1: simple project name = "Prj.2"; description = name; project = projectModel.create(testProject, name, description); deleteData.add(new DeleteData(project, projectModel)); // scenario 2: simple project with sub-projects name = "Prj.2"; description = name; project = projectModel.create(testProject, name, description); projectModel.create(project, name + "Sub1", description + "Sub1"); projectModel.create(project, name + "Sub2", description + "Sub2"); projectModel.create(project, name + "Sub3", description + "Sub3"); projectModel.create(project, name + "Sub4", description + "Sub4"); deleteData.add(new DeleteData(project, projectModel)); // scenario 3: simple project with sub-documents name = "Prj.3"; description = name; project = projectModel.create(testProject, name, description); for(ModelTestFile testFile : getJUnitTestFiles()) { name = testFile.getName(); description = name; documentModel.create(project, name, description, testFile.getFile()); } deleteData.add(new DeleteData(project, projectModel)); // scenario 4: simple project with sub-documents & sub-projects name = "Prj.3"; description = name; project = projectModel.create(testProject, name, description); projectModel.create(project, name + "Sub1", description + "Sub1"); projectModel.create(project, name + "Sub2", description + "Sub2"); projectModel.create(project, name + "Sub3", description + "Sub3"); projectModel.create(project, name + "Sub4", description + "Sub4"); for(ModelTestFile testFile : getJUnitTestFiles()) { name = testFile.getName(); description = name; documentModel.create(project, name, description, testFile.getFile()); } deleteData.add(new DeleteData(project, projectModel)); } |
name = "Prj.3"; | name = "Prj.4"; | protected void setUpDelete() throws Exception { final ProjectModel projectModel = getProjectModel(); final DocumentModel documentModel = getDocumentModel(); final Project testProject = createTestProject("testDelete"); deleteData = new Vector<DeleteData>(3); String name, description; Project project; // scenario 1: simple project name = "Prj.2"; description = name; project = projectModel.create(testProject, name, description); deleteData.add(new DeleteData(project, projectModel)); // scenario 2: simple project with sub-projects name = "Prj.2"; description = name; project = projectModel.create(testProject, name, description); projectModel.create(project, name + "Sub1", description + "Sub1"); projectModel.create(project, name + "Sub2", description + "Sub2"); projectModel.create(project, name + "Sub3", description + "Sub3"); projectModel.create(project, name + "Sub4", description + "Sub4"); deleteData.add(new DeleteData(project, projectModel)); // scenario 3: simple project with sub-documents name = "Prj.3"; description = name; project = projectModel.create(testProject, name, description); for(ModelTestFile testFile : getJUnitTestFiles()) { name = testFile.getName(); description = name; documentModel.create(project, name, description, testFile.getFile()); } deleteData.add(new DeleteData(project, projectModel)); // scenario 4: simple project with sub-documents & sub-projects name = "Prj.3"; description = name; project = projectModel.create(testProject, name, description); projectModel.create(project, name + "Sub1", description + "Sub1"); projectModel.create(project, name + "Sub2", description + "Sub2"); projectModel.create(project, name + "Sub3", description + "Sub3"); projectModel.create(project, name + "Sub4", description + "Sub4"); for(ModelTestFile testFile : getJUnitTestFiles()) { name = testFile.getName(); description = name; documentModel.create(project, name, description, testFile.getFile()); } deleteData.add(new DeleteData(project, projectModel)); } |
if (this.listeners.containsKey(impl)) { listeners = this.listeners.get(impl); | if (this.listeners.containsKey(impl.getClass())) { listeners = this.listeners.get(impl.getClass()); | <T extends EventListener> boolean add(final AbstractModelImpl impl, final T listener) { final List<EventListener> listeners; if (this.listeners.containsKey(impl)) { listeners = this.listeners.get(impl); } else { listeners = new ArrayList<EventListener>(); } final boolean modified = listeners.add(listener); this.listeners.put(impl, listeners); return modified; } |
this.listeners.put(impl, listeners); | this.listeners.put(impl.getClass(), listeners); | <T extends EventListener> boolean add(final AbstractModelImpl impl, final T listener) { final List<EventListener> listeners; if (this.listeners.containsKey(impl)) { listeners = this.listeners.get(impl); } else { listeners = new ArrayList<EventListener>(); } final boolean modified = listeners.add(listener); this.listeners.put(impl, listeners); return modified; } |
if (this.listeners.containsKey(impl)) { | if (this.listeners.containsKey(impl.getClass())) { | <T extends EventListener> List<T> get(final AbstractModelImpl impl) { final List<T> listeners; if (this.listeners.containsKey(impl)) { listeners = new ArrayList<T>(); for (final EventListener listener : this.listeners.get(impl)) { listeners.add((T) listener); } } else { listeners = Collections.emptyList(); } return listeners; } |
for (final EventListener listener : this.listeners.get(impl)) { | for (final EventListener listener : this.listeners.get(impl.getClass())) { | <T extends EventListener> List<T> get(final AbstractModelImpl impl) { final List<T> listeners; if (this.listeners.containsKey(impl)) { listeners = new ArrayList<T>(); for (final EventListener listener : this.listeners.get(impl)) { listeners.add((T) listener); } } else { listeners = Collections.emptyList(); } return listeners; } |
this.listeners = new HashMap<AbstractModelImpl, List<EventListener>>(); | this.listeners = new HashMap<Class<? extends AbstractModelImpl>, List<EventListener>>(); | ListenersImpl(final WorkspaceImpl workspace) { super(); this.listeners = new HashMap<AbstractModelImpl, List<EventListener>>(); } |
if (this.listeners.containsKey(impl)) { listeners = this.listeners.get(impl); | if (this.listeners.containsKey(impl.getClass())) { listeners = this.listeners.get(impl.getClass()); | <T extends EventListener> boolean remove(final AbstractModelImpl impl, final T listener) { final List<EventListener> listeners; if (this.listeners.containsKey(impl)) { listeners = this.listeners.get(impl); } else { return false; } return listeners.remove(listener); } |
return listeners.remove(listener); | final boolean modified = listeners.remove(listener); this.listeners.put(impl.getClass(), listeners); return modified; | <T extends EventListener> boolean remove(final AbstractModelImpl impl, final T listener) { final List<EventListener> listeners; if (this.listeners.containsKey(impl)) { listeners = this.listeners.get(impl); } else { return false; } return listeners.remove(listener); } |
this.resizer = new Resizer(getController(), this, isSupportMouseMove(), getResizeEdges()); final List<Component> componentsThatSupportMouseMove = getComponentsThatSupportMouseMove(); if (null!=componentsThatSupportMouseMove) { resizer.addComponentsThatSupportMouseMove(componentsThatSupportMouseMove); | if (null==this.resizer) { this.resizer = new Resizer(getController(), this, isSupportMouseMove(), getResizeEdges()); final List<Component> componentsThatSupportMouseMove = getComponentsThatSupportMouseMove(); if (null!=componentsThatSupportMouseMove) { resizer.addComponentsThatSupportMouseMove(componentsThatSupportMouseMove); } | public void installResizer() { this.resizer = new Resizer(getController(), this, isSupportMouseMove(), getResizeEdges()); final List<Component> componentsThatSupportMouseMove = getComponentsThatSupportMouseMove(); if (null!=componentsThatSupportMouseMove) { resizer.addComponentsThatSupportMouseMove(componentsThatSupportMouseMove); } } |
public void addComponentsThatSupportMouseMove(final List<Component>components) { if (null != components) { for (final Component component : components) { component.addMouseMotionListener(new MouseMotionAdapter() { | public void addComponentsThatSupportMouseMove(final List<Component>componentsThatSupportMouseMove) { if (null != componentsThatSupportMouseMove) { for (final Component component : componentsThatSupportMouseMove) { final MouseMotionAdapter mouseMotionAdapter = new MouseMotionAdapter() { | public void addComponentsThatSupportMouseMove(final List<Component>components) { if (null != components) { for (final Component component : components) { component.addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { formMouseDragged(evt, component); } }); component.addMouseListener(new MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { formMousePressed(evt, component); } public void mouseReleased(java.awt.event.MouseEvent evt) { formMouseReleased(evt, component); } }); } } } |
}); component.addMouseListener(new MouseAdapter() { | }; final MouseAdapter mouseAdapter = new MouseAdapter() { | public void addComponentsThatSupportMouseMove(final List<Component>components) { if (null != components) { for (final Component component : components) { component.addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { formMouseDragged(evt, component); } }); component.addMouseListener(new MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { formMousePressed(evt, component); } public void mouseReleased(java.awt.event.MouseEvent evt) { formMouseReleased(evt, component); } }); } } } |
}); | }; component.addMouseMotionListener(mouseMotionAdapter); component.addMouseListener(mouseAdapter); components.add(component); mouseMotionAdapters.put(component, mouseMotionAdapter); mouseAdapters.put(component, mouseAdapter); | public void addComponentsThatSupportMouseMove(final List<Component>components) { if (null != components) { for (final Component component : components) { component.addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { formMouseDragged(evt, component); } }); component.addMouseListener(new MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { formMousePressed(evt, component); } public void mouseReleased(java.awt.event.MouseEvent evt) { formMouseReleased(evt, component); } }); } } } |
return MessageFormat.format("[{1}] [{2}] - [{3}]", | return MessageFormat.format("[{0}] [{1}] - [{2}]", | private Object getErrorId(final Throwable t) { return MessageFormat.format("[{1}] [{2}] - [{3}]", StackUtil.getFrameClassName(2).toUpperCase(), StackUtil.getFrameMethodName(2).toUpperCase(), t.getMessage()); } |
return getCallerMethodName(2); | return getCallerMethodName(3); | public static String getCallerMethodName() { return getCallerMethodName(2); } |
private JMenuItem createJMenuItem(final String textLocalKey, final ActionListener actionListener) { return createJMenuItem(getString(textLocalKey), getMnemonic(textLocalKey), actionListener); } | private JMenuItem createJMenuItem(final String textLocalKey) { return MenuItemFactory.create( getString(textLocalKey), getMnemonic(textLocalKey)); } | private JMenuItem createJMenuItem(final String textLocalKey, final ActionListener actionListener) { return createJMenuItem(getString(textLocalKey), getMnemonic(textLocalKey), actionListener); } |
public void actionPerformed(final ActionEvent e) { getController().reloadMainList(); } | public void actionPerformed(ActionEvent e) { notKey.setSelected(false); getController().removeKeyHolderFilter(); getController().applyKeyHolderFilter(Boolean.TRUE); }}); | public void actionPerformed(final ActionEvent e) { getController().reloadMainList(); } |
sortJLabelMouseReleased(e); | filterJLabelMouseReleased(e); | private void initComponents() { filterJLabel = LabelFactory.create(FILTER_ICON); filterJLabel.setToolTipText(getString("FilterButtonToolTip")); filterJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(final MouseEvent e) { filterJLabel.setIcon(FILTER_ROLLOVER_ICON); } public void mouseExited(MouseEvent e) { filterJLabel.setIcon(FILTER_ICON); } public void mouseReleased(final MouseEvent e) { sortJLabelMouseReleased(e); } }); infoJLabel = LabelFactory.create(); infoJLabel.setHorizontalAlignment(SwingConstants.CENTER); toggleHistoryJLabel = LabelFactory.create(getHistoryIcon()); toggleHistoryJLabel.setToolTipText(getString("ToggleHistoryButtonToolTip")); toggleHistoryJLabel.addMouseListener(new MouseAdapter() { public void mouseClicked(final MouseEvent e) { toggleHistoryJLabelMouseClicked(e); } public void mouseEntered(final MouseEvent e) { toggleHistoryJLabel.setIcon(getHistoryRolloverIcon()); } public void mouseExited(final MouseEvent e) { toggleHistoryJLabel.setIcon(getHistoryIcon()); } }); final GridBagConstraints c = new GridBagConstraints(); c.insets.left = 7; add(filterJLabel, c.clone()); c.fill = GridBagConstraints.HORIZONTAL; c.insets.left = 0; c.weightx = 1; add(infoJLabel, c.clone()); c.fill = GridBagConstraints.NONE; c.insets.right = 8; c.weightx = 0; add(toggleHistoryJLabel, c.clone()); } |
if(0 < getDocumentCount()) { | if(getController().isHistoryEnabled()) { | public void reload() { reloadInfo(); if(0 < getDocumentCount()) { toggleHistoryJLabel.setEnabled(true); if(SwingUtil.regionContains(toggleHistoryJLabel.getBounds(), getMousePosition())) { toggleHistoryJLabel.setIcon(getHistoryRolloverIcon()); } else { toggleHistoryJLabel.setIcon(getHistoryIcon()); } } else { // if the history is visible; kill it if(getController().isHistoryVisible()) { getController().toggleHistory3Avatar(); } toggleHistoryJLabel.setEnabled(false); toggleHistoryJLabel.setIcon(INVISIBLE_HISTORY_ICON); } } |
MessageFactory messageFactory) throws ConfigError { super(application, messageStoreFactory, settings, messageFactory); | LogFactory logFactory, MessageFactory messageFactory) throws ConfigError { super(application, messageStoreFactory, settings, logFactory, messageFactory); | public ThreadedSocketInitiator(Application application, MessageStoreFactory messageStoreFactory, SessionSettings settings, MessageFactory messageFactory) throws ConfigError { super(application, messageStoreFactory, settings, messageFactory); } |
UserNameBuilder(final String first, final String middle, final String last) { | UserNameBuilder(final String first, final String last) { | UserNameBuilder(final String first, final String middle, final String last) { super(); if(null == first) { throw new NullPointerException(); } if(null == last) { throw new NullPointerException(); } this.first = first; this.middle = middle; this.last = last; } |
if(null == first) { throw new NullPointerException(); } if(null == last) { throw new NullPointerException(); } | UserNameBuilder(final String first, final String middle, final String last) { super(); if(null == first) { throw new NullPointerException(); } if(null == last) { throw new NullPointerException(); } this.first = first; this.middle = middle; this.last = last; } |
|
this.middle = middle; | this.middle = null; | UserNameBuilder(final String first, final String middle, final String last) { super(); if(null == first) { throw new NullPointerException(); } if(null == last) { throw new NullPointerException(); } this.first = first; this.middle = middle; this.last = last; } |
if(null == first || null == last) { return null; } final StringBuffer name = new StringBuffer(first); if(null != middle) { name.append(User.NAME_SEP).append(middle); } name.append(User.NAME_SEP).append(last); | if(null == first && null == middle && null == last) { return null; } final StringBuffer name = new StringBuffer(); if(null != first) { name.append(first); } if(null != middle) { if(0 < name.length()) { name.append(User.NAME_SEP); } name.append(middle); } if(null != last) { if(0 < name.length()) { name.append(User.NAME_SEP); } name.append(last); } | public String getName() { if(null == first || null == last) { return null; } final StringBuffer name = new StringBuffer(first); if(null != middle) { name.append(User.NAME_SEP).append(middle); } name.append(User.NAME_SEP).append(last); return name.toString(); } |
public void teamMemberRemoved(DocumentEvent e) { if(e.isRemote()) browser.fireDocumentTeamMemberRemoved(e.getDocument().getId()); } | private DocumentListener createDocumentListener() { return new DocumentAdapter() { public void confirmationReceived(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentConfirmationReceived(e.getDocument().getId()); } } public void documentClosed(final DocumentEvent e) { if(e.isRemote()) { browser.getArtifactModel().removeFlagSeen(e.getDocument().getId()); browser.fireDocumentUpdated(e.getDocument().getId()); } } public void documentCreated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentCreated(e.getDocument().getId(), Boolean.TRUE); } } public void documentUpdated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(e.getDocument().getId(), Boolean.TRUE); } } public void keyRequestAccepted(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(e.getDocument().getId(), e.isRemote()); } } public void keyRequestDeclined(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(e.getDocument().getId(), e.isRemote()); } } public void keyRequested(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(e.getDocument().getId(), e.isRemote()); } } public void teamMemberAdded(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentTeamMemberAdded(e.getDocument().getId()); } } }; } |
|
for (final WorkspaceImpl workspace : WORKSPACES) { | for (final WorkspaceImpl workspace : WORKSPACES.values()) { | public void run() { Logger.getLogger(getClass()).trace("Runtime shutting down."); synchronized (WORKSPACES) { List<ShutdownHook> shutdownHooks; for (final WorkspaceImpl workspace : WORKSPACES) { Logger.getLogger(getClass()).trace( MessageFormat.format("Workspace {0} shutting down.", workspace.getName())); shutdownHooks = workspace.getShutdownHooks(); for(final ShutdownHook shutdownHook : shutdownHooks) { Logger.getLogger(getClass()).trace( MessageFormat.format("Workspace {0} priority {1} hook {2} shutting down.", workspace.getName(), shutdownHook.getPriority(), shutdownHook.getName())); shutdownHook.run(); } } } } |
for (final WorkspaceImpl impl : WORKSPACES) { | for (final WorkspaceImpl impl : WORKSPACES.values()) { | private WorkspaceImpl findImpl(final Workspace workspace) { synchronized (WORKSPACES) { for (final WorkspaceImpl impl : WORKSPACES) { if (impl.getWorkspaceDirectory().equals(workspace.getWorkspaceDirectory())) { return impl; } } } return null; } |
final WorkspaceImpl impl = new WorkspaceImpl(workspace); if (WORKSPACES.contains(impl)) { return WORKSPACES.get(WORKSPACES.indexOf(impl)); | if (WORKSPACES.containsKey(workspace)) { return WORKSPACES.get(workspace); | Workspace getWorkspace(final File workspace) { synchronized (WORKSPACES) { final WorkspaceImpl impl = new WorkspaceImpl(workspace); if (WORKSPACES.contains(impl)) { return WORKSPACES.get(WORKSPACES.indexOf(impl)); } else { WORKSPACES.add(open(impl)); return getWorkspace(workspace); } } } |
WORKSPACES.add(open(impl)); | final WorkspaceImpl impl = new WorkspaceImpl(workspace); WORKSPACES.put(workspace, open(impl)); | Workspace getWorkspace(final File workspace) { synchronized (WORKSPACES) { final WorkspaceImpl impl = new WorkspaceImpl(workspace); if (WORKSPACES.contains(impl)) { return WORKSPACES.get(WORKSPACES.indexOf(impl)); } else { WORKSPACES.add(open(impl)); return getWorkspace(workspace); } } } |
public File[] list(final String path, final FileFilter filter) { return list(path, filter, Boolean.FALSE); | public File[] list(final String path) { return list(path, Boolean.FALSE); | public File[] list(final String path, final FileFilter filter) { return list(path, filter, Boolean.FALSE); } |
final Integer publishedToCount = readPublishedToCount(containerId, versionId); | final int publishedToCount = readPublishedToCount(containerId, versionId); | public void deleteVersion(Long containerId, Long versionId) { final Session session = openSession(); try { final Integer publishedToCount = readPublishedToCount(containerId, versionId); session.prepareStatement(SQL_DELETE_PUBLISHED_TO); session.setLong(1, containerId); session.setLong(2, versionId); final Integer publishedToDeleted = session.executeUpdate(); if (publishedToCount != publishedToDeleted) throw translateError( "Could only delete {0} of {1} published to rows.", publishedToDeleted, publishedToCount); deleteSharedWith(session, containerId, versionId); session.prepareStatement(SQL_DELETE_VERSION); session.setLong(1, containerId); session.setLong(2, versionId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete version."); artifactIO.deleteVersion(session, containerId, versionId); session.commit(); } catch (final Throwable t) { session.rollback(); throw translateError(t); } finally { session.close(); } } |
final Integer publishedToDeleted = session.executeUpdate(); | final int publishedToDeleted = session.executeUpdate(); | public void deleteVersion(Long containerId, Long versionId) { final Session session = openSession(); try { final Integer publishedToCount = readPublishedToCount(containerId, versionId); session.prepareStatement(SQL_DELETE_PUBLISHED_TO); session.setLong(1, containerId); session.setLong(2, versionId); final Integer publishedToDeleted = session.executeUpdate(); if (publishedToCount != publishedToDeleted) throw translateError( "Could only delete {0} of {1} published to rows.", publishedToDeleted, publishedToCount); deleteSharedWith(session, containerId, versionId); session.prepareStatement(SQL_DELETE_VERSION); session.setLong(1, containerId); session.setLong(2, versionId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete version."); artifactIO.deleteVersion(session, containerId, versionId); session.commit(); } catch (final Throwable t) { session.rollback(); throw translateError(t); } finally { session.close(); } } |
writeReceivedFrom(xmppDocument.getReceivedFrom(), writer, context); | public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { logger.info("marshal(Object,HierarchicalStreamWriter,MarshallingContext)"); final XMPPDocument xmppDocument = (XMPPDocument) source; logger.debug(xmppDocument); writeUniqueId(xmppDocument.getUniqueId(), writer, context); writeVersionId(xmppDocument.getVersionId(), writer, context); writeName(xmppDocument.getName(), writer, context); writeCreatedBy(xmppDocument.getCreatedBy(), writer, context); writeCreatedOn(xmppDocument.getCreatedOn(), writer, context); writeUpdatedBy(xmppDocument.getUpdatedBy(), writer, context); writeUpdatedOn(xmppDocument.getUpdatedOn(), writer, context); writeDescription(xmppDocument.getDescription(), writer, context); try { writeContent(xmppDocument.getContent(), writer, context); } catch(IOException iox) { logger.error("marshal(Object,HierarchicalStreamWriter,MarshallingContext)", iox); throw XMPPConverterErrorTranslator.translate(iox); } } |
|
name, uniqueId, updatedBy, updatedOn, versionId); | name, receivedFrom, uniqueId, updatedBy, updatedOn, versionId); | public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { final UUID uniqueId = readUniqueId(reader, context); final Long versionId = readVersionId(reader, context); final String name = readName(reader, context); final String createdBy = readCreatedBy(reader, context); final Calendar createdOn = readCreatedOn(reader, context); final String updatedBy = readUpdatedBy(reader, context); final Calendar updatedOn = readUpdatedOn(reader, context); final String description = readDescription(reader, context); final byte[] content; try { content = readContent(reader, context); } catch(DataFormatException dfx) { logger.error("unmarshal(HierarchicalStreamReader,UnmarshallingContext)", dfx); throw XmlIOConverterErrorTranslator.translate(dfx); } catch(IOException iox) { logger.error("unmarshal(HierarchicalStreamReader,UnmarshallingContext)", iox); throw XmlIOConverterErrorTranslator.translate(iox); } return XMPPDocument.create(content, createdBy, createdOn, description, name, uniqueId, updatedBy, updatedOn, versionId); } |
final XMPPEventHandler<T> handler; synchronized (registry) { handler = registry.get(event.getClass()); } | final XMPPEventHandler<T> handler = registry.get(event.getClass()); | <T extends XMPPEvent> void notifyHandler(final T event) { final XMPPEventHandler<T> handler; synchronized (registry) { handler = registry.get(event.getClass()); } if (null == handler) { logger.logWarning("No handler has been registered for event {0}.", event.getClass()); } else { handler.handleEvent(event); } } |
final StringBuffer properties = new StringBuffer("---Model Test Framework---"); PropertiesUtil.print(properties, System.getProperties()); logger.debug(properties); | ModelTestCaseHelper(final ModelTestCase modelTestCase) { super(); } |
|
global.setProperty("log4j.logger.com.thinkparity.browser.application.browser.Browser", "ERROR"); | private static void configureGlobal(final Properties global) { global.setProperty("log4j.logger.com.thinkparity.model.xmpp.XMPPSessionImpl", "DEBUG"); global.setProperty("log4j.logger.com.thinkparity.model", "INFO"); global.setProperty("log4j.logger.com.thinkparity.model.parity.model.io", "WARN"); } |
|
putValue(MNEMONIC_KEY, new Integer(action.getMnemonic().charAt(0))); | putValue(MNEMONIC_KEY, Integer.valueOf(action.getMnemonic().charAt(0))); | private void setMnemonicAndAccelerator() { if (action.isSetMnemonic()) { putValue(MNEMONIC_KEY, new Integer(action.getMnemonic().charAt(0))); } if (action.isSetAccelerator()) { putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(action.getAccelerator())); } } |
try { queryHit.setDataId(parseLong(hit, idField)); } | try { queryHit.setDataId(parseLong(hit, idField)); queryHit.setDocument(hit.getDocument()); } | public QueryHit toQueryHit(final Hit hit) { final QueryHit queryHit = new QueryHit(); try { queryHit.setDataId(parseLong(hit, idField)); } catch(final IOException iox) { throw new IndexException("Could not extract hit value.", iox); } return queryHit; } |
modifyDocument(OpheliaTestUser.JUNIT, document); | modifyDocument(OpheliaTestUser.JUNIT, document.getId()); | protected void setUp() throws Exception { super.setUp(); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final Document document = addDocument(OpheliaTestUser.JUNIT, container, getInputFiles()[0]); login(OpheliaTestUser.JUNIT); publishToContacts(OpheliaTestUser.JUNIT, container); createContainerDraft(OpheliaTestUser.JUNIT, container); modifyDocument(OpheliaTestUser.JUNIT, document); logout(OpheliaTestUser.JUNIT); datum = new Fixture(container, containerModel, document); datum.containerModel.addListener(datum); } |
final Container container, final String... contactNames) { | final Container container) { final List<TeamMember> teamMembers = Collections.emptyList(); | protected void publishToContacts(final OpheliaTestUser testUser, final Container container, final String... contactNames) { final List<Contact> contacts = readContacts(testUser); userUtils.filter(contacts, contactNames); final List<TeamMember> teamMembers = Collections.emptyList(); logTrace("{0} - Publishing container {1} to contacts {2} and team members {3}.", getName(), container.getName(), contacts, teamMembers); getContainerModel(testUser).publish(container.getId(), contacts, teamMembers); } |
userUtils.filter(contacts, contactNames); final List<TeamMember> teamMembers = Collections.emptyList(); | protected void publishToContacts(final OpheliaTestUser testUser, final Container container, final String... contactNames) { final List<Contact> contacts = readContacts(testUser); userUtils.filter(contacts, contactNames); final List<TeamMember> teamMembers = Collections.emptyList(); logTrace("{0} - Publishing container {1} to contacts {2} and team members {3}.", getName(), container.getName(), contacts, teamMembers); getContainerModel(testUser).publish(container.getId(), contacts, teamMembers); } |
|
this.queueLock = new Object(); | XMPPSystem(final XMPPCore core) { super(core); } |
|
final XMPPMethod processOfflineQueue = new XMPPMethod("system:readqueueevents"); processOfflineQueue.setParameter("userId", userId); final List<XMPPEvent> events = execute(processOfflineQueue, Boolean.TRUE).readResultEvents("events"); for (final XMPPEvent event : events) { logger.logVariable("event", event); notifyHandler(event); deleteQueueEvent(userId, event.getId()); | synchronized (queueLock) { final XMPPMethod processOfflineQueue = new XMPPMethod("system:readqueueevents"); processOfflineQueue.setParameter("userId", userId); final List<XMPPEvent> events = execute(processOfflineQueue, Boolean.TRUE).readResultEvents("events"); for (final XMPPEvent event : events) { xmppCore.handleEvent(event); deleteQueueEvent(userId, event.getId()); } | void processEventQueue(final JabberId userId) { logger.logApiId(); logger.logVariable("userId", userId); final XMPPMethod processOfflineQueue = new XMPPMethod("system:readqueueevents"); processOfflineQueue.setParameter("userId", userId); final List<XMPPEvent> events = execute(processOfflineQueue, Boolean.TRUE).readResultEvents("events"); for (final XMPPEvent event : events) { logger.logVariable("event", event); notifyHandler(event); deleteQueueEvent(userId, event.getId()); } } |
protected ParityObject(final Project parent, final String name, final String description, final Calendar createdOn, final String createdBy, final String keyHolder, final UUID id) { | protected ParityObject(final Project parent, final String name, final String description, final Calendar createdOn, final String createdBy, final UUID id) { | protected ParityObject(final Project parent, final String name, final String description, final Calendar createdOn, final String createdBy, final String keyHolder, final UUID id) { super(); this.parent = parent; this.name = name; this.description = description; this.createdOn = createdOn; this.createdBy = createdBy; this.keyHolder = keyHolder; this.notes = new Vector<Note>(7); this.customProperties = new Properties(createDefaultCustomProperties(name, description)); this.id = id; } |
this.keyHolder = keyHolder; | protected ParityObject(final Project parent, final String name, final String description, final Calendar createdOn, final String createdBy, final String keyHolder, final UUID id) { super(); this.parent = parent; this.name = name; this.description = description; this.createdOn = createdOn; this.createdBy = createdBy; this.keyHolder = keyHolder; this.notes = new Vector<Note>(7); this.customProperties = new Properties(createDefaultCustomProperties(name, description)); this.id = id; } |
|
logger.logVariable("variable", artifactId); return null != artifactIO.readUniqueId(artifactId); | logger.logVariable("artifactId", artifactId); try { return artifactIO.doesExist(artifactId); } catch (final Throwable t) { throw translateError(t); } | Boolean doesExist(final Long artifactId) { logger.logApiId(); logger.logVariable("variable", artifactId); return null != artifactIO.readUniqueId(artifactId); } |
artifactIO.deleteTeamRel(artifactId); | final User user = getInternalUserModel().read(event.getJabberId()); artifactIO.deleteTeamRel(artifactId, user.getLocalId()); | void handleTeamMemberRemoved(final ArtifactTeamMemberRemovedEvent event) { logger.logApiId(); logger.logVariable("event", event); try { final Long artifactId = readId(event.getUniqueId()); artifactIO.deleteTeamRel(artifactId); } catch(final Throwable t) { throw translateError(t); } } |
public TeamMember readTeamRel(final Long artifactId, final Long userId); | public Set<User> readTeamRel(final Long artifactId) throws HypersonicException; | public TeamMember readTeamRel(final Long artifactId, final Long userId); |
Integer containerIndex = model.indexOfContainerPanel(container); | public Color getBackground(final int index) { final Color color; Integer containerIndex = model.indexOfContainerPanel(container); if (isSelectedContainer()) { color = Colors.Browser.List.LIST_SELECTION_BG; } else { color = Colors.Browser.List.LIST_EXPANDED_NOT_SELECTED_BG; } leftJPanel.setBackground(color); rightJPanel.setBackground(color); return color; } |
|
getPlatform().getAvatarRegistry().get(AvatarId.DOCUMENT_HISTORY3).reload(); | final Avatar avatar = getPlatform().getAvatarRegistry().get(AvatarId.DOCUMENT_HISTORY3); if(null != avatar) { avatar.reload(); } | void reloadHistoryList() { getPlatform().getAvatarRegistry().get(AvatarId.DOCUMENT_HISTORY3).reload(); } |
tabPanel.panelCellMousePressed(cell, e); if (e.getButton() == MouseEvent.BUTTON1) { | tabPanel.panelCellMousePressed(cell, Boolean.TRUE, e); if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 1) { | protected void installListeners(final DefaultTabPanel tabPanel, final javax.swing.JLabel iconJLabel) { iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(final java.awt.event.MouseEvent e) { tabPanel.panelCellMousePressed(cell, e); if (e.getButton() == MouseEvent.BUTTON1) { if (cell.isActionAvailable()) { cell.invokeAction(); } } } public void mouseEntered(final java.awt.event.MouseEvent e) { if (cell.isActionAvailable()) { SwingUtil.setCursor(DefaultCellRenderer.this, java.awt.Cursor.HAND_CURSOR); } } public void mouseExited(final java.awt.event.MouseEvent e) { if (cell.isActionAvailable()) { SwingUtil.setCursor(DefaultCellRenderer.this, java.awt.Cursor.DEFAULT_CURSOR); } } }); addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(final java.awt.event.MouseEvent e) { tabPanel.panelCellMousePressed(cell, e); maybeShowPopup(e); } public void mouseReleased(final java.awt.event.MouseEvent e) { maybeShowPopup(e); } }); } |
tabPanel.panelCellMousePressed(cell, e); | tabPanel.panelCellMousePressed(cell, Boolean.FALSE, e); | protected void installListeners(final DefaultTabPanel tabPanel, final javax.swing.JLabel iconJLabel) { iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(final java.awt.event.MouseEvent e) { tabPanel.panelCellMousePressed(cell, e); if (e.getButton() == MouseEvent.BUTTON1) { if (cell.isActionAvailable()) { cell.invokeAction(); } } } public void mouseEntered(final java.awt.event.MouseEvent e) { if (cell.isActionAvailable()) { SwingUtil.setCursor(DefaultCellRenderer.this, java.awt.Cursor.HAND_CURSOR); } } public void mouseExited(final java.awt.event.MouseEvent e) { if (cell.isActionAvailable()) { SwingUtil.setCursor(DefaultCellRenderer.this, java.awt.Cursor.DEFAULT_CURSOR); } } }); addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(final java.awt.event.MouseEvent e) { tabPanel.panelCellMousePressed(cell, e); maybeShowPopup(e); } public void mouseReleased(final java.awt.event.MouseEvent e) { maybeShowPopup(e); } }); } |
tabPanel.panelCellMousePressed(cell, e); if (e.getButton() == MouseEvent.BUTTON1) { | tabPanel.panelCellMousePressed(cell, Boolean.TRUE, e); if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 1) { | public void mousePressed(final java.awt.event.MouseEvent e) { tabPanel.panelCellMousePressed(cell, e); if (e.getButton() == MouseEvent.BUTTON1) { if (cell.isActionAvailable()) { cell.invokeAction(); } } } |
tabPanel.panelCellMousePressed(cell, e); | tabPanel.panelCellMousePressed(cell, Boolean.FALSE, e); | public void mousePressed(final java.awt.event.MouseEvent e) { tabPanel.panelCellMousePressed(cell, e); maybeShowPopup(e); } |
public void panelCellMousePressed(final Cell cell, final java.awt.event.MouseEvent e) { | public void panelCellMousePressed(final Cell cell, final Boolean onIcon, final java.awt.event.MouseEvent e) { | public void panelCellMousePressed(final Cell cell, final java.awt.event.MouseEvent e) { } |
Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { | boolean isComplete = false; while (false == isComplete) { | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleDraftCreatedIQ query = new HandleDraftCreatedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("uniqueId")) { query.uniqueId = readUniqueId2(); } else if (isStartTag("createdBy")) { query.createdBy = readJabberId2(); } else if (isStartTag("createdOn")) { query.createdOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
isComplete = Boolean.TRUE; | isComplete = true; | public IQ parseIQ(final XmlPullParser parser) throws Exception { setParser2(parser); final HandleDraftCreatedIQ query = new HandleDraftCreatedIQ(); Boolean isComplete = Boolean.FALSE; while (Boolean.FALSE == isComplete) { if (isStartTag("uniqueId")) { query.uniqueId = readUniqueId2(); } else if (isStartTag("createdBy")) { query.createdBy = readJabberId2(); } else if (isStartTag("createdOn")) { query.createdOn = readCalendar2(); } else { isComplete = Boolean.TRUE; } } return query; } |
this.resizer = new Resizer(getBrowser(), containerJLabel, Boolean.FALSE, Resizer.ResizeEdges.LEFT); | this.resizer = new Resizer(getBrowser(), this, Boolean.TRUE, Resizer.ResizeEdges.LEFT); this.containerJLabelResizer = new Resizer(getBrowser(), containerJLabel, Boolean.FALSE, Resizer.ResizeEdges.LEFT); | public MainTitleAvatarTabPanel() { super(); this.allTabs = new HashMap<TabId, Tab>(); this.pluginTabs = new HashMap<PluginExtension, Tab>(); initComponents(); this.resizer = new Resizer(getBrowser(), containerJLabel, Boolean.FALSE, Resizer.ResizeEdges.LEFT); } |
public static JLabel create(final Icon icon) { | public static JLabel create() { | public static JLabel create(final Icon icon) { synchronized (singletonLock) { return singleton.doCreate(icon); } } |
return singleton.doCreate(icon); | return singleton.doCreate(); | public static JLabel create(final Icon icon) { synchronized (singletonLock) { return singleton.doCreate(icon); } } |
this.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(final java.awt.event.MouseEvent e) { if (e.getButton()==MouseEvent.BUTTON1) { if (e.getClickCount() % 2 == 0) { getBrowser().maximize(); } } } }); | protected MainTitleAvatarAbstractPanel() { super(); } |
|
this.history = new LinkedList<MainCellHistoryItem>(); | this.visibleHistory = new Hashtable<MainCellDocument, List<MainCellHistoryItem>>(10, 0.65F); | BrowserMainDocumentModel(final Browser browser) { super(); this.browser = browser; this.documentFilter = new FilterChain<Artifact>(); this.documents = new LinkedList<MainCellDocument>(); this.history = new LinkedList<MainCellHistoryItem>(); this.jListModel = new DefaultListModel(); this.logger = browser.getPlatform().getLogger(getClass()); this.touchedDocuments = new LinkedList<MainCellDocument>(); this.visibleDocuments = new LinkedList<MainCellDocument>(); } |
for(final Iterator<MainCellHistoryItem> i = history.iterator(); i.hasNext();) { | for(final Iterator<MainCellHistoryItem> i = visibleHistory.get(mcd).iterator(); i.hasNext();) { | private void collapse(final MainCellDocument mcd) { mcd.setExpanded(Boolean.FALSE); MainCellHistoryItem mchi; for(final Iterator<MainCellHistoryItem> i = history.iterator(); i.hasNext();) { mchi = i.next(); if(mchi.getDocument().equals(mcd)) { i.remove(); } } } |
logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + history.size() + " HISTORY ITEMS]"); for(final MainCellHistoryItem mchi : history) { logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mchi.getText() + "]"); | logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + visibleHistorySize() + " HISTORY ITEMS]"); for(final List<MainCellHistoryItem> l : visibleHistory.values()) { for(final MainCellHistoryItem mchi : l) { logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mchi.getText() + "]"); } | void debug() { if(browser.getPlatform().isDebugMode()) { // documents logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + documents.size() + " DOCUMENTS]"); for(final MainCellDocument mcd : documents) logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mcd.getText() + "]"); // visible documents logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + visibleDocuments.size() + " VISIBLE DOCUMENTS]"); for(final MainCellDocument mcd : visibleDocuments) logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mcd.getText() + "]"); // history items logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + history.size() + " HISTORY ITEMS]"); for(final MainCellHistoryItem mchi : history) { logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mchi.getText() + "]"); } logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + jListModel.size() + " LIST CELLS]"); final Enumeration e = jListModel.elements(); while(e.hasMoreElements()) logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + ((MainCell) e.nextElement()).getText() + "]"); documentFilter.debug(logger); } } |
while(e.hasMoreElements()) logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + ((MainCell) e.nextElement()).getText() + "]"); | MainCell mc; while(e.hasMoreElements()) { mc = (MainCell) e.nextElement(); logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mc.getText() + "] [" + mc.isGroupSelected() + "]"); } | void debug() { if(browser.getPlatform().isDebugMode()) { // documents logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + documents.size() + " DOCUMENTS]"); for(final MainCellDocument mcd : documents) logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mcd.getText() + "]"); // visible documents logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + visibleDocuments.size() + " VISIBLE DOCUMENTS]"); for(final MainCellDocument mcd : visibleDocuments) logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mcd.getText() + "]"); // history items logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + history.size() + " HISTORY ITEMS]"); for(final MainCellHistoryItem mchi : history) { logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + mchi.getText() + "]"); } logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + jListModel.size() + " LIST CELLS]"); final Enumeration e = jListModel.elements(); while(e.hasMoreElements()) logger.debug("[BROWSER2] [APP] [B2] [MAIN MODEL] [" + ((MainCell) e.nextElement()).getText() + "]"); documentFilter.debug(logger); } } |
for(final MainCellHistoryItem mchi : mchiArray) { history.add(mchi); } | final List<MainCellHistoryItem> lmchi = visibleHistory.containsKey(mcd) ? visibleHistory.get(mcd) : new LinkedList<MainCellHistoryItem>(); for(final MainCellHistoryItem mchi : mchiArray) { lmchi.add(mchi); } visibleHistory.put(mcd, lmchi); | private void expand(final MainCellDocument mcd) { mcd.setExpanded(Boolean.TRUE); final MainCellHistoryItem[] mchiArray = (MainCellHistoryItem[]) contentProvider.getElements(1, mcd); for(final MainCellHistoryItem mchi : mchiArray) { history.add(mchi); } } |
if(mainCell instanceof MainCellDocument || mainCell instanceof MainCellHistoryItem) { for(final MainCell mc : getAllCells()) { mc.setGroupSelected(Boolean.FALSE); } for(final MainCell mc : getDocumentGroup(mainCell)) { mc.setGroupSelected(Boolean.TRUE); } } | void triggerSelection(final MainCell mainCell) { if(mainCell instanceof MainCellDocument) { browser.selectDocument(((MainCellDocument) mainCell).getId()); } } |
|
for(final User teamMember : team) { | for(final User teamMember : team) | 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); } } } } |
} | 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); } } } } |
|
avatar.setRoundCorners(Boolean.TRUE); | void open(final String title, final Avatar avatar) { getRootPane().setBorder(new WindowBorder()); setTitle(title); add(avatar); pack(); avatar.reload(); avatar.setRoundCorners(Boolean.TRUE); setLocation(calculateLocation()); roundCorners(); setVisible(true); } |
|
roundCorners(); | new NativeSkin().roundCorners(this); | void open(final String title, final Avatar avatar) { getRootPane().setBorder(new WindowBorder()); setTitle(title); add(avatar); pack(); avatar.reload(); avatar.setRoundCorners(Boolean.TRUE); setLocation(calculateLocation()); roundCorners(); setVisible(true); } |
ed.end(); ed = null; | public void end(final Platform platform) { assertStatusChange(ApplicationStatus.ENDING); if(isMainWindowOpen()) { closeMainWindow(); } setStatus(ApplicationStatus.ENDING); notifyEnd(); } |
|
ed = new EventDispatcher(this); ed.start(); | public void start(final Platform platform) { assertStatusChange(ApplicationStatus.STARTING); setStatus(ApplicationStatus.STARTING); assertStatusChange(ApplicationStatus.RUNNING); openMainWindow(); setStatus(ApplicationStatus.RUNNING); notifyStart(); } |
|
return ((ContainerProvider) contentProvider).readDocumentVersionsWithDelta( | return ((ContainerProvider) contentProvider).readDocumentVersionDeltas( | private Map<DocumentVersion, Delta> readDocumentVersionsWithDelta(final Long containerId, final Long versionId) { return ((ContainerProvider) contentProvider).readDocumentVersionsWithDelta( containerId, versionId); } |
public PopupDocument(final MainCellDocument document) { | public PopupDocument(final MainCellDocument document, final Connection connection) { | public PopupDocument(final MainCellDocument document) { super(); this.document = document; this.l18n = new PopupL18n("DocumentListItem"); } |
this.connection = connection; | public PopupDocument(final MainCellDocument document) { super(); this.document = document; this.l18n = new PopupL18n("DocumentListItem"); } |
|
if(document.isUrgent()) { final List<KeyRequest> keyRequests = document.getKeyRequests(); if(keyRequests.size() >= 1) { final Set<JabberId> requestedBySet = new HashSet<JabberId>(); for(final KeyRequest keyRequest : keyRequests) { if(!requestedBySet.contains(keyRequest.getRequestedBy())) { jPopupMenu.add(new AcceptKeyRequest(application, keyRequest.getId(), keyRequest.getRequestedByName())); requestedBySet.add(keyRequest.getRequestedBy()); } } jPopupMenu.addSeparator(); jPopupMenu.add(new DeclineAllKeyRequests(application)); } } jPopupMenu.add(new Open(application)); if(document.isClosed()) { jPopupMenu.addSeparator(); jPopupMenu.add(new Delete(application)); } else { jPopupMenu.add(new Send(application)); if(document.isKeyHolder()) { jPopupMenu.addSeparator(); jPopupMenu.add(new Close(application)); } else { jPopupMenu.add(new RequestKey(application)); jPopupMenu.addSeparator(); jPopupMenu.add(new Delete(application)); } } if(e.isShiftDown()) { final Clipboard systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); final ActionListener debugActionListener = new ActionListener() { public void actionPerformed(final ActionEvent e) { final StringSelection stringSelection = new StringSelection(((JComponent) e.getSource()).getClientProperty("COPY_ME").toString()); systemClipboard.setContents(stringSelection, null); } }; final JMenuItem idJMenuItem = new JMenuItem("Id - " + document.getId()); idJMenuItem.putClientProperty("COPY_ME", document.getId()); idJMenuItem.addActionListener(debugActionListener); final JMenuItem uidJMenuItem = new JMenuItem("Unique id - " + document.getUniqueId()); uidJMenuItem.putClientProperty("COPY_ME", document.getUniqueId()); uidJMenuItem.addActionListener(debugActionListener); jPopupMenu.addSeparator(); jPopupMenu.add(idJMenuItem); jPopupMenu.add(uidJMenuItem); } | if(Connection.ONLINE == connection) { triggerOnline(application, jPopupMenu, e); } else if(Connection.OFFLINE == connection) { triggerOffline(application, jPopupMenu, e); } else { Assert.assertUnreachable("[LBROWSER] [APPLICATION] [BROWSER] [AVATAR] [DOCUMENT POPUP] [TRIGGER] [UNKNOWN CONNECTION STATUS]"); } | public void trigger(final Browser application, final JPopupMenu jPopupMenu, final MouseEvent e) { if(document.isUrgent()) { final List<KeyRequest> keyRequests = document.getKeyRequests(); if(keyRequests.size() >= 1) { final Set<JabberId> requestedBySet = new HashSet<JabberId>(); for(final KeyRequest keyRequest : keyRequests) { // if a single user has requested more than once; we only // display one menu item. if(!requestedBySet.contains(keyRequest.getRequestedBy())) { jPopupMenu.add(new AcceptKeyRequest(application, keyRequest.getId(), keyRequest.getRequestedByName())); requestedBySet.add(keyRequest.getRequestedBy()); } } jPopupMenu.addSeparator(); jPopupMenu.add(new DeclineAllKeyRequests(application)); } } jPopupMenu.add(new Open(application)); if(document.isClosed()) { jPopupMenu.addSeparator(); jPopupMenu.add(new Delete(application)); } else { jPopupMenu.add(new Send(application)); if(document.isKeyHolder()) { jPopupMenu.addSeparator(); jPopupMenu.add(new Close(application)); } else { jPopupMenu.add(new RequestKey(application)); jPopupMenu.addSeparator(); jPopupMenu.add(new Delete(application)); } } // DEBUG Document Menu Options if(e.isShiftDown()) { final Clipboard systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); final ActionListener debugActionListener = new ActionListener() { public void actionPerformed(final ActionEvent e) { final StringSelection stringSelection = new StringSelection(((JComponent) e.getSource()).getClientProperty("COPY_ME").toString()); systemClipboard.setContents(stringSelection, null); } }; final JMenuItem idJMenuItem = new JMenuItem("Id - " + document.getId()); idJMenuItem.putClientProperty("COPY_ME", document.getId()); idJMenuItem.addActionListener(debugActionListener); final JMenuItem uidJMenuItem = new JMenuItem("Unique id - " + document.getUniqueId()); uidJMenuItem.putClientProperty("COPY_ME", document.getUniqueId()); uidJMenuItem.addActionListener(debugActionListener); jPopupMenu.addSeparator(); jPopupMenu.add(idJMenuItem); jPopupMenu.add(uidJMenuItem); } } |
if (!contains(localTeam, publishedBy)) { artifactModel.addTeamMember(containerId, publishedBy); } | void handlePublished(final UUID uniqueId, final Long versionId, final String name, final Integer artifactCount, final JabberId publishedBy, final List<JabberId> publishedTo, final Calendar publishedOn) { logApiId(); logVariable("uniqueId", uniqueId); logVariable("versionId", versionId); logVariable("name", name); logVariable("artifactCount", artifactCount); logVariable("publishedBy", publishedBy); logVariable("publishedTo", publishedTo); logVariable("publishedOn", publishedOn); final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(uniqueId); // add to local team final InternalUserModel userModel = getInternalUserModel(); final List<TeamMember> localTeam = artifactModel.readTeam2(containerId); final List<User> publishedToUsers = new ArrayList<User>(); for (final JabberId publishedToId : publishedTo) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId); } publishedToUsers.add(userModel.read(publishedToId)); } // create published to list containerIO.createPublishedTo(containerId, versionId, publishedToUsers); // fire event notifyContainerPublished(read(containerId), readDraft(containerId), readVersion(containerId, versionId), remoteEventGenerator); } |
|
application.runLogin(); } | application.displayAbout(); }}; | public void actionPerformed(final ActionEvent e) { application.runLogin(); } |
application.runLogout(); } | application.runRestoreBrowser(); }}; | public void actionPerformed(final ActionEvent e) { application.runLogout(); } |
application.runRestoreBrowser(); }})); | }}; | public void actionPerformed(final ActionEvent e) { application.runRestoreBrowser(); }})); |
application.displayAbout(); } | application.runExitPlatform(); }}; | public void actionPerformed(final ActionEvent e) { application.displayAbout(); } |
public void actionPerformed(ActionEvent e) { application.runExitPlatform(); } | public void actionPerformed(final ActionEvent e) { application.runLogin(); }}; | public void actionPerformed(ActionEvent e) { application.runExitPlatform(); } |
createDraft(OpheliaTestUser.JUNIT, container); | createDraft(OpheliaTestUser.JUNIT, container.getId()); | protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); final ContainerVersion version = containerModel.readLatestVersion(container.getId()); datum = new Fixture(container, containerModel, getOutputDirectory(), version); containerModel.addListener(datum); } |
publishToTeam(OpheliaTestUser.JUNIT, container); | publishToTeam(OpheliaTestUser.JUNIT, container.getId()); | protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); final ContainerVersion version = containerModel.readLatestVersion(container.getId()); datum = new Fixture(container, containerModel, getOutputDirectory(), version); containerModel.addListener(datum); } |
createDraft(OpheliaTestUser.JUNIT_X, container); | createDraft(OpheliaTestUser.JUNIT_X, container.getId()); | protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); final ContainerVersion version = containerModel.readLatestVersion(container.getId()); datum = new Fixture(container, containerModel, getOutputDirectory(), version); containerModel.addListener(datum); } |
publishToTeam(OpheliaTestUser.JUNIT_X, container); | publishToTeam(OpheliaTestUser.JUNIT_X, container.getId()); | protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); final ContainerVersion version = containerModel.readLatestVersion(container.getId()); datum = new Fixture(container, containerModel, getOutputDirectory(), version); containerModel.addListener(datum); } |
final JabberId artifactClosedBy) { try { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); iDModel.close(artifactUniqueId, artifactClosedBy); } catch(final ParityException px) { sLogger.fatal("Could not close artifact.", px); return; } | final JabberId artifactClosedBy) throws ParityException { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); iDModel.close(artifactUniqueId, artifactClosedBy); | static void notifyArtifactClosed(final UUID artifactUniqueId, final JabberId artifactClosedBy) { try { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); iDModel.close(artifactUniqueId, artifactClosedBy); } catch(final ParityException px) { sLogger.fatal("Could not close artifact.", px); return; } } |
static void notifyDocumentReceived(final XMPPDocument xmppDocument) { try { DocumentModel.getInternalModel(sContext).receive(xmppDocument); } catch(ParityException px) { sLogger.fatal("Could not receive document.", px); return; } | static void notifyDocumentReceived(final XMPPDocument xmppDocument) throws ParityException { DocumentModel.getInternalModel(sContext).receive(xmppDocument); | static void notifyDocumentReceived(final XMPPDocument xmppDocument) { try { DocumentModel.getInternalModel(sContext).receive(xmppDocument); } catch(ParityException px) { sLogger.fatal("Could not receive document.", px); return; } } |
final JabberId acceptedBy) { | final JabberId acceptedBy) throws SmackException, ParityException { | static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDModel.get(artifactUniqueId); iDModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); // audit receive key final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } iDModel.auditRecieveKey(document.getId(), loggedInUser.getId(), currentDateTime(), acceptedBy); } catch(final SmackException sx) { sLogger.fatal("Could not accept key request.", sx); return; } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } } |
try { final Document document = iDModel.get(artifactUniqueId); iDModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); | final Document document = iDModel.get(artifactUniqueId); iDModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); | static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDModel.get(artifactUniqueId); iDModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); // audit receive key final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } iDModel.auditRecieveKey(document.getId(), loggedInUser.getId(), currentDateTime(), acceptedBy); } catch(final SmackException sx) { sLogger.fatal("Could not accept key request.", sx); return; } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } } |
final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } iDModel.auditRecieveKey(document.getId(), loggedInUser.getId(), currentDateTime(), acceptedBy); | final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); | static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDModel.get(artifactUniqueId); iDModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); // audit receive key final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } iDModel.auditRecieveKey(document.getId(), loggedInUser.getId(), currentDateTime(), acceptedBy); } catch(final SmackException sx) { sLogger.fatal("Could not accept key request.", sx); return; } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } } |
catch(final SmackException sx) { sLogger.fatal("Could not accept key request.", sx); return; } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } | iDModel.auditRecieveKey(document.getId(), loggedInUser.getId(), currentDateTime(), acceptedBy); | static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDModel.get(artifactUniqueId); iDModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); // audit receive key final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } iDModel.auditRecieveKey(document.getId(), loggedInUser.getId(), currentDateTime(), acceptedBy); } catch(final SmackException sx) { sLogger.fatal("Could not accept key request.", sx); return; } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } } |
final JabberId deniedBy) { try { final Document document = DocumentModel.getInternalModel(sContext).get(artifactUniqueId); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.FALSE, deniedBy); } catch(final ParityException px) { sLogger.error("Could not accept key response denial.", px); return; } | final JabberId deniedBy) throws ParityException { final Document document = DocumentModel.getInternalModel(sContext).get(artifactUniqueId); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.FALSE, deniedBy); | static void notifyKeyRequestDenied(final UUID artifactUniqueId, final JabberId deniedBy) { try { final Document document = DocumentModel.getInternalModel(sContext).get(artifactUniqueId); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.FALSE, deniedBy); } catch(final ParityException px) { sLogger.error("Could not accept key response denial.", px); return; } } |
static void notifyKeyRequested(final UUID artifactUniqueId, final JabberId requestedBy) { try { final Document document = DocumentModel.getInternalModel(sContext).get(artifactUniqueId); SystemMessageModel.getInternalModel(sContext).createKeyRequest(document.getId(), requestedBy); | static void notifyKeyRequested(final UUID artifactUniqueId, final JabberId requestedBy) throws ParityException, SmackException { final Document document = DocumentModel.getInternalModel(sContext).get(artifactUniqueId); SystemMessageModel.getInternalModel(sContext).createKeyRequest(document.getId(), requestedBy); | static void notifyKeyRequested(final UUID artifactUniqueId, final JabberId requestedBy) { try { final Document document = DocumentModel.getInternalModel(sContext).get(artifactUniqueId); SystemMessageModel.getInternalModel(sContext).createKeyRequest(document.getId(), requestedBy); // audit key request final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } sAuditor.requestKey(document.getId(), loggedInUser.getId(), currentDateTime(), requestedBy, loggedInUser.getId()); } catch(final SmackException sx) { sLogger.fatal("Could not process key request: " + artifactUniqueId, sx); return; } catch(final ParityException px) { sLogger.error("Could not process key request: " + artifactUniqueId, px); return; } } |
final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } sAuditor.requestKey(document.getId(), loggedInUser.getId(), currentDateTime(), requestedBy, loggedInUser.getId()); } catch(final SmackException sx) { sLogger.fatal("Could not process key request: " + artifactUniqueId, sx); return; } catch(final ParityException px) { sLogger.error("Could not process key request: " + artifactUniqueId, px); return; } | final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } sAuditor.requestKey(document.getId(), loggedInUser.getId(), currentDateTime(), requestedBy, loggedInUser.getId()); | static void notifyKeyRequested(final UUID artifactUniqueId, final JabberId requestedBy) { try { final Document document = DocumentModel.getInternalModel(sContext).get(artifactUniqueId); SystemMessageModel.getInternalModel(sContext).createKeyRequest(document.getId(), requestedBy); // audit key request final User loggedInUser; synchronized(xmppHelperLock) { loggedInUser = xmppHelper.getUser(); } sAuditor.requestKey(document.getId(), loggedInUser.getId(), currentDateTime(), requestedBy, loggedInUser.getId()); } catch(final SmackException sx) { sLogger.fatal("Could not process key request: " + artifactUniqueId, sx); return; } catch(final ParityException px) { sLogger.error("Could not process key request: " + artifactUniqueId, px); return; } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.