bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
private void formMousePressed(final java.awt.event.MouseEvent evt, final Component component) { resizeOffsetX = evt.getPoint().x; resizeOffsetY = evt.getPoint().y; if ((resizeDirection == ResizeDirection.NONE) && (supportMouseMove)) { moveDragging = Boolean.TRUE; } else if (resizeDirection != ResizeDirection.NONE) { resizeDragging = Boolean.TRUE; } }
|
private void formMousePressed(final java.awt.event.MouseEvent evt, final Component component) { resizeOffsetX = evt.getPoint().x; resizeOffsetY = evt.getPoint().y; if ((resizeDirection == ResizeDirection.NONE) && (supportMouseMove)) { moveDragging = Boolean.TRUE; } else if (resizeDirection != ResizeDirection.NONE) { resizeDragging = Boolean.TRUE; } }
| 1,114,217
|
public ParityException() { super(); }
|
ParityException(final Throwable cause) { super(cause); fillInStackTrace(); }
| 1,114,218
|
BrowserMainListItemDocument(final BrowserMainAvatar list, final Document document) { super(list, ICON, getListItemText(document)); this.documentId = document.getId(); this.selectionTimer = new Timer(500, new ActionListener() { public void actionPerformed(final ActionEvent e) { getController().selectDocument(documentId); getController().displayDocumentHistoryListAvatar(); } }); this.selectionTimer.setRepeats(false); if(hasBeenSeen()) { setListItemFont(UIConstants.DefaultFont); } else { setListItemFont(UIConstants.DefaultFontBold); } if(isKeyHolder()) { final GridBagConstraints c = new GridBagConstraints(); final JLabel jLabel = LabelFactory.create(new ImageIcon( ResourceUtil.getURL("images/keyHolder.png"))); c.anchor = GridBagConstraints.EAST; c.insets.right = 18; add(jLabel, c.clone()); } }
|
BrowserMainListItemDocument(final BrowserMainAvatar list, final Document document) { super(list, ICON, document.getName()); this.documentId = document.getId(); this.selectionTimer = new Timer(500, new ActionListener() { public void actionPerformed(final ActionEvent e) { getController().selectDocument(documentId); getController().displayDocumentHistoryListAvatar(); } }); this.selectionTimer.setRepeats(false); if(hasBeenSeen()) { setListItemFont(UIConstants.DefaultFont); } else { setListItemFont(UIConstants.DefaultFontBold); } if(isKeyHolder()) { final GridBagConstraints c = new GridBagConstraints(); final JLabel jLabel = LabelFactory.create(new ImageIcon( ResourceUtil.getURL("images/keyHolder.png"))); c.anchor = GridBagConstraints.EAST; c.insets.right = 18; add(jLabel, c.clone()); } }
| 1,114,219
|
protected BrowserMainListItem(final BrowserMainAvatar list, final ImageIcon listItemIcon, final String listItemText) { this(list, listItemIcon, listItemText, null); }
|
protected BrowserMainListItem(final BrowserMainAvatar list, final ImageIcon listItemIcon, final String listItemText) { this(list, listItemIcon, listItemText, null); }
| 1,114,220
|
private static ReceiveKeyHistoryItem buildReceiveKeyHistoryItem( final Document document, final ReceiveKeyEvent receiveKeyEvent, final Map<JabberId, User> receiveKeyEventUsers) { final ReceiveKeyHistoryItem receiveKeyHistoryItem = new ReceiveKeyHistoryItem(); receiveKeyHistoryItem.setDate(receiveKeyEvent.getCreatedOn()); receiveKeyHistoryItem.setDocumentId(receiveKeyEvent.getArtifactId()); receiveKeyHistoryItem.setEvent(HistoryItemEvent.RECEIVE_KEY); receiveKeyHistoryItem.setName(document.getName()); receiveKeyHistoryItem.setReceivedFrom( receiveKeyEventUsers.get(receiveKeyEvent.getReceivedFrom())); receiveKeyHistoryItem.setVersionId(receiveKeyEvent.getArtifactVersionId()); return receiveKeyHistoryItem; }
|
private static ReceiveKeyHistoryItem buildReceiveKeyHistoryItem( final Document document, final ReceiveKeyEvent receiveKeyEvent, final Map<JabberId, User> receiveKeyEventUsers) { final ReceiveKeyHistoryItem receiveKeyHistoryItem = new ReceiveKeyHistoryItem(); receiveKeyHistoryItem.setDate(receiveKeyEvent.getCreatedOn()); receiveKeyHistoryItem.setDocumentId(receiveKeyEvent.getArtifactId()); receiveKeyHistoryItem.setEvent(HistoryItemEvent.RECEIVE_KEY); receiveKeyHistoryItem.setName(document.getName()); receiveKeyHistoryItem.setReceivedFrom( receiveKeyEventUsers.get(receiveKeyEvent.getReceivedFrom())); return receiveKeyHistoryItem; }
| 1,114,222
|
public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { final AbstractVersionCell cell = (AbstractVersionCell) value; textJLabel.setText(cell.getText()); final Icon icon = cell.getIcon(); if (null!=icon) { iconJLabel.setIcon(icon); } if (isSelected) { if (cell.isSelectedContainer()) { int x = 3; x++; } if (list.hasFocus()) { int y = 4; y++; } if (cell.isSelectedContainer() && list.hasFocus()) { textJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_FG); setBackground(Colors.Browser.List.INNER_LIST_SELECTION_BG); } else { textJLabel.setForeground(Colors.Browser.List.INNER_LEFT_LIST_SELECTION_NOFOCUS_FG); setBackground(Colors.Browser.List.INNER_LEFT_LIST_SELECTION_NOFOCUS_BG); } } else { textJLabel.setForeground(Colors.Browser.List.LIST_FG); if (0 == index % 2) { setBackground(Colors.Browser.List.LIST_EVEN_BG); } else { setBackground(Colors.Browser.List.LIST_ODD_BG); } } return this; }
|
public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { final AbstractVersionCell cell = (AbstractVersionCell) value; textJLabel.setText(cell.getText()); final Icon icon = cell.getIcon(); if (null!=icon) { iconJLabel.setIcon(icon); } if (isSelected) { if (cell.isSelectedContainer()) { int x = 3; x++; } if (list.hasFocus()) { int y = 4; y++; } if (cell.isSelectedContainer() && list.hasFocus()) { textJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_FG); setBackground(Colors.Browser.List.INNER_LIST_SELECTION_BG); } else { textJLabel.setForeground(Colors.Browser.List.INNER_LEFT_LIST_SELECTION_NOFOCUS_FG); setBackground(Colors.Browser.List.INNER_LEFT_LIST_SELECTION_NOFOCUS_BG); } } else { textJLabel.setForeground(Colors.Browser.List.LIST_FG); if (0 == index % 2) { setBackground(Colors.Browser.List.LIST_EVEN_BG); } else { setBackground(Colors.Browser.List.LIST_ODD_BG); } } return this; }
| 1,114,223
|
private void applyMnemonic(final JMenuItem jMenuItem, final Integer mnemonic) { logger.debug("JMenuItem.Mnemonic[" + mnemonic + "]"); jMenuItem.setMnemonic(mnemonic); }
|
private void applyMnemonic(final JMenuItem jMenuItem, final Integer mnemonic) { jMenuItem.setMnemonic(mnemonic); }
| 1,114,224
|
private JMenuItem doCreate(final String text) { logger.debug("JMenuItem[" + text + "]"); final JMenuItem jMenuItem = new JMenuItem(text); applyDefaultFont(jMenuItem); applyMinimumWidth(jMenuItem, 150); return jMenuItem; }
|
private JMenuItem doCreate(final String text) { final JMenuItem jMenuItem = new JMenuItem(text); applyDefaultFont(jMenuItem); applyMinimumWidth(jMenuItem, 150); return jMenuItem; }
| 1,114,225
|
private JCheckBoxMenuItem doCreateCheckBox(final String text, final Integer mnemonic) { logger.debug(text); final JCheckBoxMenuItem jCheckBoxMenuItem = new JCheckBoxMenuItem(text); applyDefaultFont(jCheckBoxMenuItem); applyMnemonic(jCheckBoxMenuItem, mnemonic); return jCheckBoxMenuItem; }
|
private JCheckBoxMenuItem doCreateCheckBox(final String text, final Integer mnemonic) { final JCheckBoxMenuItem jCheckBoxMenuItem = new JCheckBoxMenuItem(text); applyDefaultFont(jCheckBoxMenuItem); applyMnemonic(jCheckBoxMenuItem, mnemonic); return jCheckBoxMenuItem; }
| 1,114,226
|
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.documentModel = modelFactory.getDocumentModel(getClass()); this.sessionModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { final Long documentId = (Long) input; try { return documentModel.readHistory(documentId) .toArray(new HistoryItem[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { return sessionModel.getArtifactKeys().toArray(new Long[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainMessageProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.read(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.sendArtifactContactProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); } }; this.sendArtifactArtifactContactProvider = new FlatContentProvider() { final JabberId jabberId = JabberIdBuilder.parseUsername(preferences.getUsername()); public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactContactProvider, sendArtifactArtifactContactProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
|
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.documentModel = modelFactory.getDocumentModel(getClass()); this.sessionModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { final Long documentId = (Long) input; try { return documentModel.readHistory(documentId) .toArray(new HistoryItem[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { return sessionModel.getArtifactKeys().toArray(new Long[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainMessageProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.read(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.sendArtifactContactProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); } }; this.sendArtifactArtifactContactProvider = new FlatContentProvider() { final JabberId jabberId = JabberIdBuilder.parseUsername(preferences.getUsername()); public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactContactProvider, sendArtifactArtifactContactProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
| 1,114,227
|
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.documentModel = modelFactory.getDocumentModel(getClass()); this.sessionModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { final Long documentId = (Long) input; try { return documentModel.readHistory(documentId) .toArray(new HistoryItem[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { return sessionModel.getArtifactKeys().toArray(new Long[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainMessageProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.read(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.sendArtifactContactProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); } }; this.sendArtifactArtifactContactProvider = new FlatContentProvider() { final JabberId jabberId = JabberIdBuilder.parseUsername(preferences.getUsername()); public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactContactProvider, sendArtifactArtifactContactProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
|
private ProviderFactory() { super(); final ModelFactory modelFactory = ModelFactory.getInstance(); this.documentModel = modelFactory.getDocumentModel(getClass()); this.sessionModel = modelFactory.getSessionModel(getClass()); this.systemMessageModel = modelFactory.getSystemMessageModel(getClass()); this.historyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { final Long documentId = (Long) input; try { return documentModel.readHistory(documentId) .toArray(new HistoryItem[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { return sessionModel.getArtifactKeys().toArray(new Long[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainMessageProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.read(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.sendArtifactContactProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); } }; this.sendArtifactArtifactContactProvider = new FlatContentProvider() { final JabberId jabberId = JabberIdBuilder.parseUsername(preferences.getUsername()); public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactContactProvider, sendArtifactArtifactContactProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
| 1,114,228
|
public Object[] getElements(final Object input) { try { return sessionModel.getArtifactKeys().toArray(new Long[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.read(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,229
|
public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.read(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Object input) { try { final Collection<SystemMessage> messages = systemMessageModel.read(); return messages.toArray(new SystemMessage[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,230
|
public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); }
|
public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); }
| 1,114,231
|
public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); }
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); }
| 1,114,232
|
public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); }
|
public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); }
| 1,114,233
|
public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } return roster.toArray(new Contact[] {}); }
|
public Object[] getElements(final Object input) { List<Contact> roster; try { roster = sessionModel.readContacts(); // remove all team members from the roster list final Contact[] team = (Contact[]) input; if(null != team) { for(final Contact contact : team) roster.remove(contact); } } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,234
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,235
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,236
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,237
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return artifactContacts.toArray(new Contact[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; List<Contact> artifactContacts; try { artifactContacts = sessionModel.readArtifactContacts(artifactId); Contact contact; for(final Iterator<Contact> i = artifactContacts.iterator(); i.hasNext();) { contact= i.next(); if(contact.getId().equals(jabberId)) { i.remove(); } } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,238
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,239
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
|
public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } return versions.toArray(new DocumentVersion[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } }
| 1,114,240
|
private DocumentListener createDocumentListener() { return new DocumentAdapter() { public void confirmationReceived(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentConfirmationReceived(e.getDocument().getId()); } } public void documentCreated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentCreated(e.getDocument().getId(), Boolean.TRUE); } } public void documentClosed(final DocumentEvent e) { if(e.isRemote()) { browser.getArtifactModel().removeFlagSeen(e.getDocument().getId()); browser.fireDocumentUpdated(e.getDocument().getId()); } } public void documentUpdated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(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 documentCreated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentCreated(e.getDocument().getId(), Boolean.TRUE); } } public void documentClosed(final DocumentEvent e) { if(e.isRemote()) { browser.getArtifactModel().removeFlagSeen(e.getDocument().getId()); browser.fireDocumentUpdated(e.getDocument().getId(), Boolean.TRUE); } } public void documentUpdated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(e.getDocument().getId(), Boolean.TRUE); } } }; }
| 1,114,241
|
public void documentUpdated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(e.getDocument().getId()); } }
|
public void documentUpdated(final DocumentEvent e) { if(e.isRemote()) { browser.fireDocumentUpdated(e.getDocument().getId(), Boolean.TRUE); } }
| 1,114,242
|
Collection<Project> list() throws ParityException { logger.info("list()"); try { return projectXmlIO.list(); } catch(IOException iox) { logger.error("list()", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("list()", rx); throw ParityErrorTranslator.translate(rx); } }
|
Collection<Project> list() throws ParityException { logger.info("list()"); try { return projectXmlIO.list(); } catch(IOException iox) { logger.error("list()", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("list()", rx); throw ParityErrorTranslator.translate(rx); } }
| 1,114,243
|
public void run() { try { final HeaderReader headerReader = new HeaderReader(); final StreamHeader sessionId = headerReader.readNext(); if (null != sessionId) { final StreamSession streamSession = streamServer.authenticate(sessionId.getValue(), ((InetSocketAddress) socket.getRemoteSocketAddress()).getAddress()); final StreamHeader sessionType = headerReader.readNext(); final StreamHeader streamId = headerReader.readNext(); final StreamHeader streamOffset = headerReader.readNext(); if(null != streamSession) { if ("UPSTREAM".equals(sessionType.getValue())) { final StreamHeader streamSize = headerReader.readNext(); new UpstreamHandler(streamServer, streamSession, streamId.getValue(), Long.valueOf(streamSize.getValue()), Long.valueOf(streamOffset.getValue()), socket.getInputStream()).run(); } else if ("DOWNSTREAM".equals(sessionType.getValue())) { new DownstreamHandler(streamServer, streamSession, streamId.getValue(), streamServer.getSize(streamSession, streamId.getValue()), Long.valueOf(streamOffset.getValue()), socket.getOutputStream()).run(); } else { Assert.assertUnreachable("Unkown stream transfer."); } } } } catch (final IOException iox) { throw new StreamException(iox); } finally { try { socket.close(); } catch (final IOException iox2) { logger.logError(iox2, "Could not close client socket."); } } }
|
public void run() { try { final HeaderReader headerReader = new HeaderReader(); final StreamHeader sessionId = headerReader.readNext(); if (null != sessionId) { final StreamSession streamSession = streamServer.authenticate(sessionId.getValue(), ((InetSocketAddress) socket.getRemoteSocketAddress()).getAddress()); final StreamHeader sessionType = headerReader.readNext(); final StreamHeader streamId = headerReader.readNext(); final StreamHeader streamOffset = headerReader.readNext(); if(null != streamSession) { if ("UPSTREAM".equals(sessionType.getValue())) { final StreamHeader streamSize = headerReader.readNext(); new UpstreamHandler(streamServer, streamSession, streamId.getValue(), Long.valueOf(streamSize.getValue()), socket.getInputStream()).run(); } else if ("DOWNSTREAM".equals(sessionType.getValue())) { new DownstreamHandler(streamServer, streamSession, streamId.getValue(), streamServer.getSize(streamSession, streamId.getValue()), socket.getOutputStream()).run(); } else { Assert.assertUnreachable("Unkown stream transfer."); } } } } catch (final IOException iox) { throw new StreamException(iox); } finally { try { socket.close(); } catch (final IOException iox2) { logger.logError(iox2, "Could not close client socket."); } } }
| 1,114,244
|
Preferences getPreferences() { final Properties javaProperties = loadPreferences(); // save the preferences on shutdown Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { storePreferences(javaProperties); } }); return new Preferences() { public Locale getLocale() { return Locale.getDefault(); } public String getServerHost() { final String override = System.getProperty("parity.serverhost"); if(null != override && 0 < override.length()) { return override; } else { return "thinkparity.dyndns.org"; } } public Integer getServerPort() { final Integer override = Integer.getInteger("parity.serverport"); if(null != override) { return override; } else { if(Boolean.getBoolean("parity.insecure")) { return 5222; } else { return 5223; } } } public String getSystemUsername() { return "system"; } public String getUsername() { return javaProperties.getProperty("parity.username", null); } public Boolean isSetLocale() { return Boolean.TRUE; } public Boolean isSetUsername() { final String username = getUsername(); return (null != username && 0 < username.length()); } public void setLocale(Locale locale) { // TODO Auto-generated method stub } public void setUsername(final String username) { javaProperties.setProperty("parity.username", username); } }; }
|
Preferences getPreferences() { final Properties javaProperties = loadPreferences(); // save the preferences on shutdown Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { storePreferences(javaProperties); } }); return new Preferences() { public Locale getLocale() { return Locale.getDefault(); } public String getServerHost() { final String override = System.getProperty("parity.serverhost"); if(null != override && 0 < override.length()) { return override; } else { return "thinkparity.dyndns.org"; } } public Integer getServerPort() { final Integer override = Integer.getInteger("parity.serverport"); if(null != override) { return override; } else { if(Boolean.getBoolean("parity.insecure")) { return 5222; } else { return 5223; } } } public String getSystemUsername() { return new StringBuffer("system@") .append(getServerHost()).toString(); } public String getUsername() { return javaProperties.getProperty("parity.username", null); } public Boolean isSetLocale() { return Boolean.TRUE; } public Boolean isSetUsername() { final String username = getUsername(); return (null != username && 0 < username.length()); } public void setLocale(Locale locale) { // TODO Auto-generated method stub } public void setUsername(final String username) { javaProperties.setProperty("parity.username", username); } }; }
| 1,114,245
|
public String getSystemUsername() { return "system"; }
|
public String getSystemUsername() { return new StringBuffer("system@") .append(getServerHost()).toString(); }
| 1,114,246
|
public void firstRun() { loginAvatar = new LoginAvatar(this); openWindow(loginAvatar); final String username = loginAvatar.getUsername(); final String password = loginAvatar.getPassword(); if(null != username && null != password) { final Credentials credentials = new Credentials(); credentials.setPassword(password); credentials.setUsername(username); workspaceModel.initialize(workspace, new LoginMonitor() { public Boolean confirmSynchronize() { final ConfirmSynchronize confirmSynchronize = new ConfirmSynchronize(); openWindow(confirmSynchronize); return confirmSynchronize.didConfirm(); } public void notifyInvalidCredentials(final Credentials credentials) { } }, credentials); } }
|
public void firstRun() { loginAvatar = new LoginAvatar(this); openWindow(loginAvatar); final String username = loginAvatar.getUsername(); final String password = loginAvatar.getPassword(); if(null != username && null != password) { final Credentials credentials = new Credentials(); credentials.setPassword(password); credentials.setUsername(username); workspaceModel.initialize(workspace, new LoginMonitor() { public Boolean confirmSynchronize() { final ConfirmSynchronize confirmSynchronize = new ConfirmSynchronize(); openWindow(confirmSynchronize); return confirmSynchronize.didConfirm(); } public void notifyInvalidCredentials(final Credentials credentials) { } }, credentials); } }
| 1,114,247
|
public void firstRun() { loginAvatar = new LoginAvatar(this); openWindow(loginAvatar); final String username = loginAvatar.getUsername(); final String password = loginAvatar.getPassword(); if(null != username && null != password) { final Credentials credentials = new Credentials(); credentials.setPassword(password); credentials.setUsername(username); workspaceModel.initialize(workspace, new LoginMonitor() { public Boolean confirmSynchronize() { final ConfirmSynchronize confirmSynchronize = new ConfirmSynchronize(); openWindow(confirmSynchronize); return confirmSynchronize.didConfirm(); } public void notifyInvalidCredentials(final Credentials credentials) { } }, credentials); } }
|
public void firstRun() { loginAvatar = new LoginAvatar(this); openWindow(loginAvatar); final String username = loginAvatar.getUsername(); final String password = loginAvatar.getPassword(); if(null != username && null != password) { final Credentials credentials = new Credentials(); credentials.setPassword(password); credentials.setUsername(username); workspaceModel.initialize(workspace, new LoginMonitor() { public Boolean confirmSynchronize() { final ConfirmSynchronize confirmSynchronize = new ConfirmSynchronize(); openWindow(confirmSynchronize); return confirmSynchronize.didConfirm(); } public void notifyInvalidCredentials(final Credentials credentials) { } }, credentials); } }
| 1,114,248
|
public void firstRun() { loginAvatar = new LoginAvatar(this); openWindow(loginAvatar); final String username = loginAvatar.getUsername(); final String password = loginAvatar.getPassword(); if(null != username && null != password) { final Credentials credentials = new Credentials(); credentials.setPassword(password); credentials.setUsername(username); workspaceModel.initialize(workspace, new LoginMonitor() { public Boolean confirmSynchronize() { final ConfirmSynchronize confirmSynchronize = new ConfirmSynchronize(); openWindow(confirmSynchronize); return confirmSynchronize.didConfirm(); } public void notifyInvalidCredentials(final Credentials credentials) { } }, credentials); } }
|
public void firstRun() { loginAvatar = new LoginAvatar(this); openWindow(loginAvatar); final String username = loginAvatar.getUsername(); final String password = loginAvatar.getPassword(); if(null != username && null != password) { final Credentials credentials = new Credentials(); credentials.setPassword(password); credentials.setUsername(username); workspaceModel.initialize(workspace, new LoginMonitor() { public Boolean confirmSynchronize() { final ConfirmSynchronize confirmSynchronize = new ConfirmSynchronize(); openWindow(confirmSynchronize); return confirmSynchronize.didConfirm(); } public void notifyInvalidCredentials(final Credentials credentials) { } }, credentials); } }
| 1,114,249
|
public ErrorAvatar() { super("ErrorDialog", BrowserConstants.DIALOGUE_BACKGROUND); bindEscapeKey("Cancel", new AbstractAction() { /** @see java.io.Serializable */ private static final long serialVersionUID = 1; /** * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(final ActionEvent e) { disposeWindow(); } }); initComponents(); }
|
public ErrorAvatar() { super("ErrorDialog", BrowserConstants.DIALOGUE_BACKGROUND); bindEscapeKey("Cancel", new AbstractAction() { /** @see java.io.Serializable */ /** * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(final ActionEvent e) { disposeWindow(); } }); initComponents(); }
| 1,114,250
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,251
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,252
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,253
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,254
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .add(copyDetailsJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 220, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,255
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,256
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,257
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(closeJButton))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(closeJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
|
private void initComponents() { javax.swing.JButton closeJButton; javax.swing.JScrollPane errorJScrollPane; closeJButton = new javax.swing.JButton(); errorMessageJLabel = new javax.swing.JLabel(); errorJScrollPane = new javax.swing.JScrollPane(); errorJTextArea = new javax.swing.JTextArea(); closeJButton.setText(java.util.ResourceBundle.getBundle("com/thinkparity/browser/platform/util/l10n/JPanel_Messages").getString("ErrorDialog.Ok")); closeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); } }); errorJTextArea.setColumns(20); errorJTextArea.setRows(5); errorJScrollPane.setViewportView(errorJTextArea); 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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .addContainerGap(303, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(closeJButton) .add(copyDetailsJButton)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(errorMessageJLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(errorJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(closeJButton) .add(copyDetailsJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
| 1,114,258
|
public void actionPerformed(java.awt.event.ActionEvent e) { closeJButtonActionPerformed(e); }
|
public void actionPerformed(java.awt.event.ActionEvent e) { copyDetailsJButtonActionPerformed(e); }
| 1,114,259
|
private void reloadError() { errorJTextArea.setText(""); final String error = readInputError(); if(null != error) { errorJTextArea.setText(error); } }
|
private void reloadError() { errorJTextArea.setText(""); final String error = readInputError(); if (null != error) { errorJScrollPane.setVisible(true); copyDetailsJButton.setVisible(true); errorJTextArea.setText(error); errorJTextArea.setCaretPosition(0); } else { errorJScrollPane.setVisible(false); copyDetailsJButton.setVisible(false); } }
| 1,114,260
|
DocumentModelImpl(final Workspace workspace) { super(workspace, L18nContext.DOCUMENT); final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); this.auditor = new DocumentModelAuditor(getContext()); this.defaultComparator = comparatorBuilder.createByName(Boolean.TRUE); this.defaultHistoryComparator = new ComparatorBuilder().createIdDescending(); this.defaultHistoryFilter = new DefaultFilter(); this.defaultVersionComparator = comparatorBuilder.createVersionById(Boolean.TRUE); this.documentIO = IOFactory.getDefault().createDocumentHandler(); this.indexor = new DocumentIndexor(getContext()); this.localEventGen = new DocumentModelEventGenerator(DocumentEvent.Source.LOCAL); this.remoteEventGen = new DocumentModelEventGenerator(DocumentEvent.Source.REMOTE); }
|
DocumentModelImpl(final Workspace workspace) { super(workspace); final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); this.auditor = new DocumentModelAuditor(getContext()); this.defaultComparator = comparatorBuilder.createByName(Boolean.TRUE); this.defaultHistoryComparator = new ComparatorBuilder().createIdDescending(); this.defaultHistoryFilter = new DefaultFilter(); this.defaultVersionComparator = comparatorBuilder.createVersionById(Boolean.TRUE); this.documentIO = IOFactory.getDefault().createDocumentHandler(); this.indexor = new DocumentIndexor(getContext()); this.localEventGen = new DocumentModelEventGenerator(DocumentEvent.Source.LOCAL); this.remoteEventGen = new DocumentModelEventGenerator(DocumentEvent.Source.REMOTE); }
| 1,114,261
|
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]); modifyDocument(OpheliaTestUser.JUNIT, document); datum = new Fixture(container, containerModel, document); datum.containerModel.addListener(datum); }
|
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]); modifyDocument(OpheliaTestUser.JUNIT, document.getId()); datum = new Fixture(container, containerModel, document); datum.containerModel.addListener(datum); }
| 1,114,262
|
private void processOfflineQueue() { assertIsReachable(environment); XMPPSession session = null; try { session = new XMPPSessionImpl(); session.login(environment, credentials); final JabberId userId = JabberIdBuilder.build( credentials.getUsername(), Constants.Jabber.DOMAIN, credentials.getResource()); session.processEventQueue(userId); } finally { Assert.assertNotNull(session, "User {0}'s session is null.", credentials.getUsername()); Assert.assertTrue(session.isLoggedIn(), "User {0} not logged in.", credentials.getUsername()); session.logout(); } }
|
private void processOfflineQueue() { assertIsReachable(environment); XMPPSession session = null; try { session = new XMPPSessionImpl(); session.login(environment, credentials); final JabberId userId = JabberIdBuilder.build( credentials.getUsername(), Constants.Jabber.DOMAIN, credentials.getResource()); session.processEventQueue(userId); } finally { Assert.assertNotNull(session, "User {0}'s session is null.", credentials.getUsername()); Assert.assertTrue(session.isLoggedIn(), "User {0} not logged in.", credentials.getUsername()); session.logout(); } }
| 1,114,263
|
private Fixture(final Document d, final DocumentModel dModel, final Integer hitsExpectedSize, final IndexModel iModel) { this.d = d; this.dModel = dModel; this.hitsExpectedSize = hitsExpectedSize; this.iModel = iModel; }
|
private Fixture(final Document d, final DocumentModel dModel, final Integer hitsExpectedSize, final IndexModel iModel) { this.d = d; this.dModel = dModel; this.hitsExpectedSize = hitsExpectedSize; this.iModel = iModel; }
| 1,114,264
|
private Fixture(final Document d, final DocumentModel dModel, final Integer hitsExpectedSize, final IndexModel iModel) { this.d = d; this.dModel = dModel; this.hitsExpectedSize = hitsExpectedSize; this.iModel = iModel; }
|
private Fixture(final Document d, final DocumentModel dModel, final Integer hitsExpectedSize, final IndexModel iModel) { this.d = d; this.dModel = dModel; this.iModel = iModel; }
| 1,114,265
|
protected void setUp() throws Exception { super.setUp(); final DocumentModel dModel = getDocumentModel(); final IndexModel iModel = getIndexModel(); data = new LinkedList<Fixture>(); Document d; for(final File inputFile : getInputFiles()) { d = dModel.create(inputFile.getName(), inputFile.getName(), inputFile); data.add(new Fixture(d, dModel, 1, iModel)); } }
|
protected void setUp() throws Exception { super.setUp(); final DocumentModel dModel = getDocumentModel(); final IndexModel iModel = getIndexModel(); data = new LinkedList<Fixture>(); for(final File inputFile : getInputFiles()) { d = dModel.create(inputFile.getName(), inputFile.getName(), inputFile); data.add(new Fixture(d, dModel, 1, iModel)); } }
| 1,114,266
|
protected void setUp() throws Exception { super.setUp(); final DocumentModel dModel = getDocumentModel(); final IndexModel iModel = getIndexModel(); data = new LinkedList<Fixture>(); Document d; for(final File inputFile : getInputFiles()) { d = dModel.create(inputFile.getName(), inputFile.getName(), inputFile); data.add(new Fixture(d, dModel, 1, iModel)); } }
|
protected void setUp() throws Exception { super.setUp(); final DocumentModel dModel = getDocumentModel(); final IndexModel iModel = getIndexModel(); data = new LinkedList<Fixture>(); Document d; for(final File inputFile : getInputFiles()) { d = dModel.create(inputFile.getName(), inputFile.getName(), inputFile); data.add(new Fixture(d, dModel, 1, iModel)); } }
| 1,114,267
|
public void testSearch() { try { List<IndexHit> indexHits; for(final Fixture datum : data) { indexHits = datum.iModel.search(datum.d.getName()); assertNotNull("Index hits is null.", indexHits); Document searchHit; for(final IndexHit indexHit : indexHits) { searchHit = datum.dModel.get(indexHit.getId()); assertEquals(searchHit.getName(), datum.d.getName()); } } } catch(final Throwable t) { fail(createFailMessage(t)); } }
|
public void testSearch() { try { List<IndexHit> indexHits; for(final Fixture datum : data) { indexHits = datum.iModel.search(datum.criteria); assertNotNull("Index hits is null.", indexHits); Document searchHit; for(final IndexHit indexHit : indexHits) { searchHit = datum.dModel.get(indexHit.getId()); assertEquals(searchHit.getName(), datum.d.getName()); } } } catch(final Throwable t) { fail(createFailMessage(t)); } }
| 1,114,268
|
public void testSearch() { try { List<IndexHit> indexHits; for(final Fixture datum : data) { indexHits = datum.iModel.search(datum.d.getName()); assertNotNull("Index hits is null.", indexHits); Document searchHit; for(final IndexHit indexHit : indexHits) { searchHit = datum.dModel.get(indexHit.getId()); assertEquals(searchHit.getName(), datum.d.getName()); } } } catch(final Throwable t) { fail(createFailMessage(t)); } }
|
public void testSearch() { try { List<IndexHit> indexHits; for(final Fixture datum : data) { indexHits = datum.iModel.search(datum.d.getName()); assertNotNull("Index hits is null.", indexHits); Document searchHit; for(final IndexHit indexHit : indexHits) { searchHit = datum.dModel.get(indexHit.getId()); assertTrue(searchHit.getName().contains(datum.criteria)); } } } catch(final Throwable t) { fail(createFailMessage(t)); } }
| 1,114,269
|
void setValueFactory(ValueFactory valueFactory) { this.valueFactory = valueFactory; }
|
public void setValueFactory(ValueFactory valueFactory) { this.valueFactory = valueFactory; }
| 1,114,270
|
public static synchronized ServletToolboxManager getInstance(ServletContext servletContext, String toolboxFile) { // little fix up if (!toolboxFile.startsWith("/")) { toolboxFile = "/" + toolboxFile; } // get config file pathname String pathname = servletContext.getRealPath(toolboxFile); // check if a previous instance exists ServletToolboxManager toolboxManager = (ServletToolboxManager)managersMap.get(pathname); if (toolboxManager == null) { // if not, build one InputStream is = null; try { // get the bits is = servletContext.getResourceAsStream(toolboxFile); if (is != null) { LOG.info("Using config file '" + toolboxFile +"'"); toolboxManager = new ServletToolboxManager(servletContext); toolboxManager.load(is); // remember it managersMap.put(pathname, toolboxManager); LOG.info("Toolbox setup complete."); } } catch(Exception e) { LOG.error("Problem loading toolbox '" + toolboxFile +"' : " + e); // if this happens, it probably deserves // to have the stack trace logged StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); LOG.error(sw.toString()); } finally { try { if (is != null) { is.close(); } } catch(Exception ee) {} } } return toolboxManager; }
|
public static synchronized ServletToolboxManager getInstance(ServletContext servletContext, String toolboxFile) { // little fix up if (!toolboxFile.startsWith("/")) { toolboxFile = "/" + toolboxFile; } // get config file pathname String uniqueKey = servletContext.hashCode() + ':' + toolboxFile; // check if a previous instance exists ServletToolboxManager toolboxManager = (ServletToolboxManager)managersMap.get(pathname); if (toolboxManager == null) { // if not, build one InputStream is = null; try { // get the bits is = servletContext.getResourceAsStream(toolboxFile); if (is != null) { LOG.info("Using config file '" + toolboxFile +"'"); toolboxManager = new ServletToolboxManager(servletContext); toolboxManager.load(is); // remember it managersMap.put(pathname, toolboxManager); LOG.info("Toolbox setup complete."); } } catch(Exception e) { LOG.error("Problem loading toolbox '" + toolboxFile +"' : " + e); // if this happens, it probably deserves // to have the stack trace logged StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); LOG.error(sw.toString()); } finally { try { if (is != null) { is.close(); } } catch(Exception ee) {} } } return toolboxManager; }
| 1,114,271
|
public static synchronized ServletToolboxManager getInstance(ServletContext servletContext, String toolboxFile) { // little fix up if (!toolboxFile.startsWith("/")) { toolboxFile = "/" + toolboxFile; } // get config file pathname String pathname = servletContext.getRealPath(toolboxFile); // check if a previous instance exists ServletToolboxManager toolboxManager = (ServletToolboxManager)managersMap.get(pathname); if (toolboxManager == null) { // if not, build one InputStream is = null; try { // get the bits is = servletContext.getResourceAsStream(toolboxFile); if (is != null) { LOG.info("Using config file '" + toolboxFile +"'"); toolboxManager = new ServletToolboxManager(servletContext); toolboxManager.load(is); // remember it managersMap.put(pathname, toolboxManager); LOG.info("Toolbox setup complete."); } } catch(Exception e) { LOG.error("Problem loading toolbox '" + toolboxFile +"' : " + e); // if this happens, it probably deserves // to have the stack trace logged StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); LOG.error(sw.toString()); } finally { try { if (is != null) { is.close(); } } catch(Exception ee) {} } } return toolboxManager; }
|
public static synchronized ServletToolboxManager getInstance(ServletContext servletContext, String toolboxFile) { // little fix up if (!toolboxFile.startsWith("/")) { toolboxFile = "/" + toolboxFile; } // get config file pathname String pathname = servletContext.getRealPath(toolboxFile); // check if a previous instance exists ServletToolboxManager toolboxManager = (ServletToolboxManager)managersMap.get(uniqueKey); if (toolboxManager == null) { // if not, build one InputStream is = null; try { // get the bits is = servletContext.getResourceAsStream(toolboxFile); if (is != null) { LOG.info("Using config file '" + toolboxFile +"'"); toolboxManager = new ServletToolboxManager(servletContext); toolboxManager.load(is); // remember it managersMap.put(pathname, toolboxManager); LOG.info("Toolbox setup complete."); } } catch(Exception e) { LOG.error("Problem loading toolbox '" + toolboxFile +"' : " + e); // if this happens, it probably deserves // to have the stack trace logged StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); LOG.error(sw.toString()); } finally { try { if (is != null) { is.close(); } } catch(Exception ee) {} } } return toolboxManager; }
| 1,114,272
|
public static synchronized ServletToolboxManager getInstance(ServletContext servletContext, String toolboxFile) { // little fix up if (!toolboxFile.startsWith("/")) { toolboxFile = "/" + toolboxFile; } // get config file pathname String pathname = servletContext.getRealPath(toolboxFile); // check if a previous instance exists ServletToolboxManager toolboxManager = (ServletToolboxManager)managersMap.get(pathname); if (toolboxManager == null) { // if not, build one InputStream is = null; try { // get the bits is = servletContext.getResourceAsStream(toolboxFile); if (is != null) { LOG.info("Using config file '" + toolboxFile +"'"); toolboxManager = new ServletToolboxManager(servletContext); toolboxManager.load(is); // remember it managersMap.put(pathname, toolboxManager); LOG.info("Toolbox setup complete."); } } catch(Exception e) { LOG.error("Problem loading toolbox '" + toolboxFile +"' : " + e); // if this happens, it probably deserves // to have the stack trace logged StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); LOG.error(sw.toString()); } finally { try { if (is != null) { is.close(); } } catch(Exception ee) {} } } return toolboxManager; }
|
public static synchronized ServletToolboxManager getInstance(ServletContext servletContext, String toolboxFile) { // little fix up if (!toolboxFile.startsWith("/")) { toolboxFile = "/" + toolboxFile; } // get config file pathname String pathname = servletContext.getRealPath(toolboxFile); // check if a previous instance exists ServletToolboxManager toolboxManager = (ServletToolboxManager)managersMap.get(pathname); if (toolboxManager == null) { // if not, build one InputStream is = null; try { // get the bits is = servletContext.getResourceAsStream(toolboxFile); if (is != null) { LOG.info("Using config file '" + toolboxFile +"'"); toolboxManager = new ServletToolboxManager(servletContext); toolboxManager.load(is); // remember it managersMap.put(uniqueKey, toolboxManager); LOG.info("Toolbox setup complete."); } } catch(Exception e) { LOG.error("Problem loading toolbox '" + toolboxFile +"' : " + e); // if this happens, it probably deserves // to have the stack trace logged StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); LOG.error(sw.toString()); } finally { try { if (is != null) { is.close(); } } catch(Exception ee) {} } } return toolboxManager; }
| 1,114,273
|
public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { final MainCell cell = (MainCell) value; remove(paddingJLabel); final GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, Math.round(PADDING_INSET_LEFT * cell.getTextInsetFactor()), 0, 0); add(paddingJLabel, gridBagConstraints); if(isSelected) { background = cell.getBackgroundSelected(); nodeIconJLabel.setIcon(cell.getNodeIconSelected()); } else { background = cell.getBackground(); nodeIconJLabel.setIcon(cell.getNodeIcon()); } setBorder(cell.getBorder()); textJLabel.setFont(cell.getTextFont()); textJLabel.setForeground(cell.getTextForeground()); textJLabel.setText(cell.getText()); setToolTipText(cell.getToolTip()); infoIconJLabel.setIcon(cell.getInfoIcon()); revalidate(); repaint(); return this; }
|
public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { final MainCell cell = (MainCell) value; remove(paddingJLabel); final GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, Math.round(PADDING_INSET_LEFT * cell.getTextInsetFactor()), 0, 0); add(paddingJLabel, gridBagConstraints); if(isSelected) { background = cell.getBackgroundSelected(); nodeIconJLabel.setIcon(cell.getNodeIconSelected()); } else { background = cell.getBackground(); nodeIconJLabel.setIcon(cell.getNodeIcon()); } textJLabel.setFont(cell.getTextFont()); textJLabel.setForeground(cell.getTextForeground()); textJLabel.setText(cell.getText()); setToolTipText(cell.getToolTip()); infoIconJLabel.setIcon(cell.getInfoIcon()); revalidate(); repaint(); return this; }
| 1,114,274
|
private void doToggleExpansion(final TabPanel tabPanel) { final ContainerPanel containerPanel = (ContainerPanel) tabPanel; final Boolean expanded; if (isExpanded(containerPanel)) { expanded = Boolean.FALSE; } else { // NOTE-BEGIN:multi-expand to allow multiple selection in the list; remove here for (final TabPanel visiblePanel : visiblePanels) { if (isExpanded(visiblePanel)) { doToggleExpansion(visiblePanel); } } // NOTE-END:multi-expand expanded = Boolean.TRUE; browser.runApplyContainerFlagSeen( containerPanel.getContainer().getId()); } containerPanel.setExpanded(expanded); expandedState.put(tabPanel, expanded); }
|
private void doToggleExpansion(final TabPanel tabPanel) { final ContainerPanel containerPanel = (ContainerPanel) tabPanel; final Boolean expanded; if (isExpanded(containerPanel)) { expanded = Boolean.FALSE; } else { // NOTE-BEGIN:multi-expand to allow multiple selection in the list; remove here for (final TabPanel visiblePanel : visiblePanels) { if (isExpanded(visiblePanel)) { doToggleExpansion(visiblePanel); } } // NOTE-END:multi-expand expanded = Boolean.TRUE; browser.runApplyContainerFlagSeen( containerPanel.getContainer().getId()); } expandedState.put(tabPanel, expanded); }
| 1,114,275
|
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) { logWarning("No archive exists for user {0}.", 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); } }
|
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) { logWarning("No archive exists for user {0}.", 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); } }
| 1,114,276
|
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) { logWarning("No archive exists for user {0}.", 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); } }
|
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) { logWarning("No archive exists for user {0}, streamId, streamSession, stream, streamSize);.", userId); }, streamId, streamSession, stream, streamSize); 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); }, streamId, streamSession, stream, streamSize); finally { try { stream.close(); }, streamId, streamSession, stream, streamSize); finally { writer.close(); }, streamId, streamSession, stream, streamSize); }, streamId, streamSession, stream, streamSize); }, streamId, streamSession, stream, streamSize); }, streamId, streamSession, stream, streamSize); catch (final Throwable t) { throw translateError(t); }, streamId, streamSession, stream, streamSize); }, streamId, streamSession, stream, streamSize);
| 1,114,277
|
public Float getTextInsetFactor() { return InsetFactors.LEVEL_2; }
|
public Float getTextInsetFactor() { return InsetFactors.LEVEL_3; }
| 1,114,278
|
private Fixture(final String description, final File file, final String documentContentChecksum, final DocumentModel documentModel, final String name) { this.description = description; this.file = file; this.documentContentChecksum = documentContentChecksum; this.documentModel = documentModel; this.name = name; }
|
private Fixture(final String description, final File file, final String documentContentChecksum, final DocumentModel documentModel, final String name) { this.description = description; this.file = file; this.documentContentChecksum = documentContentChecksum; this.documentModel = documentModel; this.name = name; }
| 1,114,280
|
protected void setUp() throws Exception { super.setUp(); final DocumentModel documentModel = getDocumentModel(); data = new Vector<Fixture>(4); String name, description; String documentContentChecksum; for(File testFile : getInputFiles()) { name = testFile.getName(); description = name; documentContentChecksum = MD5Util.md5Hex(FileUtil.readBytes(testFile)); data.add(new Fixture(description, testFile, documentContentChecksum, documentModel, name)); } }
|
protected void setUp() throws Exception { super.setUp(); final DocumentModel documentModel = getDocumentModel(); data = new Vector<Fixture>(4); String name, description; String documentContentChecksum; for(File testFile : getInputFiles()) { name = testFile.getName(); description = name; documentContentChecksum = MD5Util.md5Hex(FileUtil.readBytes(testFile)); data.add(new Fixture(description, testFile, documentContentChecksum, documentModel, 0, name)); } }
| 1,114,282
|
public void testCreate() { try { Document document; DocumentContent content; DocumentVersion version; DocumentVersionContent versionContent; DocumentContent versionContentSnapshot; for(Fixture datum : data) { document = datum.documentModel.create(datum.name, datum.description, datum.file); assertNotNull(document); content = datum.documentModel.getContent(document.getId()); assertNotNull(content); assertEquals(content.getChecksum(), datum.documentContentChecksum); version = datum.documentModel.listVersions(document.getId()).iterator().next(); assertNotNull(version); assertEquals(version.getArtifactId(), document.getId()); assertEquals(version.getArtifactUniqueId(), document.getUniqueId()); versionContent = datum.documentModel.getVersionContent(document.getId(), version.getVersionId()); versionContentSnapshot = versionContent.getDocumentContent(); assertNotNull(versionContent); assertEquals(versionContentSnapshot, content); } } catch(final Throwable t) { fail(createFailMessage(t)); } }
|
public void testCreate() { try { Document document; DocumentContent content; DocumentVersion version; DocumentVersionContent versionContent; DocumentContent versionContentSnapshot; for(Fixture datum : data) { document = datum.documentModel.create(datum.name, datum.description, datum.file); assertNotNull(document); content = datum.documentModel.getContent(document.getId()); assertNotNull(content); assertEquals(content.getChecksum(), datum.documentContentChecksum); version = datum.documentModel.listVersions(document.getId()).iterator().next(); assertNotNull(version); assertEquals(version.getArtifactId(), document.getId()); assertEquals(version.getArtifactUniqueId(), document.getUniqueId()); versionContent = datum.documentModel.getVersionContent(document.getId(), version.getVersionId()); versionContentSnapshot = versionContent.getDocumentContent(); assertNotNull(versionContent); assertEquals(versionContentSnapshot, content); } } catch(final Throwable t) { fail(createFailMessage(t)); } }
| 1,114,283
|
public void testCreate() { try { Document document; DocumentContent content; DocumentVersion version; DocumentVersionContent versionContent; DocumentContent versionContentSnapshot; for(Fixture datum : data) { document = datum.documentModel.create(datum.name, datum.description, datum.file); assertNotNull(document); content = datum.documentModel.getContent(document.getId()); assertNotNull(content); assertEquals(content.getChecksum(), datum.documentContentChecksum); version = datum.documentModel.listVersions(document.getId()).iterator().next(); assertNotNull(version); assertEquals(version.getArtifactId(), document.getId()); assertEquals(version.getArtifactUniqueId(), document.getUniqueId()); versionContent = datum.documentModel.getVersionContent(document.getId(), version.getVersionId()); versionContentSnapshot = versionContent.getDocumentContent(); assertNotNull(versionContent); assertEquals(versionContentSnapshot, content); } } catch(final Throwable t) { fail(createFailMessage(t)); } }
|
public void testCreate() { try { Document document; DocumentContent content; DocumentVersion version; DocumentVersionContent versionContent; DocumentContent versionContentSnapshot; for(Fixture datum : data) { document = datum.documentModel.create(datum.name, datum.description, datum.file); assertNotNull(document); content = datum.documentModel.getContent(document.getId()); assertNotNull(content); assertEquals(content.getChecksum(), datum.documentContentChecksum); version = datum.documentModel.listVersions(document.getId()).iterator().next(); assertNotNull(version); assertEquals(version.getArtifactId(), document.getId()); assertEquals(version.getArtifactUniqueId(), document.getUniqueId()); versionContent = datum.documentModel.getVersionContent(document.getId(), version.getVersionId()); versionContentSnapshot = versionContent.getDocumentContent(); assertNotNull(versionContent); assertEquals(versionContentSnapshot, content); } } catch(final Throwable t) { fail(createFailMessage(t)); } }
| 1,114,284
|
protected void backup(final JabberId userId) { }
|
private void backup(final JabberId userId, final IQ query) { final JabberId archiveId = getUserModel().readArchiveId(userId); if (null != archiveId) { query.setTo(getJID(archiveId)); enqueue(archiveId, query); if (isOnline(archiveId)) { sendQueueUpdated(archiveId); } else { logWarning(MessageFormat.format("Archive {0} not online.", archiveId)); } } }
| 1,114,285
|
public String eval(Context ctx, String vtl) throws Exception { /* don't waste time with null or empty strings */ if (vtl == null || vtl.length() == 0) { return null; } StringWriter sw = new StringWriter(); boolean success = Velocity.evaluate(ctx, sw, LOG_TAG, vtl); if (success) { return sw.toString(); } /* or would it be preferable to return the original? */ return null; }
|
public String eval(Context ctx, String vtl) throws Exception { /* don't waste time with null or empty strings */ if (vtl == null || vtl.length() == 0) { return null; } StringWriter sw = new StringWriter(); boolean success; if (engine == null) { success = Velocity.evaluate(ctx, sw, LOG_TAG, vtl); } else { success = engine.evaluate(ctx, sw, LOG_TAG, vtl); } if (success) { return sw.toString(); } /* or would it be preferable to return the original? */ return null; }
| 1,114,286
|
void archive(final Long artifactId) { logger.logApiId(); logger.logVariable("artifactId", artifactId); try { assertArchiveOnline(); final UUID uniqueId = getInternalArtifactModel().readUniqueId(artifactId); getSessionModel().archiveArtifact(localUserId(), uniqueId); } catch (final Throwable t) { throw translateError(t); } }
|
void archive(final Long artifactId) { logger.logApiId(); logger.logVariable("artifactId", artifactId); try { assertArchiveOnline(); final UUID uniqueId = getArtifactModel().readUniqueId(artifactId); getSessionModel().archiveArtifact(localUserId(), uniqueId); } catch (final Throwable t) { throw translateError(t); } }
| 1,114,287
|
Container readContainer(final UUID uniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); try { assertArchiveOnline(); // HACK A quck'n'dirty check to see if the container exists locally if (null != getInternalArtifactModel().readId(uniqueId)) { return null; } else { return getSessionModel().readArchiveContainer( localUserId(), uniqueId); } } catch (final Throwable t) { throw translateError(t); } }
|
Container readContainer(final UUID uniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); try { assertArchiveOnline(); // HACK A quck'n'dirty check to see if the container exists locally if (null != getArtifactModel().readId(uniqueId)) { return null; } else { return getSessionModel().readArchiveContainer( localUserId(), uniqueId); } } catch (final Throwable t) { throw translateError(t); } }
| 1,114,288
|
List<DocumentVersion> readDocumentVersions(final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); return readDocumentVersions(uniqueId, versionId, documentUniqueId, defaultVersionComparator, defaultVersionFilter); }
|
List<DocumentVersion> readDocumentVersions(final UUID uniqueId, final Long versionId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); return readDocumentVersions(uniqueId, versionId, documentUniqueId, defaultVersionComparator, defaultVersionFilter); }
| 1,114,289
|
List<DocumentVersion> readDocumentVersions(final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); return readDocumentVersions(uniqueId, versionId, documentUniqueId, defaultVersionComparator, defaultVersionFilter); }
|
List<DocumentVersion> readDocumentVersions(final UUID uniqueId, final Long versionId, final UUID documentUniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("documentUniqueId", documentUniqueId); return readDocumentVersions(uniqueId, versionId, documentUniqueId, defaultVersionComparator, defaultVersionFilter); }
| 1,114,290
|
public void run() { logger.logApiId(); logger.logVariable("run", run); try { while (run) { started = true; synchronized (this) { notifyAll(); } final Socket clientSocket = serverSocket.accept(); logger.logTrace("Socket connected."); try { new StreamSocketDelegate(streamServer, clientSocket).run(); } catch (final Throwable t) { logger.logError(t, "Failed to negotiate stream {0}.", clientSocket.getRemoteSocketAddress()); } finally { clientSocket.close(); } logger.logTrace("Socket handler executed."); } } catch (final Throwable t) { logger.logFatal(t, "Fatal stream socket server error."); } }
|
public void run() { logger.logApiId(); logger.logVariable("run", run); try { while (run) { started = true; synchronized (this) { notifyAll(); } final Socket clientSocket = serverSocket.accept(); logger.logTrace("Socket connected."); try { new Thread(new StreamSocketDelegate(streamServer, clientSocket), clientSocket.getRemoteSocketAddress().toString()).start(); } catch (final Throwable t) { logger.logError(t, "Failed to negotiate stream {0}.", clientSocket.getRemoteSocketAddress()); } finally { clientSocket.close(); } logger.logTrace("Socket handler executed."); } } catch (final Throwable t) { logger.logFatal(t, "Fatal stream socket server error."); } }
| 1,114,291
|
public void run() { logger.logApiId(); logger.logVariable("run", run); try { while (run) { started = true; synchronized (this) { notifyAll(); } final Socket clientSocket = serverSocket.accept(); logger.logTrace("Socket connected."); try { new StreamSocketDelegate(streamServer, clientSocket).run(); } catch (final Throwable t) { logger.logError(t, "Failed to negotiate stream {0}.", clientSocket.getRemoteSocketAddress()); } finally { clientSocket.close(); } logger.logTrace("Socket handler executed."); } } catch (final Throwable t) { logger.logFatal(t, "Fatal stream socket server error."); } }
|
public void run() { logger.logApiId(); logger.logVariable("run", run); try { while (run) { started = true; synchronized (this) { notifyAll(); } final Socket clientSocket = serverSocket.accept(); logger.logTrace("Socket connected."); try { new StreamSocketDelegate(streamServer, clientSocket).run(); } catch (final Throwable t) { logger.logError(t, "Failed to negotiate stream {0}.", clientSocket.getRemoteSocketAddress()); } finally { clientSocket.close(); } logger.logTrace("Socket handler executed."); } } catch (final Throwable t) { logger.logFatal(t, "Fatal stream socket server error."); } }
| 1,114,292
|
void delete(final Long documentId) throws ParityException { logger.info("[LMODEL] [DOCUMENT MODEL] [DELETE]"); logger.debug(documentId); assertOnline("[LMODEL] [DOCUMENT MODEL] [DELETE] [USER IS NOT ONLINE]"); final Document document = get(documentId); if(isKeyHolder(documentId)) { if(isClosed(document)) { deleteLocal(document); } else if(!isDistributed(documentId)) { deleteLocal(document); } else { throw Assert.createUnreachable( "[LMODEL] [DOCUMENT MODEL] [DELETE] [CANNOT DELETE DOCUMENT UNTIL IT HAS BEEN CLOSED]"); } } else { deleteLocal(document); } // fire event notifyDocumentDeleted(null, localEventGen); }
|
void delete(final Long documentId) throws ParityException { logger.info("[LMODEL] [DOCUMENT MODEL] [DELETE]"); logger.debug(documentId); assertOnline("[LMODEL] [DOCUMENT MODEL] [DELETE] [USER IS NOT ONLINE]"); final Document document = get(documentId); if(isKeyHolder(documentId)) { if(isClosed(document)) { deleteLocal(document); } else if(!isDistributed(documentId)) { deleteLocal(document); } else { throw Assert.createUnreachable( "[LMODEL] [DOCUMENT MODEL] [DELETE] [CANNOT DELETE DOCUMENT UNTIL IT HAS BEEN CLOSED]"); } } else { deleteLocal(document); } // fire event notifyDocumentDeleted(null, localEventGen); }
| 1,114,293
|
void delete(final Long documentId) throws ParityException { logger.info("[LMODEL] [DOCUMENT MODEL] [DELETE]"); logger.debug(documentId); assertOnline("[LMODEL] [DOCUMENT MODEL] [DELETE] [USER IS NOT ONLINE]"); final Document document = get(documentId); if(isKeyHolder(documentId)) { if(isClosed(document)) { deleteLocal(document); } else if(!isDistributed(documentId)) { deleteLocal(document); } else { throw Assert.createUnreachable( "[LMODEL] [DOCUMENT MODEL] [DELETE] [CANNOT DELETE DOCUMENT UNTIL IT HAS BEEN CLOSED]"); } } else { deleteLocal(document); } // fire event notifyDocumentDeleted(null, localEventGen); }
|
void delete(final Long documentId) throws ParityException { logger.info("[LMODEL] [DOCUMENT MODEL] [DELETE]"); logger.debug(documentId); assertOnline("[LMODEL] [DOCUMENT MODEL] [DELETE] [USER IS NOT ONLINE]"); final Document document = get(documentId); if(isKeyHolder(documentId)) { if(isClosed(document)) { deleteLocal(document); } else if(!isDistributed(documentId)) { deleteLocal(document); } else { throw Assert.createUnreachable( "[LMODEL] [DOCUMENT MODEL] [DELETE] [CANNOT DELETE DOCUMENT UNTIL IT HAS BEEN CLOSED]"); } } // fire event notifyDocumentDeleted(null, localEventGen); }
| 1,114,294
|
public ContainerCell(final Container container) { super(); setCreatedBy(container.getCreatedBy()); setCreatedOn(container.getCreatedOn()); add(container.getFlags()); setUniqueId(container.getUniqueId()); setName(container.getName()); setUpdatedBy(container.getUpdatedBy()); setUpdatedOn(container.getUpdatedOn()); setId(container.getId()); setLocalDraft(container.isSetLocalDraft()); setRemoteInfo(container.getRemoteInfo()); setState(container.getState()); this.closed = getState() == ArtifactState.CLOSED; this.imageCache = new MainCellImageCache(); this.keyHolder = contains(ArtifactFlag.KEY); this.popupItemFactory = PopupItemFactory.getInstance(); this.seen = contains(ArtifactFlag.SEEN); this.urgent = Boolean.FALSE; }
|
public ContainerCell(final Container container) { super(); setCreatedBy(container.getCreatedBy()); setCreatedOn(container.getCreatedOn()); setDraft(container.isDraft()); setId(container.getId()); setLocalDraft(container.isLocalDraft()); setName(container.getName()); setRemoteInfo(container.getRemoteInfo()); setState(container.getState()); setUniqueId(container.getUniqueId()); setName(container.getName()); setUpdatedBy(container.getUpdatedBy()); setUpdatedOn(container.getUpdatedOn()); setId(container.getId()); setLocalDraft(container.isSetLocalDraft()); setRemoteInfo(container.getRemoteInfo()); setState(container.getState()); this.closed = getState() == ArtifactState.CLOSED; this.imageCache = new MainCellImageCache(); this.keyHolder = contains(ArtifactFlag.KEY); this.popupItemFactory = PopupItemFactory.getInstance(); this.seen = contains(ArtifactFlag.SEEN); this.urgent = Boolean.FALSE; }
| 1,114,295
|
public ContainerCell(final Container container) { super(); setCreatedBy(container.getCreatedBy()); setCreatedOn(container.getCreatedOn()); add(container.getFlags()); setUniqueId(container.getUniqueId()); setName(container.getName()); setUpdatedBy(container.getUpdatedBy()); setUpdatedOn(container.getUpdatedOn()); setId(container.getId()); setLocalDraft(container.isSetLocalDraft()); setRemoteInfo(container.getRemoteInfo()); setState(container.getState()); this.closed = getState() == ArtifactState.CLOSED; this.imageCache = new MainCellImageCache(); this.keyHolder = contains(ArtifactFlag.KEY); this.popupItemFactory = PopupItemFactory.getInstance(); this.seen = contains(ArtifactFlag.SEEN); this.urgent = Boolean.FALSE; }
|
public ContainerCell(final Container container) { super(); setCreatedBy(container.getCreatedBy()); setCreatedOn(container.getCreatedOn()); add(container.getFlags()); setUniqueId(container.getUniqueId()); setUpdatedBy(container.getUpdatedBy()); setUpdatedOn(container.getUpdatedOn()); setId(container.getId()); setLocalDraft(container.isSetLocalDraft()); setRemoteInfo(container.getRemoteInfo()); setState(container.getState()); this.closed = getState() == ArtifactState.CLOSED; this.imageCache = new MainCellImageCache(); this.keyHolder = contains(ArtifactFlag.KEY); this.popupItemFactory = PopupItemFactory.getInstance(); this.seen = contains(ArtifactFlag.SEEN); this.urgent = Boolean.FALSE; }
| 1,114,296
|
public ContainerCell(final Container container) { super(); setCreatedBy(container.getCreatedBy()); setCreatedOn(container.getCreatedOn()); add(container.getFlags()); setUniqueId(container.getUniqueId()); setName(container.getName()); setUpdatedBy(container.getUpdatedBy()); setUpdatedOn(container.getUpdatedOn()); setId(container.getId()); setLocalDraft(container.isSetLocalDraft()); setRemoteInfo(container.getRemoteInfo()); setState(container.getState()); this.closed = getState() == ArtifactState.CLOSED; this.imageCache = new MainCellImageCache(); this.keyHolder = contains(ArtifactFlag.KEY); this.popupItemFactory = PopupItemFactory.getInstance(); this.seen = contains(ArtifactFlag.SEEN); this.urgent = Boolean.FALSE; }
|
public ContainerCell(final Container container) { super(); setCreatedBy(container.getCreatedBy()); setCreatedOn(container.getCreatedOn()); add(container.getFlags()); setUniqueId(container.getUniqueId()); setName(container.getName()); setUpdatedBy(container.getUpdatedBy()); setUpdatedOn(container.getUpdatedOn()); setId(container.getId()); setLocalDraft(container.isSetLocalDraft()); setRemoteInfo(container.getRemoteInfo()); setState(container.getState()); this.closed = getState() == ArtifactState.CLOSED; this.imageCache = new MainCellImageCache(); this.keyHolder = contains(ArtifactFlag.KEY); this.popupItemFactory = PopupItemFactory.getInstance(); this.seen = contains(ArtifactFlag.SEEN); this.urgent = Boolean.FALSE; }
| 1,114,297
|
public void triggerPopup(final Connection connection, final Component invoker, final MouseEvent e, final int x, final int y) { final JPopupMenu jPopupMenu = MenuFactory.createPopup(); if (!isSetDraft()) { final Data createDraftData = new Data(1); createDraftData.set(CreateDraft.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_CREATE_DRAFT, createDraftData)); final Data deleteData = new Data(1); deleteData.set(Delete.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_DELETE, deleteData)); } // include the container's id and unique id in the menu 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 - " + getId()); idJMenuItem.putClientProperty("COPY_ME", getId()); idJMenuItem.addActionListener(debugActionListener); final JMenuItem uidJMenuItem = new JMenuItem("Unique id - " + getUniqueId()); uidJMenuItem.putClientProperty("COPY_ME", getUniqueId()); uidJMenuItem.addActionListener(debugActionListener); jPopupMenu.addSeparator(); jPopupMenu.add(idJMenuItem); jPopupMenu.add(uidJMenuItem); } jPopupMenu.show(invoker, x, y); }
|
public void triggerPopup(final Connection connection, final Component invoker, final MouseEvent e, final int x, final int y) { final JPopupMenu jPopupMenu = MenuFactory.createPopup(); if (!isDraft()) { final Data createDraftData = new Data(1); createDraftData.set(CreateDraft.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_CREATE_DRAFT, createDraftData)); final Data deleteData = new Data(1); deleteData.set(Delete.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_DELETE, deleteData)); } // include the container's id and unique id in the menu 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 - " + getId()); idJMenuItem.putClientProperty("COPY_ME", getId()); idJMenuItem.addActionListener(debugActionListener); final JMenuItem uidJMenuItem = new JMenuItem("Unique id - " + getUniqueId()); uidJMenuItem.putClientProperty("COPY_ME", getUniqueId()); uidJMenuItem.addActionListener(debugActionListener); jPopupMenu.addSeparator(); jPopupMenu.add(idJMenuItem); jPopupMenu.add(uidJMenuItem); } jPopupMenu.show(invoker, x, y); }
| 1,114,298
|
public void triggerPopup(final Connection connection, final Component invoker, final MouseEvent e, final int x, final int y) { final JPopupMenu jPopupMenu = MenuFactory.createPopup(); if (!isSetDraft()) { final Data createDraftData = new Data(1); createDraftData.set(CreateDraft.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_CREATE_DRAFT, createDraftData)); final Data deleteData = new Data(1); deleteData.set(Delete.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_DELETE, deleteData)); } // include the container's id and unique id in the menu 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 - " + getId()); idJMenuItem.putClientProperty("COPY_ME", getId()); idJMenuItem.addActionListener(debugActionListener); final JMenuItem uidJMenuItem = new JMenuItem("Unique id - " + getUniqueId()); uidJMenuItem.putClientProperty("COPY_ME", getUniqueId()); uidJMenuItem.addActionListener(debugActionListener); jPopupMenu.addSeparator(); jPopupMenu.add(idJMenuItem); jPopupMenu.add(uidJMenuItem); } jPopupMenu.show(invoker, x, y); }
|
public void triggerPopup(final Connection connection, final Component invoker, final MouseEvent e, final int x, final int y) { final JPopupMenu jPopupMenu = MenuFactory.createPopup(); if (!isSetDraft()) { final Data createDraftData = new Data(1); createDraftData.set(CreateDraft.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_CREATE_DRAFT, createDraftData)); final Data deleteData = new Data(1); deleteData.set(Delete.DataKey.CONTAINER_ID, getId()); jPopupMenu.add(popupItemFactory.createPopupItem(ActionId.CONTAINER_DELETE, deleteData)); } // include the container's id and unique id in the menu 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 - " + getId()); idJMenuItem.putClientProperty("COPY_ME", getId()); idJMenuItem.addActionListener(debugActionListener); final JMenuItem uidJMenuItem = new JMenuItem("Unique id - " + getUniqueId()); uidJMenuItem.putClientProperty("COPY_ME", getUniqueId()); uidJMenuItem.addActionListener(debugActionListener); jPopupMenu.addSeparator(); jPopupMenu.add(idJMenuItem); jPopupMenu.add(uidJMenuItem); } jPopupMenu.show(invoker, x, y); }
| 1,114,299
|
public void containerClosed(final ContainerEvent e) { fail(NAME + " [CONTAINER CLOSED EVENT WAS FIRED]"); }
|
public void containerClosed(ContainerEvent e) { fail(NAME + " [CONTAINER CLOSED EVENT WAS FIRED]"); }
| 1,114,300
|
public void containerCreated(final ContainerEvent e) { fail(NAME + " [CONTAINER CREATED EVENT WAS FIRED]"); }
|
public void containerCreated(ContainerEvent e) { fail(NAME + " [CONTAINER CREATED EVENT WAS FIRED]"); }
| 1,114,301
|
public void containerDeleted(final ContainerEvent e) { didNotify = Boolean.TRUE; assertTrue(NAME + " [EVENT GENERATED IS NOT LOCAL]", e.isLocal()); assertTrue(NAME + " [EVENT GENERATED IS REMOTE]", !e.isRemote()); assertNull(NAME + " [CONTAINER IS NOT NULL]", e.getContainer()); assertNull(NAME + " [USER IS NOT NULL]", e.getUser()); }
|
public void containerDeleted(ContainerEvent e) { didNotify = Boolean.TRUE; assertTrue(NAME + " [EVENT GENERATED IS NOT LOCAL]", e.isLocal()); assertTrue(NAME + " [EVENT GENERATED IS REMOTE]", !e.isRemote()); assertNull(NAME + " [CONTAINER IS NOT NULL]", e.getContainer()); assertNull(NAME + " [USER IS NOT NULL]", e.getUser()); }
| 1,114,302
|
public void containerReactivated(final ContainerEvent e) { fail(NAME + " [CONTAINER REACTIVATED EVENT WAS FIRED]"); }
|
public void containerReactivated(ContainerEvent e) { fail(NAME + " [CONTAINER REACTIVATED EVENT WAS FIRED]"); }
| 1,114,303
|
public void documentAdded(final ContainerEvent e) { fail(NAME + " [DOCUMENT ADDED EVENT WAS FIRED]"); }
|
public void documentAdded(ContainerEvent e) { fail(NAME + " [DOCUMENT ADDED EVENT WAS FIRED]"); }
| 1,114,304
|
public static AuditEventType fromId(final Integer id) { switch(id) { case 0: return CLOSE; case 1: return CREATE; case 2: return RECEIVE; case 3: return RECEIVE_KEY; case 4: return SEND; case 5: return SEND_KEY; default: throw Assert.createUnreachable("Could not determine audit type: " + id); } }
|
public static AuditEventType fromId(final Integer id) { switch(id) { case 0: return CLOSE; case 1: return CREATE; case 2: return RECEIVE; case 3: return RECEIVE_KEY; case 4: return SEND; case 5: return SEND_KEY; default: throw Assert.createUnreachable("Could not determine audit type: " + id); } }
| 1,114,305
|
Document create(final Project project, final String name, final String description, final File file) throws ParityException { logger.info("create(Project,String,String,File)"); logger.debug(project); logger.debug(name); logger.debug(description); logger.debug(file); Assert.assertTrue( "create(Project,String,String,File)", (file.length() <= IParityModelConstants.FILE_SIZE_UPPER_BOUNDS)); try { final Calendar now = DateUtil.getInstance(); final Document document = new Document(preferences.getUsername(), now, description, NO_FLAGS, UUIDGenerator.nextUUID(), name, project.getId(), preferences.getUsername(), now); final byte[] contentBytes = FileUtil.readFile(file); final DocumentContent content = new DocumentContent( MD5Util.md5Hex(contentBytes), contentBytes, document.getId()); // flag the document as having been seen document.add(ParityObjectFlag.SEEN); // create the document documentXmlIO.create(document, content); createVersion(document, DocumentAction.CREATE, create_ActionData(document)); // fire a creation event notifyCreation_objectCreated(document); return document; } catch(IOException iox) { logger.error("createDocument(Document)", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("createDocument(Document)", rx); throw ParityErrorTranslator.translate(rx); } }
|
Document create(final Project project, final String name, final String description, final File file) throws ParityException { logger.info("create(Project,String,String,File)"); logger.debug(project); logger.debug(name); logger.debug(description); logger.debug(file); Assert.assertTrue( "create(Project,String,String,File)", (file.length() <= IParityModelConstants.FILE_SIZE_UPPER_BOUNDS)); try { final Calendar now = DateUtil.getInstance(); final Document document = new Document(preferences.getUsername(), now, description, NO_FLAGS, UUIDGenerator.nextUUID(), name, project.getId(), preferences.getUsername(), now); final byte[] contentBytes = FileUtil.readFile(file); final DocumentContent content = new DocumentContent( MD5Util.md5Hex(contentBytes), contentBytes, document.getId()); // flag the document as having been seen document.add(ParityObjectFlag.SEEN); // create the document documentXmlIO.create(document, content); createVersion(document, DocumentAction.CREATE, createActionData(document)); // fire a creation event notifyCreation_objectCreated(document); return document; } catch(IOException iox) { logger.error("createDocument(Document)", iox); throw ParityErrorTranslator.translate(iox); } catch(RuntimeException rx) { logger.error("createDocument(Document)", rx); throw ParityErrorTranslator.translate(rx); } }
| 1,114,306
|
private DocumentVersion createVersion(final Document document, final DocumentAction action, final DocumentActionData actionData) throws IOException, ParityException { final File cacheFile = getCacheFile(document); if(cacheFile.exists()) { final byte[] cacheFileBytes = getCacheFileBytes(document); final String cacheFileChecksum = MD5Util.md5Hex(cacheFileBytes); final DocumentContent content = getContent(document); if(!cacheFileChecksum.equals(content.getChecksum())) { content.setContent(cacheFileBytes); documentXmlIO.update(document, content); } } final DocumentVersion version = DocumentVersionBuilder.create(document, action, actionData); documentXmlIO.create(document, version); notifyCreation_objectVersionCreated(version); return version; }
|
DocumentVersion createVersion(final Document document, final DocumentAction action, final DocumentActionData actionData) throws IOException, ParityException { final File cacheFile = getCacheFile(document); if(cacheFile.exists()) { final byte[] cacheFileBytes = getCacheFileBytes(document); final String cacheFileChecksum = MD5Util.md5Hex(cacheFileBytes); final DocumentContent content = getContent(document); if(!cacheFileChecksum.equals(content.getChecksum())) { content.setContent(cacheFileBytes); documentXmlIO.update(document, content); } } final DocumentVersion version = DocumentVersionBuilder.create(document, action, actionData); documentXmlIO.create(document, version); notifyCreation_objectVersionCreated(version); return version; }
| 1,114,307
|
private DocumentVersion createVersion(final Document document, final DocumentAction action, final DocumentActionData actionData) throws IOException, ParityException { final File cacheFile = getCacheFile(document); if(cacheFile.exists()) { final byte[] cacheFileBytes = getCacheFileBytes(document); final String cacheFileChecksum = MD5Util.md5Hex(cacheFileBytes); final DocumentContent content = getContent(document); if(!cacheFileChecksum.equals(content.getChecksum())) { content.setContent(cacheFileBytes); documentXmlIO.update(document, content); } } final DocumentVersion version = DocumentVersionBuilder.create(document, action, actionData); documentXmlIO.create(document, version); notifyCreation_objectVersionCreated(version); return version; }
|
private DocumentVersion createVersion(final Document document, final DocumentAction action, final DocumentActionData actionData) throws IOException, ParityException { final File cacheFile = getCacheFile(document); if(cacheFile.exists()) { final byte[] cacheFileBytes = getCacheFileBytes(document); final String cacheFileChecksum = MD5Util.md5Hex(cacheFileBytes); final DocumentContent content = getContent(document); if(!cacheFileChecksum.equals(content.getChecksum())) { content.setContent(cacheFileBytes); documentXmlIO.update(document, content); } } final DocumentVersion version = DocumentVersionBuilder.create(document, action, actionData); documentXmlIO.create(document, version); notifyCreation_objectVersionCreated(version); return version; }
| 1,114,308
|
private DocumentVersion createVersion(final Document document, final DocumentAction action, final DocumentActionData actionData) throws IOException, ParityException { final File cacheFile = getCacheFile(document); if(cacheFile.exists()) { final byte[] cacheFileBytes = getCacheFileBytes(document); final String cacheFileChecksum = MD5Util.md5Hex(cacheFileBytes); final DocumentContent content = getContent(document); if(!cacheFileChecksum.equals(content.getChecksum())) { content.setContent(cacheFileBytes); documentXmlIO.update(document, content); } } final DocumentVersion version = DocumentVersionBuilder.create(document, action, actionData); documentXmlIO.create(document, version); notifyCreation_objectVersionCreated(version); return version; }
|
private DocumentVersion createVersion(final Document document, final DocumentAction action, final DocumentActionData actionData) throws IOException, ParityException { final File cacheFile = getCacheFile(document); if(cacheFile.exists()) { final byte[] cacheFileBytes = getCacheFileBytes(document); final String cacheFileChecksum = MD5Util.md5Hex(cacheFileBytes); final DocumentContent content = getContent(document); if(!cacheFileChecksum.equals(content.getChecksum())) { content.setContent(cacheFileBytes); documentXmlIO.update(document, content); } } final DocumentVersion version = DocumentVersionBuilder.create(document, action, actionData); documentXmlIO.create(document, version); notifyCreation_objectVersionCreated(version); return version; }
| 1,114,309
|
public List<HistoryItem> create(final Iterable<AuditEvent> auditEvents, final InternalSessionModel iSModel) throws ParityException { final List<HistoryItem> history = new LinkedList<HistoryItem>(); final Map<JabberId, User> auditUsers = buildUserMap(auditEvents, iSModel); for(final AuditEvent auditEvent : auditEvents) { history.add(create(auditEvent, auditUsers)); } return history; }
|
public List<HistoryItem> create(final Iterable<AuditEvent> auditEvents, final InternalSessionModel iSModel) throws ParityException { final List<HistoryItem> history = new LinkedList<HistoryItem>(); final Map<JabberId, User> auditUsers = buildUserMap(auditEvents, iSModel); for(final AuditEvent auditEvent : auditEvents) { history.add(create(loggedInUser, auditEvent, auditUsers)); } return history; }
| 1,114,312
|
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { } public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } }); }
|
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { } public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); } public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); } }); }
| 1,114,313
|
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { } public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } }); }
|
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { } public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } }); }
| 1,114,314
|
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { } public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } }); }
|
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { } public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = e.getIndex0(); i < e.getIndex1() + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); } }); }
| 1,114,315
|
public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); }
|
public void intervalAdded(final ListDataEvent e) { final int index0 = e.getIndex0(); tabJPanel.remove(fillJLabel); for (int i = index0; i < tabJPanel.getComponentCount(); i++) { tabJPanel.remove(i); } for (int i = index0; i < listModel.size(); i++) { panelConstraints.gridy = i; tabJPanel.add((DefaultTabPanel) listModel.getElementAt(i), panelConstraints.clone(), i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); }
| 1,114,318
|
public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); }
|
public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); }
| 1,114,320
|
public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = index0; i < index1 + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); }
|
public void intervalRemoved(final ListDataEvent e) { final int index0 = e.getIndex0(); final int index1 = e.getIndex1(); debug(); tabJPanel.remove(fillJLabel); for (int i = e.getIndex0(); i < e.getIndex1() + 1; i++) { tabJPanel.remove(i); } tabJPanel.add(fillJLabel, fillConstraints); tabJPanel.revalidate(); tabJScrollPane.revalidate(); revalidate(); debug(); }
| 1,114,321
|
private ProviderFactory() { super(); documentModel = ModelFactory.getInstance().getDocumentModel(getClass()); sessionModel = ModelFactory.getInstance().getSessionModel(getClass()); this.historyProvider = new FlatContentProvider() { final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); final Comparator<ArtifactVersion> versionIdDescending = comparatorBuilder.createVersionById(Boolean.FALSE); public Object[] getElements(Object input) { final Long documentId = (Long) input; Collection<DocumentVersion> versionList; try { versionList = documentModel.listVersions( documentId, versionIdDescending); } catch(final ParityException px) { logger.error("Could not obtain the document version list.", px); versionList = new Vector<DocumentVersion>(0); } return versionList.toArray(new DocumentVersion[] {}); } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Long> keys; try { keys = sessionModel.getArtifactKeys(); } catch(final ParityException px) { logger.error("Cannot obtain main keys.", px); keys = Collections.<Long>emptyList(); } return keys.toArray(new Long[] {}); } }; this.mainMessageProvider = new FlatContentProvider() { // RANDOMDATA System Messages final RandomData randomData = new RandomData(); public Object[] getElements(final Object input) { return randomData.getSystemMessages(); } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.systemMessageProvider = new SingleContentProvider() { // RANDOMDATA System Message final RandomData randomData = new RandomData(); public Object getElement(Object input) { return randomData.getSystemMessage(); } }; this.sendArtifactRosterProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact roster provider requires an artifact id: java.lang.Long", input); Assert.assertOfType( "The send artifact roster provider requires an artifact id: java.lang.Long", Long.class, input); Collection<User> roster; try { final User[] team = (User[]) ((FlatContentProvider) sendArtifactTeamProvider).getElements(input); roster = sessionModel.getRosterEntries(); // remove all team members from the roster list for(final User user : team) roster.remove(user); } catch(final ParityException px) { logger.error("Cannot obtain the user's roster.", px); roster = new Vector<User>(0); } return roster.toArray(new User[] {}); } }; this.sendArtifactTeamProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; Collection<User> team; try { team = sessionModel.getSubscriptions(artifactId); final Iterator<User> iTeam = team.iterator(); User user; final String loggedInUsername = new StringBuffer(preferences.getUsername()) .append("@") .append(preferences.getServerHost()) .toString(); while(iTeam.hasNext()) { user = iTeam.next(); if(user.getUsername().equals(loggedInUsername)) { iTeam.remove(); } } } catch(final ParityException px) { logger.error("Could not obtain the team for the artifact: " + artifactId, px); team = new Vector<User>(0); } return team.toArray(new User[] {}); } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } } catch(final ParityException px) { logger.error("Could not obtain send artifact version list: " + input, px); } return versions.toArray(new DocumentVersion[] {}); } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactRosterProvider, sendArtifactTeamProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
|
private ProviderFactory() { super(); documentModel = ModelFactory.getInstance().getDocumentModel(getClass()); sessionModel = ModelFactory.getInstance().getSessionModel(getClass()); this.historyProvider = new FlatContentProvider() { final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); final Comparator<ArtifactVersion> versionIdDescending = comparatorBuilder.createVersionById(Boolean.FALSE); public Object[] getElements(Object input) { final Long documentId = (Long) input; Collection<DocumentVersion> versionList; try { versionList = documentModel.listVersions( documentId, versionIdDescending); } catch(final ParityException px) { logger.error("Could not obtain the document version list.", px); versionList = new Vector<DocumentVersion>(0); } return versionList.toArray(new DocumentVersion[] {}); } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Long> keys; try { keys = sessionModel.getArtifactKeys(); } catch(final ParityException px) { logger.error("Cannot obtain main keys.", px); keys = Collections.<Long>emptyList(); } return keys.toArray(new Long[] {}); } }; this.mainMessageProvider = new FlatContentProvider() { // RANDOMDATA System Messages final RandomData randomData = new RandomData(); public Object[] getElements(final Object input) { return randomData.getSystemMessages(); } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.systemMessageProvider = new SingleContentProvider() { // RANDOMDATA System Message final RandomData randomData = new RandomData(); public Object getElement(Object input) { return randomData.getSystemMessage(); } }; this.sendArtifactRosterProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact roster provider requires an artifact id: java.lang.Long", input); Assert.assertOfType( "The send artifact roster provider requires an artifact id: java.lang.Long", Long.class, input); Collection<User> roster; try { final User[] team = (User[]) ((FlatContentProvider) sendArtifactTeamProvider).getElements(input); roster = sessionModel.getRosterEntries(); // remove all team members from the roster list for(final User user : team) roster.remove(user); } catch(final ParityException px) { logger.error("Cannot obtain the user's roster.", px); roster = new Vector<User>(0); } return roster.toArray(new User[] {}); } }; this.sendArtifactTeamProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; Collection<User> team; try { team = sessionModel.getSubscriptions(artifactId); final Iterator<User> iTeam = team.iterator(); User user; final String loggedInUsername = new StringBuffer(preferences.getUsername()) .append("@") .append(preferences.getServerHost()) .toString(); while(iTeam.hasNext()) { user = iTeam.next(); if(user.getUsername().equals(loggedInUsername)) { iTeam.remove(); } } } catch(final ParityException px) { logger.error("Could not obtain the team for the artifact: " + artifactId, px); team = new Vector<User>(0); } return team.toArray(new User[] {}); } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } } catch(final ParityException px) { logger.error("Could not obtain send artifact version list: " + input, px); } return versions.toArray(new DocumentVersion[] {}); } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactRosterProvider, sendArtifactTeamProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
| 1,114,323
|
private ProviderFactory() { super(); documentModel = ModelFactory.getInstance().getDocumentModel(getClass()); sessionModel = ModelFactory.getInstance().getSessionModel(getClass()); this.historyProvider = new FlatContentProvider() { final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); final Comparator<ArtifactVersion> versionIdDescending = comparatorBuilder.createVersionById(Boolean.FALSE); public Object[] getElements(Object input) { final Long documentId = (Long) input; Collection<DocumentVersion> versionList; try { versionList = documentModel.listVersions( documentId, versionIdDescending); } catch(final ParityException px) { logger.error("Could not obtain the document version list.", px); versionList = new Vector<DocumentVersion>(0); } return versionList.toArray(new DocumentVersion[] {}); } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Long> keys; try { keys = sessionModel.getArtifactKeys(); } catch(final ParityException px) { logger.error("Cannot obtain main keys.", px); keys = Collections.<Long>emptyList(); } return keys.toArray(new Long[] {}); } }; this.mainMessageProvider = new FlatContentProvider() { // RANDOMDATA System Messages final RandomData randomData = new RandomData(); public Object[] getElements(final Object input) { return randomData.getSystemMessages(); } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.systemMessageProvider = new SingleContentProvider() { // RANDOMDATA System Message final RandomData randomData = new RandomData(); public Object getElement(Object input) { return randomData.getSystemMessage(); } }; this.sendArtifactRosterProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact roster provider requires an artifact id: java.lang.Long", input); Assert.assertOfType( "The send artifact roster provider requires an artifact id: java.lang.Long", Long.class, input); Collection<User> roster; try { final User[] team = (User[]) ((FlatContentProvider) sendArtifactTeamProvider).getElements(input); roster = sessionModel.getRosterEntries(); // remove all team members from the roster list for(final User user : team) roster.remove(user); } catch(final ParityException px) { logger.error("Cannot obtain the user's roster.", px); roster = new Vector<User>(0); } return roster.toArray(new User[] {}); } }; this.sendArtifactTeamProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; Collection<User> team; try { team = sessionModel.getSubscriptions(artifactId); final Iterator<User> iTeam = team.iterator(); User user; final String loggedInUsername = new StringBuffer(preferences.getUsername()) .append("@") .append(preferences.getServerHost()) .toString(); while(iTeam.hasNext()) { user = iTeam.next(); if(user.getUsername().equals(loggedInUsername)) { iTeam.remove(); } } } catch(final ParityException px) { logger.error("Could not obtain the team for the artifact: " + artifactId, px); team = new Vector<User>(0); } return team.toArray(new User[] {}); } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } } catch(final ParityException px) { logger.error("Could not obtain send artifact version list: " + input, px); } return versions.toArray(new DocumentVersion[] {}); } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactRosterProvider, sendArtifactTeamProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
|
private ProviderFactory() { super(); documentModel = ModelFactory.getInstance().getDocumentModel(getClass()); sessionModel = ModelFactory.getInstance().getSessionModel(getClass()); this.historyProvider = new FlatContentProvider() { final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); final Comparator<ArtifactVersion> versionIdDescending = comparatorBuilder.createVersionById(Boolean.FALSE); public Object[] getElements(Object input) { final Long documentId = (Long) input; Collection<DocumentVersion> versionList; try { versionList = documentModel.listVersions( documentId, versionIdDescending); } catch(final ParityException px) { logger.error("Could not obtain the document version list.", px); versionList = new Vector<DocumentVersion>(0); } return versionList.toArray(new DocumentVersion[] {}); } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Long> keys; try { keys = sessionModel.getArtifactKeys(); } catch(final ParityException px) { logger.error("Cannot obtain main keys.", px); keys = Collections.<Long>emptyList(); } return keys.toArray(new Long[] {}); } }; this.mainMessageProvider = new FlatContentProvider() { // RANDOMDATA System Messages final RandomData randomData = new RandomData(); public Object[] getElements(final Object input) { return randomData.getSystemMessages(); } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.systemMessageProvider = new SingleContentProvider() { // RANDOMDATA System Message final RandomData randomData = new RandomData(); public Object getElement(Object input) { return randomData.getSystemMessage(); } }; this.sendArtifactRosterProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact roster provider requires an artifact id: java.lang.Long", input); Assert.assertOfType( "The send artifact roster provider requires an artifact id: java.lang.Long", Long.class, input); Collection<User> roster; try { final User[] team = (User[]) ((FlatContentProvider) sendArtifactTeamProvider).getElements(input); roster = sessionModel.getRosterEntries(); // remove all team members from the roster list for(final User user : team) roster.remove(user); } catch(final ParityException px) { logger.error("Cannot obtain the user's roster.", px); roster = new Vector<User>(0); } return roster.toArray(new User[] {}); } }; this.sendArtifactTeamProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; Collection<User> team; try { team = sessionModel.getSubscriptions(artifactId); final Iterator<User> iTeam = team.iterator(); User user; final String loggedInUsername = new StringBuffer(preferences.getUsername()) .append("@") .append(preferences.getServerHost()) .toString(); while(iTeam.hasNext()) { user = iTeam.next(); if(user.getUsername().equals(loggedInUsername)) { iTeam.remove(); } } } catch(final ParityException px) { logger.error("Could not obtain the team for the artifact: " + artifactId, px); team = new Vector<User>(0); } return team.toArray(new User[] {}); } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } } catch(final ParityException px) { logger.error("Could not obtain send artifact version list: " + input, px); } return versions.toArray(new DocumentVersion[] {}); } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactRosterProvider, sendArtifactTeamProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
| 1,114,324
|
private ProviderFactory() { super(); documentModel = ModelFactory.getInstance().getDocumentModel(getClass()); sessionModel = ModelFactory.getInstance().getSessionModel(getClass()); this.historyProvider = new FlatContentProvider() { final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); final Comparator<ArtifactVersion> versionIdDescending = comparatorBuilder.createVersionById(Boolean.FALSE); public Object[] getElements(Object input) { final Long documentId = (Long) input; Collection<DocumentVersion> versionList; try { versionList = documentModel.listVersions( documentId, versionIdDescending); } catch(final ParityException px) { logger.error("Could not obtain the document version list.", px); versionList = new Vector<DocumentVersion>(0); } return versionList.toArray(new DocumentVersion[] {}); } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Long> keys; try { keys = sessionModel.getArtifactKeys(); } catch(final ParityException px) { logger.error("Cannot obtain main keys.", px); keys = Collections.<Long>emptyList(); } return keys.toArray(new Long[] {}); } }; this.mainMessageProvider = new FlatContentProvider() { // RANDOMDATA System Messages final RandomData randomData = new RandomData(); public Object[] getElements(final Object input) { return randomData.getSystemMessages(); } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.systemMessageProvider = new SingleContentProvider() { // RANDOMDATA System Message final RandomData randomData = new RandomData(); public Object getElement(Object input) { return randomData.getSystemMessage(); } }; this.sendArtifactRosterProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact roster provider requires an artifact id: java.lang.Long", input); Assert.assertOfType( "The send artifact roster provider requires an artifact id: java.lang.Long", Long.class, input); Collection<User> roster; try { final User[] team = (User[]) ((FlatContentProvider) sendArtifactTeamProvider).getElements(input); roster = sessionModel.getRosterEntries(); // remove all team members from the roster list for(final User user : team) roster.remove(user); } catch(final ParityException px) { logger.error("Cannot obtain the user's roster.", px); roster = new Vector<User>(0); } return roster.toArray(new User[] {}); } }; this.sendArtifactTeamProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; Collection<User> team; try { team = sessionModel.getSubscriptions(artifactId); final Iterator<User> iTeam = team.iterator(); User user; final String loggedInUsername = new StringBuffer(preferences.getUsername()) .append("@") .append(preferences.getServerHost()) .toString(); while(iTeam.hasNext()) { user = iTeam.next(); if(user.getUsername().equals(loggedInUsername)) { iTeam.remove(); } } } catch(final ParityException px) { logger.error("Could not obtain the team for the artifact: " + artifactId, px); team = new Vector<User>(0); } return team.toArray(new User[] {}); } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } } catch(final ParityException px) { logger.error("Could not obtain send artifact version list: " + input, px); } return versions.toArray(new DocumentVersion[] {}); } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactRosterProvider, sendArtifactTeamProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
|
private ProviderFactory() { super(); documentModel = ModelFactory.getInstance().getDocumentModel(getClass()); sessionModel = ModelFactory.getInstance().getSessionModel(getClass()); this.historyProvider = new FlatContentProvider() { final ComparatorBuilder comparatorBuilder = new ComparatorBuilder(); final Comparator<ArtifactVersion> versionIdDescending = comparatorBuilder.createVersionById(Boolean.FALSE); public Object[] getElements(Object input) { final Long documentId = (Long) input; Collection<DocumentVersion> versionList; try { versionList = documentModel.listVersions( documentId, versionIdDescending); } catch(final ParityException px) { logger.error("Could not obtain the document version list.", px); versionList = new Vector<DocumentVersion>(0); } return versionList.toArray(new DocumentVersion[] {}); } }; this.logger = ModelLoggerFactory.getLogger(getClass()); this.mainDocumentProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { try { // sort by: // +> hasBeenSeen ? true b4 false // +> last update ? earlier b4 later // +> name ? alpha order final AbstractArtifactComparator sort = new HasBeenSeenComparator(Boolean.FALSE); sort.add(new UpdatedOnComparator(Boolean.FALSE)); sort.add(new ComparatorBuilder().createByName(Boolean.TRUE)); return documentModel.list(sort).toArray(new Document[] {}); } catch(final ParityException px) { throw new RuntimeException(px); } } }; this.mainKeyProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { List<Long> keys; try { keys = sessionModel.getArtifactKeys(); } catch(final ParityException px) { logger.error("Cannot obtain main keys.", px); keys = Collections.<Long>emptyList(); } return keys.toArray(new Long[] {}); } }; this.mainMessageProvider = new FlatContentProvider() { // RANDOMDATA System Messages final RandomData randomData = new RandomData(); public Object[] getElements(final Object input) { return randomData.getSystemMessages(); } }; this.mainProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {mainDocumentProvider, mainMessageProvider, mainKeyProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull("Index cannot be null.", index); Assert.assertTrue( "Index must lie within [0," + (contentProviders.length - 1) + "]", index >= 0 && index < contentProviders.length); return ((FlatContentProvider) getProvider(index)).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; this.systemMessageProvider = new SingleContentProvider() { // RANDOMDATA System Message final RandomData randomData = new RandomData(); public Object getElement(Object input) { return randomData.getSystemMessage(); } }; this.sendArtifactRosterProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact roster provider requires an artifact id: java.lang.Long", input); Assert.assertOfType( "The send artifact roster provider requires an artifact id: java.lang.Long", Long.class, input); Collection<User> roster; try { final User[] team = (User[]) ((FlatContentProvider) sendArtifactTeamProvider).getElements(input); roster = sessionModel.getRosterEntries(); // remove all team members from the roster list for(final User user : team) roster.remove(user); } catch(final ParityException px) { logger.error("Cannot obtain the user's roster.", px); roster = new Vector<User>(0); } return roster.toArray(new User[] {}); } }; this.sendArtifactTeamProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The team provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The team provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; Collection<User> team; try { team = sessionModel.getSubscriptions(artifactId); final Iterator<User> iTeam = team.iterator(); User user; final String loggedInUsername = new StringBuffer(preferences.getUsername()) .append("@") .append(preferences.getServerHost()) .toString(); while(iTeam.hasNext()) { user = iTeam.next(); if(user.getUsername().equals(loggedInUsername)) { iTeam.remove(); } } } catch(final ParityException px) { logger.error("Could not obtain the team for the artifact: " + artifactId, px); team = new Vector<User>(0); } return team.toArray(new User[] {}); } }; this.sendArtifactVersionProvider = new FlatContentProvider() { public Object[] getElements(final Object input) { Assert.assertNotNull( "The send artifact version provider requires an artifact id: java.lang.Long.", input); Assert.assertOfType( "The send artifact version provider requires an artifact id: java.lang.Long.", Long.class, input); final Long artifactId = (Long) input; final List<DocumentVersion> versions = new LinkedList<DocumentVersion>(); try { versions.addAll(documentModel.listVersions(artifactId)); if(sessionModel.isLoggedInUserKeyHolder(artifactId)) { versions.add(0, WorkingVersion.getWorkingVersion()); } } catch(final ParityException px) { logger.error("Could not obtain send artifact version list: " + input, px); } return versions.toArray(new DocumentVersion[] {}); } }; this.sendArtifactProvider = new CompositeFlatContentProvider() { private final ContentProvider[] contentProviders = new ContentProvider[] {sendArtifactRosterProvider, sendArtifactTeamProvider, sendArtifactVersionProvider}; public Object[] getElements(final Integer index, final Object input) { Assert.assertNotNull( "Index for composite content provider cannot be null.", index); Assert.assertTrue( "Index for the send artifact content provider mus lie within [0," + 2 + "]", index >= 0 && index <= 2); return getProvider(index).getElements(input); } private FlatContentProvider getProvider(final Integer index) { return (FlatContentProvider) contentProviders[index]; } }; }
| 1,114,325
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.