rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload();
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE);
public void run() { ((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload(); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE);
((BrowserInfoAvatar) avatarRegistry.get(AvatarId.BROWSER_INFO)).reload();
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE);
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.TRUE);
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.FALSE); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.TRUE);
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, remoteReload);
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, Boolean.TRUE); }
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, remoteReload);
((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadSystemMessage(systemMessageId);
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadDocument(documentId, remoteReload); }
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadSystemMessage(systemMessageId); }
public void run() { window.open(avatar); }
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).reloadSystemMessage(systemMessageId); }
public void removeSearchFilter() { SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).removeFilter(searchFilter); } }); }
public void removeSearchFilter() { getMainAvatar().removeSearchFilter(); }
public void removeSearchFilter() { SwingUtilities.invokeLater(new Runnable() { public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).removeFilter(searchFilter); } }); }
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).removeFilter(searchFilter); }
public void run() { window.open(avatar); }
public void run() { ((BrowserMainAvatar) avatarRegistry.get(AvatarId.BROWSER_MAIN)).removeFilter(searchFilter); }
return CollectionsUtil.proxy(getInternalArtifactModel().readTeam(containerId));
final Set<User> team = getInternalArtifactModel().readTeam(containerId); if(team.isEmpty()) { return new ArrayList<User>(0); } else { return CollectionsUtil.proxy(getInternalArtifactModel().readTeam(containerId)); }
List<User> readTeam(final Long containerId) { logger.info(getApiId("[READ TEAM]")); logger.debug(containerId); return CollectionsUtil.proxy(getInternalArtifactModel().readTeam(containerId)); }
getContainerModel().createDraft(containerId); browser.fireContainerDraftCreated(containerId, Boolean.FALSE);
getContainerModel().createDraft(containerId);
public void invoke(final Data data) { final Long containerId = (Long) data.get(DataKey.CONTAINER_ID); getContainerModel().createDraft(containerId); browser.fireContainerDraftCreated(containerId, Boolean.FALSE); }
this.javaFileListFlavor = DataFlavor.javaFileListFlavor;
public CreateDocumentTxHandler(final Browser browser) { super(); this.browser = browser; this.dModel = browser.getDocumentModel(); this.javaFileListFlavor = DataFlavor.javaFileListFlavor; this.logger = LoggerFactory.getLogger(getClass()); }
List data = null; try { data = (List) t.getTransferData(javaFileListFlavor); }
File[] files = null; try { files = TxUtils.extractFiles(t); } catch(final IOException iox) { logger.error(IMPORT_IOX, iox); }
public boolean importData(final JComponent comp, final Transferable t) { if(!canImport(comp, t.getTransferDataFlavors())) { return false; } List data = null; try { data = (List) t.getTransferData(javaFileListFlavor); } catch(final UnsupportedFlavorException ufx) { logger.error(IMPORT_UFX, ufx); return false; } catch(final IOException iox) { logger.error(IMPORT_IOX, iox); return false; } // create documents for each file transferred final Set<Long> createdIds = new HashSet<Long>(); boolean didPass = true; for(final Object datum : data) { final File file = (File) datum; try { final Document document = dModel.create(file.getName(), null, file); createdIds.add(document.getId()); } catch(final ParityException px) { logger.error(IMPORT_PX, px); didPass = false; } } if(didPass) { browser.fireDocumentsCreated(createdIds); browser.setInfoMessage("Document.Created"); return true; } else { // try to undo the created docs for(final Long id : createdIds) { try { dModel.delete(id); } catch(final ParityException px) { logger.error(IMPORT_UNDO_PX, px); } } return false; } }
return false; } catch(final IOException iox) { logger.error(IMPORT_IOX, iox); return false;
public boolean importData(final JComponent comp, final Transferable t) { if(!canImport(comp, t.getTransferDataFlavors())) { return false; } List data = null; try { data = (List) t.getTransferData(javaFileListFlavor); } catch(final UnsupportedFlavorException ufx) { logger.error(IMPORT_UFX, ufx); return false; } catch(final IOException iox) { logger.error(IMPORT_IOX, iox); return false; } // create documents for each file transferred final Set<Long> createdIds = new HashSet<Long>(); boolean didPass = true; for(final Object datum : data) { final File file = (File) datum; try { final Document document = dModel.create(file.getName(), null, file); createdIds.add(document.getId()); } catch(final ParityException px) { logger.error(IMPORT_PX, px); didPass = false; } } if(didPass) { browser.fireDocumentsCreated(createdIds); browser.setInfoMessage("Document.Created"); return true; } else { // try to undo the created docs for(final Long id : createdIds) { try { dModel.delete(id); } catch(final ParityException px) { logger.error(IMPORT_UNDO_PX, px); } } return false; } }
for(final Object datum : data) { final File file = (File) datum;
for(final File file : files) {
public boolean importData(final JComponent comp, final Transferable t) { if(!canImport(comp, t.getTransferDataFlavors())) { return false; } List data = null; try { data = (List) t.getTransferData(javaFileListFlavor); } catch(final UnsupportedFlavorException ufx) { logger.error(IMPORT_UFX, ufx); return false; } catch(final IOException iox) { logger.error(IMPORT_IOX, iox); return false; } // create documents for each file transferred final Set<Long> createdIds = new HashSet<Long>(); boolean didPass = true; for(final Object datum : data) { final File file = (File) datum; try { final Document document = dModel.create(file.getName(), null, file); createdIds.add(document.getId()); } catch(final ParityException px) { logger.error(IMPORT_PX, px); didPass = false; } } if(didPass) { browser.fireDocumentsCreated(createdIds); browser.setInfoMessage("Document.Created"); return true; } else { // try to undo the created docs for(final Long id : createdIds) { try { dModel.delete(id); } catch(final ParityException px) { logger.error(IMPORT_UNDO_PX, px); } } return false; } }
final Properties log4j = ConfigFactory.newInstance("log4j.properties"); switch (Version.getMode()) { case DEVELOPMENT: log4j.setProperty("log4j.logger.com.thinkparity", "DEBUG,FILE"); break; case DEMO: case PRODUCTION: log4j.setProperty("log4j.logger.com.thinkparity", "WARN,FILE"); break; case TESTING: log4j.setProperty("log4j.logger.com.thinkparity", "INFO,FILE"); break; default: Assert.assertUnreachable("UNKNOWN MODE"); } log4j.setProperty("log4j.appender.FILE.File", new File(workspace.getLogDirectory(), "thinkParity.log").getAbsolutePath()); PropertyConfigurator.configure(log4j); new Log4JWrapper().logInfo("{0} - {1} - {2}", Version.getName(), Version.getMode(), Version.getBuildId());
final Properties logging = new Properties(); logging.setProperty("log4j.renderer.java.awt.Point", "com.thinkparity.codebase.log4j.or.PointRenderer"); logging.setProperty("log4j.renderer.java.awt.event.MouseEvent", "com.thinkparity.codebase.log4j.or.MouseEventRenderer"); PropertyConfigurator.configure(logging);
private static void initLogging(final Workspace workspace) { final Properties log4j = ConfigFactory.newInstance("log4j.properties"); switch (Version.getMode()) { case DEVELOPMENT: log4j.setProperty("log4j.logger.com.thinkparity", "DEBUG,FILE"); break; case DEMO: case PRODUCTION: log4j.setProperty("log4j.logger.com.thinkparity", "WARN,FILE"); break; case TESTING: log4j.setProperty("log4j.logger.com.thinkparity", "INFO,FILE"); break; default: Assert.assertUnreachable("UNKNOWN MODE"); } log4j.setProperty("log4j.appender.FILE.File", new File(workspace.getLogDirectory(), "thinkParity.log").getAbsolutePath()); PropertyConfigurator.configure(log4j); new Log4JWrapper().logInfo("{0} - {1} - {2}", Version.getName(), Version.getMode(), Version.getBuildId()); }
if(jListModel.isEmpty()) { getController().disableHistory(); } else { getController().enableHistory(); }
public void reloadDocument(final Long documentId, final Boolean remoteReload) { final DisplayDocument displayDocument = getDisplayDocument(documentId); // if the display document is null; we can assume the document has been // deleted (it's not longer being created by the provider); so we find // the document and remove it if(null == displayDocument) { ListItem listItem; for(int i = 0; i < jListModel.size(); i++) { listItem = (ListItem) jListModel.get(i); if(listItem instanceof DocumentListItem) { if(((DocumentListItem) listItem).getDocumentId().equals(documentId)) { jListModel.remove(i); jList.setSelectedIndex(i); break; } } } } else { final ListItem listItem = DocumentListItem.create(displayDocument); // if the document list item is in the list; we need to remove it; // and re-add it. // // if the reload is not the result of a remote event; put it back // where it was; otherwise move it to the top if(jListModel.contains(listItem)) { final int index = jListModel.indexOf(listItem); jListModel.remove(index); if(remoteReload) { jListModel.add(0, listItem); } else { jListModel.add(index, listItem); } } // if it's not in the list; just add it to the top else { jListModel.add(0, listItem); } // maintain selection final Integer modelIndex = jListModel.indexOf(listItem); jList.setSelectedIndex(modelIndex); } }
applySize(content, 472);
applySize(content, 469);
private Display createContent() { if(null == content) { content = new ContentDisplay(); // HEIGHT ContentDisplay 472 applySize(content, 472); } return content; }
applySize(status, 20);
applySize(status, 23);
private Display createStatus() { if(null == status) { status = new StatusDisplay(); // HEIGHT Status Display 20 applySize(status, 20); } return status; }
final Data input = new Data(1);
final Data input = new Data(2);
void displayMainStatusAvatar() { final Data input = new Data(1); input.set(MainStatusAvatar.DataKey.PROFILE, getProfile()); setInput(AvatarId.MAIN_STATUS, input); displayStatus(AvatarId.MAIN_STATUS); }
input.set(MainStatusAvatar.DataKey.CONNECTION, getConnection());
void displayMainStatusAvatar() { final Data input = new Data(1); input.set(MainStatusAvatar.DataKey.PROFILE, getProfile()); setInput(AvatarId.MAIN_STATUS, input); displayStatus(AvatarId.MAIN_STATUS); }
if (vtl == null || vtl.length() == 0) { return null; }
public String eval(Context ctx, String vtl) throws Exception { 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; }
final List<TeamMember> team = getInternalArtifactModel().readTeam2(artifactId);
final List<TeamMember> team = getArtifactModel().readTeam2(artifactId);
protected void assertNotTeamMember(final Object assertion, final Long artifactId, final JabberId userId) { final List<TeamMember> team = getInternalArtifactModel().readTeam2(artifactId); final User user = getInternalUserModel().read(userId); if (null != user) Assert.assertNotTrue(assertion, contains(team, user)); }
final List<TeamMember> team = getInternalArtifactModel().readTeam2(artifactId);
final List<TeamMember> team = getArtifactModel().readTeam2(artifactId);
protected void assertTeamMember(final Object assertion, final Long artifactId, final JabberId userId) { final List<TeamMember> team = getInternalArtifactModel().readTeam2(artifactId); Assert.assertNotTrue(assertion, contains(team, getInternalUserModel().read(userId))); }
return getInternalArtifactModel().doesVersionExist(artifactId, versionId);
return getArtifactModel().doesVersionExist(artifactId, versionId);
protected Boolean doesExistVersion(final Long artifactId, final Long versionId) { return getInternalArtifactModel().doesVersionExist(artifactId, versionId); }
final InternalArtifactModel artifactModel = getInternalArtifactModel();
final InternalArtifactModel artifactModel = getArtifactModel();
protected Boolean isKeyHolder(final Long artifactId) throws ParityException { assertOnline("USER NOT ONLINE"); final InternalArtifactModel artifactModel = getInternalArtifactModel(); return artifactModel.isFlagApplied(artifactId, ArtifactFlag.KEY) && isRemoteKeyHolder(artifactModel.readUniqueId(artifactId)); }
final List<TeamMember> team = getInternalArtifactModel().readTeam2(artifactId);
final List<TeamMember> team = getArtifactModel().readTeam2(artifactId);
protected TeamMember localTeamMember(final Long artifactId) { final List<TeamMember> team = getInternalArtifactModel().readTeam2(artifactId); return get(team, localUser()); }
return getInternalArtifactModel().readUniqueId(artifactId);
return getArtifactModel().readUniqueId(artifactId);
protected UUID readArtifactUniqueId(final Long artifactId) { return getInternalArtifactModel().readUniqueId(artifactId); }
final Long latestVersionId = getInternalArtifactModel().readLatestVersionId(artifactId);
final Long latestVersionId = getArtifactModel().readLatestVersionId(artifactId);
protected Long readNextVersionId(final Long artifactId) { final Long latestVersionId = getInternalArtifactModel().readLatestVersionId(artifactId); return null == latestVersionId ? Versioning.START : latestVersionId + Versioning.INCREMENT; }
assertNotNull(project);
public void testGet() { try { Project project; for(Fixture datum : data) { project = datum.projectModel.get(datum.projectId); assertNotNull(project); assertEquals(datum.expectedProject, project); } } catch(Throwable t) { fail(getFailMessage(t)); } }
private TxUtils() { super(); }
private TxUtils() { super(); this.logger = LoggerFactory.getLogger(getClass()); }
private TxUtils() { super(); }
final XMPPSession session = openSession();
final XMPPSession session = openAnonymousSession();
public Long create(final String artifactId, final String groupId, final String path, final Library.Type type, final String version) throws XMPPException { final XMPPSession session = openSession(); try { session.setRemoteMethod("library:create"); session.setParameter("artifactId", artifactId); session.setParameter("groupId", groupId); session.setParameter("path", path); session.setParameter("type", type); session.setParameter("version", version); session.execute(); if(session.containsResult()) { session.commit(); return session.getLong("id"); } else { throw new XMPPException( "[RMODEL] [LIBRARY] [XMPP IO] [UNABLE TO CREATE LIBRARY]"); } } catch(final Exception x) { session.rollback(); throw new XMPPException(x); } finally { session.close(); } }
final XMPPSession session = openSession();
final XMPPSession session = openAnonymousSession();
public void createBytes(final Long libraryId, final byte[] bytes, final String checksum) throws XMPPException { final XMPPSession session = openSession(); try { session.setRemoteMethod("library:createbytes"); session.setParameter("id", libraryId); session.setParameter("bytes", bytes); session.setParameter("checksum", checksum); session.execute(); session.commit(); } catch(final Exception x) { session.rollback(); throw new XMPPException(x); } finally { session.close(); } }
final XMPPSession session = openSession();
final XMPPSession session = openAnonymousSession();
public void delete(final Long libraryId) throws XMPPException { final XMPPSession session = openSession(); try { session.setRemoteMethod("library:delete"); session.setParameter("id", libraryId); session.execute(); } catch(final Exception x) { session.rollback(); throw new XMPPException(x); } finally { session.close(); } }
final XMPPSession session = openSession();
final XMPPSession session = openAnonymousSession();
public Library read(final Long libraryId) throws XMPPException { final XMPPSession session = openSession(); try { session.setRemoteMethod("library:read"); session.setParameter("id", libraryId); session.execute(); if(session.containsResult()) { return extractLibrary(session); } else { return null; } } finally { session.close(); } }
final XMPPSession session = openSession();
final XMPPSession session = openAnonymousSession();
public LibraryBytes readBytes(final Long libraryId) throws XMPPException { final XMPPSession session = openSession(); try { session.setRemoteMethod("library:readbytes"); session.setParameter("id", libraryId); session.execute(); if(session.containsResult()) { return extractLibraryBytes(session); } else { return null; } } catch(final Exception x) { throw new XMPPException(x); } finally { session.close(); } }
final XMPPSession session = openSession();
final XMPPSession session = openAnonymousSession();
public byte[] readSmallBytes(final Long libraryId) throws XMPPException { final XMPPSession session = openSession(); try { session.setRemoteMethod("library:readbytes"); session.setParameter("id", libraryId); session.execute(); if(session.containsResult()) { return extractSmallLibraryBytes(session); } else { return null; } } catch(final Exception x) { throw new XMPPException(x); } finally { session.close(); } }
this.logger = LoggerFactory.getLogger(getClass()); logger.info("l18Context:" + l18Context);
public ResourceBundleHelper(final ResourceBundle bundle, final String l18Context) { super(); this.bundle = bundle; this.l18Context = l18Context; }
this.browser = browser;
public ApplyFlagSeen(final Browser browser) { super(ActionId.ARTIFACT_APPLY_FLAG_SEEN); }
getArtifactModel().applyFlagSeen(artifactId);
final ArtifactType artifactType = (ArtifactType) data.get(DataKey.ARTIFACT_TYPE); if (!getArtifactModel().hasBeenSeen(artifactId)) { getArtifactModel().applyFlagSeen(artifactId); browser.fireArtifactFlagSeen(artifactId, artifactType, Boolean.FALSE); }
public void invoke(final Data data) { final Long artifactId = (Long) data.get(DataKey.ARTIFACT_ID); getArtifactModel().applyFlagSeen(artifactId); }
if(null == region) { return Boolean.FALSE; } if(null == point) { return Boolean.FALSE; }
private Boolean doesRegionContain(final Rectangle region, final Point point) { return (point.x >= region.x) && (point.x < region.x + region.width) && (point.y >= region.y) && (point.y < region.y + region.height); }
this.touchedDocuments = new LinkedList<DisplayDocument>();
BrowserMainDocumentModel(final Browser browser) { super(); this.browser = browser; this.documentFilter = new FilterChain<Artifact>(); this.documents = new LinkedList<DisplayDocument>(); this.jListModel = new DefaultListModel(); this.logger = browser.getPlatform().getLogger(getClass()); this.visibleDocuments = new LinkedList<DisplayDocument>(); }
for(final ListItem li2 : modelItems) { if(li2 instanceof DocumentListItem) { if(!visibleDocuments.contains(((DocumentListItem) li2).getDisplayDocument())) { jListModel.removeElement(li2);
DocumentListItem dli; int touchedIndex; for(int i = 0; i < modelItems.length; i++) { li = modelItems[i]; if(li instanceof DocumentListItem) { dli = (DocumentListItem) li; if(!visibleDocuments.contains(dli.getDisplayDocument())) jListModel.removeElement(li); if(touchedDocuments.contains(dli.getDisplayDocument())) { touchedIndex = touchedDocuments.indexOf(dli.getDisplayDocument()); jListModel.remove(i); jListModel.add(i, ListItem.create(touchedDocuments.get(touchedIndex)));
private void syncDocuments() { // sync the documents with the visible documents visibleDocuments.clear(); visibleDocuments.addAll(documents); ModelFilterManager.filter(visibleDocuments, documentFilter); // sync visible documents with the swing list's model ListItem li; for(int i = 0; i < visibleDocuments.size(); i++) { li = ListItem.create(visibleDocuments.get(i)); if(!jListModel.contains(li)) { jListModel.add(i, li); } } final ListItem[] modelItems = new ListItem[jListModel.size()]; jListModel.copyInto(modelItems); for(final ListItem li2 : modelItems) { if(li2 instanceof DocumentListItem) { if(!visibleDocuments.contains(((DocumentListItem) li2).getDisplayDocument())) { jListModel.removeElement(li2); } } } if(1 > visibleDocuments.size()) { browser.disableHistory(); } else { browser.enableHistory(); } }
touchedDocuments.clear();
private void syncDocuments() { // sync the documents with the visible documents visibleDocuments.clear(); visibleDocuments.addAll(documents); ModelFilterManager.filter(visibleDocuments, documentFilter); // sync visible documents with the swing list's model ListItem li; for(int i = 0; i < visibleDocuments.size(); i++) { li = ListItem.create(visibleDocuments.get(i)); if(!jListModel.contains(li)) { jListModel.add(i, li); } } final ListItem[] modelItems = new ListItem[jListModel.size()]; jListModel.copyInto(modelItems); for(final ListItem li2 : modelItems) { if(li2 instanceof DocumentListItem) { if(!visibleDocuments.contains(((DocumentListItem) li2).getDisplayDocument())) { jListModel.removeElement(li2); } } } if(1 > visibleDocuments.size()) { browser.disableHistory(); } else { browser.enableHistory(); } }
assertIsDistributed("Container has not been distributed.", containerId);
void archive(final Long containerId) { logger.logApiId(); logger.logVariable("containerId", containerId); try { final Container container = read(containerId); getArchiveModel().archive(container.getId()); deleteLocal(container.getId()); notifyContainerArchived(container, localEventGenerator); } catch (final Throwable t) { throw translateError(t); } }
Assert.assertNotNull(container, "Container \"{0}\" has not been archived.", uniqueId);
void restore(final UUID uniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); try { final InternalArchiveModel archiveModel = getArchiveModel(); // restore container info final Container container = archiveModel.readContainer(uniqueId); restore(container, new RestoreModel() { public InputStream openDocumentVersion(final UUID uniqueId, final Long versionId) { return archiveModel.openDocumentVersion(uniqueId, versionId); } public List<ContainerVersion> readContainerVersions( final UUID uniqueId) { return archiveModel.readContainerVersions(uniqueId); } public List<Document> readDocuments(final UUID uniqueId, final Long versionId) { return archiveModel.readDocuments(uniqueId, versionId); } public List<DocumentVersion> readDocumentVersions( final UUID uniqueId, final Long versionId) { return archiveModel.readDocumentVersions(uniqueId, versionId); } public Map<User, ArtifactReceipt> readPublishedTo( final UUID uniqueId, final Long versionId) { return archiveModel.readPublishedTo(uniqueId, versionId); } public List<JabberId> readTeamIds(final UUID uniqueId) { return archiveModel.readTeamIds(uniqueId); } }); archiveModel.restore(uniqueId); notifyContainerRestored(read(container.getId()), localEventGenerator); } catch (final Throwable t) { throw translateError(t); } }
int rowsDeleted = session.executeUpdate(); if(0 != rowsDeleted && 1 != rowsDeleted) throw new HypersonicException("Could not delete audit version.");
session.executeUpdate();
public void delete(final Long artifactId) throws HypersonicException { final Session session = openSession(); try { final Long[] auditIds = listAuditIds(session, artifactId); final Long[] metaDataIds = listMetaDataIds(session, auditIds); session.prepareStatement(SQL_DELETE_AUDIT_META_DATA); for(final Long metaDataId : metaDataIds) { session.setLong(1, metaDataId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit meta data."); } for(final Long metaDataId : metaDataIds) getMetaDataIO().delete(session, metaDataId); session.prepareStatement(SQL_DELETE_AUDIT_VERSION); session.setLong(1, artifactId); int rowsDeleted = session.executeUpdate(); if(0 != rowsDeleted && 1 != rowsDeleted) throw new HypersonicException("Could not delete audit version."); session.prepareStatement(SQL_DELETE_AUDIT); session.setLong(1, artifactId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit."); session.commit(); } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } }
if(1 != session.executeUpdate())
if(auditIds.length != session.executeUpdate())
public void delete(final Long artifactId) throws HypersonicException { final Session session = openSession(); try { final Long[] auditIds = listAuditIds(session, artifactId); final Long[] metaDataIds = listMetaDataIds(session, auditIds); session.prepareStatement(SQL_DELETE_AUDIT_META_DATA); for(final Long metaDataId : metaDataIds) { session.setLong(1, metaDataId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit meta data."); } for(final Long metaDataId : metaDataIds) getMetaDataIO().delete(session, metaDataId); session.prepareStatement(SQL_DELETE_AUDIT_VERSION); session.setLong(1, artifactId); int rowsDeleted = session.executeUpdate(); if(0 != rowsDeleted && 1 != rowsDeleted) throw new HypersonicException("Could not delete audit version."); session.prepareStatement(SQL_DELETE_AUDIT); session.setLong(1, artifactId); if(1 != session.executeUpdate()) throw new HypersonicException("Could not delete audit."); session.commit(); } catch(final HypersonicException hx) { session.rollback(); throw hx; } finally { session.close(); } }
receiveKeyEvent.setArtifactVersionId(session.getLong("ARTIFACT_VERSION_ID"));
private ReceiveKeyEvent extractReceiveKey(final Session session) { final ReceiveKeyEvent receiveKeyEvent = new ReceiveKeyEvent(); receiveKeyEvent.setArtifactId(session.getLong("ARTIFACT_ID")); receiveKeyEvent.setArtifactVersionId(session.getLong("ARTIFACT_VERSION_ID")); receiveKeyEvent.setCreatedBy(session.getQualifiedUsername("CREATED_BY")); receiveKeyEvent.setCreatedOn(session.getCalendar("CREATED_ON")); receiveKeyEvent.setId(session.getLong("ARTIFACT_AUDIT_ID")); receiveKeyEvent.setType(session.getAuditEventTypeFromInteger("ARTIFACT_AUDIT_TYPE_ID")); final MetaData[] metaData = readMetaData(receiveKeyEvent.getId(), MetaDataKey.RECEIVED_FROM); receiveKeyEvent.setReceivedFrom((JabberId) metaData[0].getValue()); return receiveKeyEvent; }
sendKeyEvent.setType(session.getAuditEventTypeFromInteger("ARTIFACT_AUDIT_ID"));
sendKeyEvent.setType(session.getAuditEventTypeFromInteger("ARTIFACT_AUDIT_TYPE_ID"));
private SendKeyEvent extractSendKey(final Session session) { final SendKeyEvent sendKeyEvent = new SendKeyEvent(); sendKeyEvent.setArtifactId(session.getLong("ARTIFACT_ID")); sendKeyEvent.setArtifactVersionId(session.getLong("ARTIFACT_VERSION_ID")); sendKeyEvent.setCreatedBy(session.getQualifiedUsername("CREATED_BY")); sendKeyEvent.setCreatedOn(session.getCalendar("CREATED_ON")); sendKeyEvent.setId(session.getLong("ARTIFACT_AUDIT_ID")); sendKeyEvent.setType(session.getAuditEventTypeFromInteger("ARTIFACT_AUDIT_ID")); final MetaData[] metaData = readMetaData(sendKeyEvent.getId(), MetaDataKey.SENT_TO); sendKeyEvent.setSentTo((JabberId) metaData[0].getValue()); return sendKeyEvent; }
return listItem.createJMenuItem("KeyRequestAccept", new ActionListener() {
final Object[] arguments = new Object[] { keyRequest.getRequestedByName() }; return listItem.createJMenuItem("KeyRequestAccept", arguments, new ActionListener() {
private JMenuItem getKeyRequestAcceptMenuItem(final ListItem listItem, final KeyRequest keyRequest) { return listItem.createJMenuItem("KeyRequestAccept", new ActionListener() { public void actionPerformed(final ActionEvent e) { runAcceptKeyRequest(listItem, document.getId(), keyRequest.getId()); } }); }
charSet = this.getContentTypeAttribute(contentType, "charset");
charSet = ImportSupport.getContentTypeAttribute(contentType, "charset");
protected Reader acquireReader(String url) throws IOException, Exception { if (!this.isAbsoluteUrl) { // for relative URLs, delegate to our peer return new StringReader(acquireString(url)); } else { // absolute URL try { // handle absolute URLs ourselves, using java.net.URL URL u = new URL(url); //URL u = new URL("http", "proxy.hi.is", 8080, target); URLConnection uc = u.openConnection(); InputStream i = uc.getInputStream(); // okay, we've got a stream; encode it appropriately Reader r = null; String charSet; // charSet extracted according to RFC 2045, section 5.1 String contentType = uc.getContentType(); if (contentType != null) { charSet = this.getContentTypeAttribute(contentType, "charset"); if (charSet == null) { charSet = DEFAULT_ENCODING; } } else { charSet = DEFAULT_ENCODING; } try { r = new InputStreamReader(i, charSet); } catch (Exception ex) { r = new InputStreamReader(i, DEFAULT_ENCODING); } // check response code for HTTP URLs before returning, per spec, // before returning if (uc instanceof HttpURLConnection) { int status = ((HttpURLConnection)uc).getResponseCode(); if (status < 200 || status > 299) { throw new Exception(status + " " + url); } } return r; } catch (IOException ex) { throw new Exception("Problem accessing the absolute URL \"" + url + "\". " + ex); } catch (RuntimeException ex) { // because the spec makes us throw new Exception("Problem accessing the absolute URL \"" + url + "\". " + ex); } } }
setPopupDelegate(model.getPopupDelegate());
setSortByDelegate(model);
ArchiveTabAvatar(final TabPanelExtension extension) { super(extension, new ArchiveTabModel(extension)); model.setSession(getSession()); setPopupDelegate(model.getPopupDelegate()); }
contactTabPanel.setExpanded(expanded);
private void doToggleExpansion(final TabPanel tabPanel) { final ContactTabPanel contactTabPanel = (ContactTabPanel) tabPanel; final Boolean expanded; if (isExpanded(contactTabPanel)) { 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; } contactTabPanel.setExpanded(expanded); expandedState.put(tabPanel, expanded); }
final Boolean doesVersionExist;
void handleArtifactPublished(final UUID uniqueId, final Long versionId, final String name, final UUID artifactUniqueId, final Long artifactVersionId, final String artifactName, final ArtifactType artifactType, final String artifactChecksum, final String artifactStreamId, final JabberId publishedBy, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactUniqueId", artifactUniqueId); logger.logVariable("artifactVersionId", artifactVersionId); logger.logVariable("artifactName", artifactName); logger.logVariable("artifactType", artifactType); logger.logVariable("artifactChecksum", artifactChecksum); logger.logVariable("artifactStreamId", artifactStreamId); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedOn", publishedOn); try { assertIsNotLocalUserId(publishedBy); // determine the existance of the container and the version. final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Boolean doesExist = artifactModel.doesExist(uniqueId); final Boolean doesVersionExist; final Long containerId; final Container container; final ContainerVersion version; if (doesExist) { containerId = artifactModel.readId(uniqueId); container = read(containerId); doesVersionExist = artifactModel.doesVersionExist(containerId, versionId); if (doesVersionExist) { version = readVersion(container.getId(), versionId); } else { version = createVersion(container.getId(), versionId, publishedBy, publishedOn); } } else { doesVersionExist = Boolean.FALSE; // ensure the published by user exists locally getInternalUserModel().readLazyCreate(publishedBy); container = new Container(); container.setCreatedBy(publishedBy); container.setCreatedOn(publishedOn); container.setName(name); container.setState(ArtifactState.ACTIVE); container.setType(ArtifactType.CONTAINER); container.setUniqueId(uniqueId); container.setUpdatedBy(container.getCreatedBy()); container.setUpdatedOn(container.getCreatedOn()); // create containerIO.create(container); // create version version = createVersion(container.getId(), versionId, publishedBy, publishedOn); // create remote info artifactModel.createRemoteInfo(container.getId(), publishedBy, container.getCreatedOn()); // index getIndexModel().indexContainer(container.getId()); } // handle the artifact by specific type final ArtifactVersion artifactVersion; switch(artifactType) { case DOCUMENT: artifactVersion = handleDocumentPublished(artifactUniqueId, artifactVersionId, artifactName, artifactChecksum, artifactStreamId, publishedBy, publishedOn); break; case CONTAINER: default: throw Assert.createUnreachable("UNKNOWN ARTIFACT TYPE"); } containerIO.addVersion(version.getArtifactId(), version.getVersionId(), artifactVersion.getArtifactId(), artifactVersion.getVersionId(), artifactVersion.getArtifactType()); final Container postPublish = read(container.getId()); final ContainerVersion postPublishVersion = readVersion(version.getArtifactId(), version.getVersionId()); notifyContainerPublished(postPublish, null, postPublishVersion, remoteEventGenerator); } catch(final Throwable t) { throw translateError(t); } }
doesVersionExist = artifactModel.doesVersionExist(containerId, versionId);
final Boolean doesVersionExist = artifactModel.doesVersionExist(containerId, versionId);
void handleArtifactPublished(final UUID uniqueId, final Long versionId, final String name, final UUID artifactUniqueId, final Long artifactVersionId, final String artifactName, final ArtifactType artifactType, final String artifactChecksum, final String artifactStreamId, final JabberId publishedBy, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactUniqueId", artifactUniqueId); logger.logVariable("artifactVersionId", artifactVersionId); logger.logVariable("artifactName", artifactName); logger.logVariable("artifactType", artifactType); logger.logVariable("artifactChecksum", artifactChecksum); logger.logVariable("artifactStreamId", artifactStreamId); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedOn", publishedOn); try { assertIsNotLocalUserId(publishedBy); // determine the existance of the container and the version. final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Boolean doesExist = artifactModel.doesExist(uniqueId); final Boolean doesVersionExist; final Long containerId; final Container container; final ContainerVersion version; if (doesExist) { containerId = artifactModel.readId(uniqueId); container = read(containerId); doesVersionExist = artifactModel.doesVersionExist(containerId, versionId); if (doesVersionExist) { version = readVersion(container.getId(), versionId); } else { version = createVersion(container.getId(), versionId, publishedBy, publishedOn); } } else { doesVersionExist = Boolean.FALSE; // ensure the published by user exists locally getInternalUserModel().readLazyCreate(publishedBy); container = new Container(); container.setCreatedBy(publishedBy); container.setCreatedOn(publishedOn); container.setName(name); container.setState(ArtifactState.ACTIVE); container.setType(ArtifactType.CONTAINER); container.setUniqueId(uniqueId); container.setUpdatedBy(container.getCreatedBy()); container.setUpdatedOn(container.getCreatedOn()); // create containerIO.create(container); // create version version = createVersion(container.getId(), versionId, publishedBy, publishedOn); // create remote info artifactModel.createRemoteInfo(container.getId(), publishedBy, container.getCreatedOn()); // index getIndexModel().indexContainer(container.getId()); } // handle the artifact by specific type final ArtifactVersion artifactVersion; switch(artifactType) { case DOCUMENT: artifactVersion = handleDocumentPublished(artifactUniqueId, artifactVersionId, artifactName, artifactChecksum, artifactStreamId, publishedBy, publishedOn); break; case CONTAINER: default: throw Assert.createUnreachable("UNKNOWN ARTIFACT TYPE"); } containerIO.addVersion(version.getArtifactId(), version.getVersionId(), artifactVersion.getArtifactId(), artifactVersion.getVersionId(), artifactVersion.getArtifactType()); final Container postPublish = read(container.getId()); final ContainerVersion postPublishVersion = readVersion(version.getArtifactId(), version.getVersionId()); notifyContainerPublished(postPublish, null, postPublishVersion, remoteEventGenerator); } catch(final Throwable t) { throw translateError(t); } }
doesVersionExist = Boolean.FALSE;
void handleArtifactPublished(final UUID uniqueId, final Long versionId, final String name, final UUID artifactUniqueId, final Long artifactVersionId, final String artifactName, final ArtifactType artifactType, final String artifactChecksum, final String artifactStreamId, final JabberId publishedBy, final Calendar publishedOn) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); logger.logVariable("versionId", versionId); logger.logVariable("name", name); logger.logVariable("artifactUniqueId", artifactUniqueId); logger.logVariable("artifactVersionId", artifactVersionId); logger.logVariable("artifactName", artifactName); logger.logVariable("artifactType", artifactType); logger.logVariable("artifactChecksum", artifactChecksum); logger.logVariable("artifactStreamId", artifactStreamId); logger.logVariable("publishedBy", publishedBy); logger.logVariable("publishedOn", publishedOn); try { assertIsNotLocalUserId(publishedBy); // determine the existance of the container and the version. final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Boolean doesExist = artifactModel.doesExist(uniqueId); final Boolean doesVersionExist; final Long containerId; final Container container; final ContainerVersion version; if (doesExist) { containerId = artifactModel.readId(uniqueId); container = read(containerId); doesVersionExist = artifactModel.doesVersionExist(containerId, versionId); if (doesVersionExist) { version = readVersion(container.getId(), versionId); } else { version = createVersion(container.getId(), versionId, publishedBy, publishedOn); } } else { doesVersionExist = Boolean.FALSE; // ensure the published by user exists locally getInternalUserModel().readLazyCreate(publishedBy); container = new Container(); container.setCreatedBy(publishedBy); container.setCreatedOn(publishedOn); container.setName(name); container.setState(ArtifactState.ACTIVE); container.setType(ArtifactType.CONTAINER); container.setUniqueId(uniqueId); container.setUpdatedBy(container.getCreatedBy()); container.setUpdatedOn(container.getCreatedOn()); // create containerIO.create(container); // create version version = createVersion(container.getId(), versionId, publishedBy, publishedOn); // create remote info artifactModel.createRemoteInfo(container.getId(), publishedBy, container.getCreatedOn()); // index getIndexModel().indexContainer(container.getId()); } // handle the artifact by specific type final ArtifactVersion artifactVersion; switch(artifactType) { case DOCUMENT: artifactVersion = handleDocumentPublished(artifactUniqueId, artifactVersionId, artifactName, artifactChecksum, artifactStreamId, publishedBy, publishedOn); break; case CONTAINER: default: throw Assert.createUnreachable("UNKNOWN ARTIFACT TYPE"); } containerIO.addVersion(version.getArtifactId(), version.getVersionId(), artifactVersion.getArtifactId(), artifactVersion.getVersionId(), artifactVersion.getArtifactType()); final Container postPublish = read(container.getId()); final ContainerVersion postPublishVersion = readVersion(version.getArtifactId(), version.getVersionId()); notifyContainerPublished(postPublish, null, postPublishVersion, remoteEventGenerator); } catch(final Throwable t) { throw translateError(t); } }
public DOMTestCase(DOMTestDocumentBuilderFactory factory) { super(factory);
public DOMTestCase() {
public DOMTestCase(DOMTestDocumentBuilderFactory factory) { super(factory); framework = null; }
public Border getBorder() { if(isExpanded()) { return new Expanded(); } else { return new Default(); } }
public Border getBorder() { return new DocumentDefault(); }
public Border getBorder() { if(isExpanded()) { return new Expanded(); } else { return new Default(); } }
if(isExpanded()) { return imageCache.read(DocumentIcon.NODE_EXPANDED); } else { return imageCache.read(DocumentIcon.NODE_DEFAULT); }
return imageCache.read(DocumentIcon.NODE_DEFAULT);
public ImageIcon getNodeIcon() { if(isExpanded()) { return imageCache.read(DocumentIcon.NODE_EXPANDED); } else { return imageCache.read(DocumentIcon.NODE_DEFAULT); } }
panel.afterRepaint();
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { debug(); // update from index 0 to index 1 for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { panelConstraints.gridy = i; tabJPanel.remove(i); final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } public void intervalAdded(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Adding an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // refresh the element at index 0 and the elements after index 0 for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } public void intervalRemoved(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Removing an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // remove index 0 tabJPanel.remove(e.getIndex0()); // refresh from index 0 forward for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } }); }
revalidate();
validate(); for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.prepareForRepaintAfterValidate(); }
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { debug(); // update from index 0 to index 1 for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { panelConstraints.gridy = i; tabJPanel.remove(i); final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } public void intervalAdded(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Adding an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // refresh the element at index 0 and the elements after index 0 for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } public void intervalRemoved(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Removing an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // remove index 0 tabJPanel.remove(e.getIndex0()); // refresh from index 0 forward for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } }); }
revalidate();
validate(); for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.prepareForRepaintAfterValidate(); }
private void installDataListener() { final DefaultListModel listModel = model.getListModel(); listModel.addListDataListener(new ListDataListener() { public void contentsChanged(final ListDataEvent e) { debug(); // update from index 0 to index 1 for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { panelConstraints.gridy = i; tabJPanel.remove(i); final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } public void intervalAdded(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Adding an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // refresh the element at index 0 and the elements after index 0 for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } public void intervalRemoved(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Removing an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // remove index 0 tabJPanel.remove(e.getIndex0()); // refresh from index 0 forward for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); } }); }
panel.afterRepaint();
public void contentsChanged(final ListDataEvent e) { debug(); // update from index 0 to index 1 for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { panelConstraints.gridy = i; tabJPanel.remove(i); final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); }
revalidate();
validate(); for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.prepareForRepaintAfterValidate(); }
public void contentsChanged(final ListDataEvent e) { debug(); // update from index 0 to index 1 for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { panelConstraints.gridy = i; tabJPanel.remove(i); final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = e.getIndex0(); i <= e.getIndex1(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); }
panel.afterRepaint();
public void intervalAdded(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Adding an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // refresh the element at index 0 and the elements after index 0 for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); }
revalidate();
validate(); for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.prepareForRepaintAfterValidate(); }
public void intervalAdded(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Adding an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // refresh the element at index 0 and the elements after index 0 for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); }
panel.afterRepaint();
public void intervalRemoved(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Removing an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // remove index 0 tabJPanel.remove(e.getIndex0()); // refresh from index 0 forward for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); }
revalidate();
validate(); for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.prepareForRepaintAfterValidate(); }
public void intervalRemoved(final ListDataEvent e) { debug(); tabJPanel.remove(fillJLabel); // Removing an interval can cause the border on the interval before it to change, // so adjust the start index to one before the interval added. int startIndex = e.getIndex0(); if (startIndex > 0) { startIndex--; } // remove index 0 tabJPanel.remove(e.getIndex0()); // refresh from index 0 forward for (int i = startIndex; i < listModel.size(); i++) { panelConstraints.gridy = i; final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.setPreferredSize(panel.getPreferredSize(i==(listModel.size()-1))); panel.prepareForRepaint(); panel.setBackground(panel.getBackgroundColor()); panel.setBorder(panel.getBorder(i==(listModel.size()-1))); tabJPanel.add(panel, panelConstraints.clone(), i); panel.afterRepaint(); } tabJPanel.add(fillJLabel, fillConstraints, listModel.size()); tabJPanel.revalidate(); tabJPanel.repaint(); tabJScrollPane.revalidate(); tabJScrollPane.repaint(); revalidate(); repaint(); /* for (int i = startIndex; i < listModel.size(); i++) { final DefaultTabPanel panel = (DefaultTabPanel) listModel.get(i); panel.afterRepaint(); }*/ debug(); }
addTeamMember(artifactId, remoteUser);
try { addTeamMember(artifactId, remoteUser); } catch (final TrueAssertion ta) { if ("TEAM MEMBER ALREADY ADDED".equals(ta.getMessage())) { logWarning(ta); } else { throw ta; } }
void handleTeamMemberAdded(final UUID uniqueId, final JabberId jabberId) { logApiId(); logVariable("uniqueId", uniqueId); logVariable("jabberId", jabberId); try { final Long artifactId = readId(uniqueId); // if receiving your own team member added event you have just been // added to the team; so download the entire team. if (jabberId.equals(localUserId())) { final List<JabberId> remoteTeam = getInternalSessionModel().readArtifactTeam(uniqueId); for (final JabberId remoteUser : remoteTeam) { addTeamMember(artifactId, remoteUser); } } else { addTeamMember(artifactId, jabberId); } } catch(final Throwable t) { throw translateError(t); } }
public DoubleTypeConverterImpl(ValueFactory factory) { super(factory); }
public DoubleTypeConverterImpl() { super(); }
public DoubleTypeConverterImpl(ValueFactory factory) { super(factory); }
final ContainerDraft draft = readDraft(containerId); if (null == draft) { logInfo("Draft did not previously exist for {0}.", name); } else { for (final Artifact artifact : draft.getArtifacts()) { containerIO.deleteDraftArtifactRel(containerId, artifact.getId()); } containerIO.deleteDraft(containerId); }
void handlePublished(final UUID uniqueId, final Long versionId, final String name, final Integer artifactCount, final JabberId publishedBy, final List<JabberId> publishedTo, final Calendar publishedOn) { logApiId(); logVariable("uniqueId", uniqueId); logVariable("versionId", versionId); logVariable("name", name); logVariable("artifactCount", artifactCount); logVariable("publishedBy", publishedBy); logVariable("publishedTo", publishedTo); logVariable("publishedOn", publishedOn); final InternalArtifactModel artifactModel = getInternalArtifactModel(); final Long containerId = artifactModel.readId(uniqueId); // add to local team final InternalUserModel userModel = getInternalUserModel(); final List<TeamMember> localTeam = artifactModel.readTeam2(containerId); final List<User> publishedToUsers = new ArrayList<User>(); for (final JabberId publishedToId : publishedTo) { if (!contains(localTeam, publishedToId)) { artifactModel.addTeamMember(containerId, publishedToId); } publishedToUsers.add(userModel.read(publishedToId)); } // add the sender as well if (!contains(localTeam, publishedBy)) { artifactModel.addTeamMember(containerId, publishedBy); } // create published to list containerIO.createPublishedTo(containerId, versionId, publishedToUsers); // fire event notifyContainerPublished(read(containerId), readDraft(containerId), readVersion(containerId, versionId), remoteEventGenerator); }
LOGGER.logVariable("streamId", streamOffset); LOGGER.logVariable("streamId", streamSize);
LOGGER.logVariable("streamOffset", streamOffset); LOGGER.logVariable("streamSize", streamSize);
public void run() { LOGGER.logApiId(); LOGGER.logVariable("streamId", streamId); LOGGER.logVariable("streamId", streamOffset); LOGGER.logVariable("streamId", streamSize); try { final OutputStream output = streamServer.openOutputStream(streamSession, streamId, streamOffset); int len; long total = streamOffset.longValue(); final byte[] b = new byte[streamSession.getBufferSize()]; try { while((len = input.read(b)) > 0) { LOGGER.logDebug("Upstream recieved: {0}/{1}", total += len, streamSize); output.write(b, 0, len); output.flush(); } } finally { output.flush(); output.close(); } } catch (final IOException iox) { throw new StreamException(iox); } }
public void objectClosed(CloseEvent closeEvent) { controller.reloadMainBrowserAvatar(); }
private UpdateListener createDocumentModelUpdateListener() { return new UpdateListener() { public void objectDeleted(final DeleteEvent e) { controller.reloadMainBrowserAvatar(); } public void objectReceived(final UpdateEvent e) { controller.reloadMainBrowserAvatar(); } public void objectUpdated(final UpdateEvent e) { controller.reloadMainBrowserAvatar(); } }; }
private JMenu getSendVersionMenu() { final Contact[] team = avatar.getTeam(historyItem.getDocumentId());
private JMenu getSendVersionMenu(final Contact[] team) {
private JMenu getSendVersionMenu() { final Contact[] team = avatar.getTeam(historyItem.getDocumentId()); final JMenu jMenu = MenuFactory.create(getString("SendVersion")); for(final Contact teamMember : team) { jMenu.add(createJMenuItem( "SendVersion.TeamMember", new Object[] {teamMember.getFirstName(), teamMember.getLastName(), teamMember.getOrganization()}, new ActionListener() { public void actionPerformed(final ActionEvent e) { avatar.getController().runSendArtifactVersion(getDocumentId(), teamMember, getVersionId()); } })); } return jMenu; }
jPopupMenu.add(getSendVersionMenu());
if(!isClosed()) { final Contact[] team = avatar.getTeam(historyItem.getDocumentId()); if(0 < team.length) { jPopupMenu.add(getSendVersionMenu(team)); } }
public void populatePopupMenu(final MouseEvent e, final JPopupMenu jPopupMenu) { if(isVersionAttached()) { jPopupMenu.add(getOpenVersionMenuItem()); jPopupMenu.add(getSendVersionMenu()); } }
return readProject(index.lookupXmlFile(id));
final File xmlFile = index.lookupXmlFile(id); if(null == xmlFile) { return null; } else { return readProject(xmlFile); }
public Project get(final UUID id) throws FileNotFoundException, IOException { logger.info("get(UUID)"); logger.debug(id); final Index index = readIndex(getIndexXmlFile()); return readProject(index.lookupXmlFile(id)); }
setOpaque(false);
private void initComponents() { javax.swing.JButton cancelJButton; javax.swing.JLabel contactsJLabel; javax.swing.JScrollPane contactsJScrollPane; javax.swing.JSeparator jSeparator_1; javax.swing.JLabel teamJLabel; javax.swing.JScrollPane teamJScrollPane; javax.swing.JLabel versionJLabel; documentJLabel = LabelFactory.create(); versionJLabel = LabelFactory.create(getString("VersionLabel")); versionJComboBox = ComboBoxFactory.create(); includeKeyJCheckBox = CheckBoxFactory.create(getString("IncludeKeyCheckBox")); jSeparator_1 = SeparatorFactory.create(); sendToJPanel = new javax.swing.JPanel(); teamJLabel = LabelFactory.create(getString("TeamLabel")); contactsJLabel = LabelFactory.create(getString("ContactsLabel")); teamJScrollPane = ScrollPaneFactory.create(); teamJList = ListFactory.create(); contactsJScrollPane = ScrollPaneFactory.create(); contactsJList = ListFactory.create(); sendJButton = ButtonFactory.create(getString("SendButton")); cancelJButton = ButtonFactory.create(getString("CancelButton")); vSpacerJLabel = LabelFactory.create(); setOpaque(false); versionJComboBox.setModel(versionModel); versionJComboBox.setRenderer(new VersionListCellRenderer()); versionJComboBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent e) { versionJComboBoxItemStateChanged(e); } }); includeKeyJCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); includeKeyJCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); includeKeyJCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent e) { includeKeyJCheckBoxStateChanged(e); } }); teamJList.setCellRenderer(new UserListCellRenderer()); teamJList.setModel(teamModel); teamJList.setSelectionModel(teamSelectionModel); teamJList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent e) { teamJListValueChanged(e); } }); teamJScrollPane.setViewportView(teamJList); contactsJList.setCellRenderer(new UserListCellRenderer()); contactsJList.setModel(contactsModel); contactsJList.setSelectionModel(contactsSelectionModel); contactsJList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent e) { contactsJListValueChanged(e); } }); contactsJScrollPane.setViewportView(contactsJList); org.jdesktop.layout.GroupLayout sendToJPanelLayout = new org.jdesktop.layout.GroupLayout(sendToJPanel); sendToJPanel.setLayout(sendToJPanelLayout); sendToJPanelLayout.setHorizontalGroup( sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(sendToJPanelLayout.createSequentialGroup() .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(teamJLabel) .add(teamJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(contactsJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(contactsJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))) ); sendToJPanelLayout.setVerticalGroup( sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(sendToJPanelLayout.createSequentialGroup() .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(teamJLabel) .add(contactsJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(teamJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE) .add(contactsJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)) .addContainerGap()) ); sendJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { sendJButtonActionPerformed(e); } }); cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { cancelJButtonActionPerformed(e); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, sendToJPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(documentJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(cancelJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(org.jdesktop.layout.GroupLayout.LEADING, jSeparator_1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(versionJLabel) .add(vSpacerJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, includeKeyJCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, versionJComboBox, 0, 309, Short.MAX_VALUE)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(documentJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(versionJLabel) .add(versionJComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(includeKeyJCheckBox) .add(vSpacerJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jSeparator_1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendToJPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(sendJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
sendToJPanel.setOpaque(false);
private void initComponents() { javax.swing.JButton cancelJButton; javax.swing.JLabel contactsJLabel; javax.swing.JScrollPane contactsJScrollPane; javax.swing.JSeparator jSeparator_1; javax.swing.JLabel teamJLabel; javax.swing.JScrollPane teamJScrollPane; javax.swing.JLabel versionJLabel; documentJLabel = LabelFactory.create(); versionJLabel = LabelFactory.create(getString("VersionLabel")); versionJComboBox = ComboBoxFactory.create(); includeKeyJCheckBox = CheckBoxFactory.create(getString("IncludeKeyCheckBox")); jSeparator_1 = SeparatorFactory.create(); sendToJPanel = new javax.swing.JPanel(); teamJLabel = LabelFactory.create(getString("TeamLabel")); contactsJLabel = LabelFactory.create(getString("ContactsLabel")); teamJScrollPane = ScrollPaneFactory.create(); teamJList = ListFactory.create(); contactsJScrollPane = ScrollPaneFactory.create(); contactsJList = ListFactory.create(); sendJButton = ButtonFactory.create(getString("SendButton")); cancelJButton = ButtonFactory.create(getString("CancelButton")); vSpacerJLabel = LabelFactory.create(); setOpaque(false); versionJComboBox.setModel(versionModel); versionJComboBox.setRenderer(new VersionListCellRenderer()); versionJComboBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent e) { versionJComboBoxItemStateChanged(e); } }); includeKeyJCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); includeKeyJCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); includeKeyJCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent e) { includeKeyJCheckBoxStateChanged(e); } }); teamJList.setCellRenderer(new UserListCellRenderer()); teamJList.setModel(teamModel); teamJList.setSelectionModel(teamSelectionModel); teamJList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent e) { teamJListValueChanged(e); } }); teamJScrollPane.setViewportView(teamJList); contactsJList.setCellRenderer(new UserListCellRenderer()); contactsJList.setModel(contactsModel); contactsJList.setSelectionModel(contactsSelectionModel); contactsJList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent e) { contactsJListValueChanged(e); } }); contactsJScrollPane.setViewportView(contactsJList); org.jdesktop.layout.GroupLayout sendToJPanelLayout = new org.jdesktop.layout.GroupLayout(sendToJPanel); sendToJPanel.setLayout(sendToJPanelLayout); sendToJPanelLayout.setHorizontalGroup( sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(sendToJPanelLayout.createSequentialGroup() .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(teamJLabel) .add(teamJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(contactsJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(contactsJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))) ); sendToJPanelLayout.setVerticalGroup( sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(sendToJPanelLayout.createSequentialGroup() .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(teamJLabel) .add(contactsJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendToJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(teamJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE) .add(contactsJScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)) .addContainerGap()) ); sendJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { sendJButtonActionPerformed(e); } }); cancelJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { cancelJButtonActionPerformed(e); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, sendToJPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(documentJLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(cancelJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendJButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(org.jdesktop.layout.GroupLayout.LEADING, jSeparator_1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(versionJLabel) .add(vSpacerJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, includeKeyJCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, versionJComboBox, 0, 309, Short.MAX_VALUE)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(documentJLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(versionJLabel) .add(versionJComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(includeKeyJCheckBox) .add(vSpacerJLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jSeparator_1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(sendToJPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelJButton) .add(sendJButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents
version.setComment(session.getString("COMMENT"));
ContainerVersion extractVersion(final Session session) { final ContainerVersion version = new ContainerVersion(); version.setArtifactId(session.getLong("CONTAINER_ID")); version.setArtifactType(session.getTypeFromInteger("ARTIFACT_TYPE_ID")); version.setArtifactUniqueId(session.getUniqueId("ARTIFACT_UNIQUE_ID")); version.setCreatedBy(session.getQualifiedUsername("CREATED_BY")); version.setCreatedOn(session.getCalendar("CREATED_ON")); version.setName(session.getString("ARTIFACT_NAME")); version.setUpdatedBy(session.getQualifiedUsername("UPDATED_BY")); version.setUpdatedOn(session.getCalendar("UPDATED_ON")); version.setVersionId(session.getLong("CONTAINER_VERSION_ID")); version.setMetaData(getVersionMetaData(version.getArtifactId(), version.getVersionId())); return version; }
response.getOutputStream().print(html.toString());
response.getWriter().print(html.toString());
protected void error(HttpServletRequest request, HttpServletResponse response, Exception cause) throws ServletException { try { StringBuffer html = new StringBuffer(); html.append("<html>"); html.append("<title>Error</title>"); html.append("<body bgcolor=\"#ffffff\">"); html.append("<h2>VelocityViewServlet : Error processing the template</h2>"); html.append("<pre>"); String why = cause.getMessage(); if (why != null && why.trim().length() > 0) { html.append(why); html.append("<br>"); } StringWriter sw = new StringWriter(); cause.printStackTrace(new PrintWriter(sw)); html.append(sw.toString()); html.append("</pre>"); html.append("</body>"); html.append("</html>"); response.getOutputStream().print(html.toString()); } catch (Exception e) { // clearly something is quite wrong. // let's log the new exception then give up and // throw a servlet exception that wraps the first one Velocity.error("Exception while printing error screen: "+e); throw new ServletException(cause); } }
ServletOutputStream output = response.getOutputStream();
PrintWriter pw = response.getWriter();
protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws ResourceNotFoundException, ParseErrorException, MethodInvocationException, IOException, UnsupportedEncodingException, Exception { ServletOutputStream output = response.getOutputStream(); VelocityWriter vw = null; try { vw = (VelocityWriter)writerPool.get(); if (vw == null) { vw = new VelocityWriter(new OutputStreamWriter(output, encoding), 4*1024, true); } else { vw.recycle(new OutputStreamWriter(output, encoding)); } template.merge(context, vw); } finally { try { if (vw != null) { // flush and put back into the pool // don't close to allow us to play // nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * OutputStreamWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } } catch (Exception e) { // do nothing } } }
vw = new VelocityWriter(new OutputStreamWriter(output, encoding), 4*1024, true);
vw = new VelocityWriter(pw, 4*1024, true);
protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws ResourceNotFoundException, ParseErrorException, MethodInvocationException, IOException, UnsupportedEncodingException, Exception { ServletOutputStream output = response.getOutputStream(); VelocityWriter vw = null; try { vw = (VelocityWriter)writerPool.get(); if (vw == null) { vw = new VelocityWriter(new OutputStreamWriter(output, encoding), 4*1024, true); } else { vw.recycle(new OutputStreamWriter(output, encoding)); } template.merge(context, vw); } finally { try { if (vw != null) { // flush and put back into the pool // don't close to allow us to play // nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * OutputStreamWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } } catch (Exception e) { // do nothing } } }
vw.recycle(new OutputStreamWriter(output, encoding));
vw.recycle(pw);
protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws ResourceNotFoundException, ParseErrorException, MethodInvocationException, IOException, UnsupportedEncodingException, Exception { ServletOutputStream output = response.getOutputStream(); VelocityWriter vw = null; try { vw = (VelocityWriter)writerPool.get(); if (vw == null) { vw = new VelocityWriter(new OutputStreamWriter(output, encoding), 4*1024, true); } else { vw.recycle(new OutputStreamWriter(output, encoding)); } template.merge(context, vw); } finally { try { if (vw != null) { // flush and put back into the pool // don't close to allow us to play // nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * OutputStreamWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } } catch (Exception e) { // do nothing } } }
* OutputStreamWriter to null to keep memory free while
* PrintWriter to null to keep memory free while
protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws ResourceNotFoundException, ParseErrorException, MethodInvocationException, IOException, UnsupportedEncodingException, Exception { ServletOutputStream output = response.getOutputStream(); VelocityWriter vw = null; try { vw = (VelocityWriter)writerPool.get(); if (vw == null) { vw = new VelocityWriter(new OutputStreamWriter(output, encoding), 4*1024, true); } else { vw.recycle(new OutputStreamWriter(output, encoding)); } template.merge(context, vw); } finally { try { if (vw != null) { // flush and put back into the pool // don't close to allow us to play // nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * OutputStreamWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } } catch (Exception e) { // do nothing } } }
super(parent, name, description, createdOn, createdBy, keyHolder, id);
super(parent, name, description, createdOn, createdBy, id);
public Project(final Project parent, final String name, final Calendar createdOn, final String createdBy, final String keyHolder, final String description, final File directory, final UUID id) { super(parent, name, description, createdOn, createdBy, keyHolder, id); this.directory = directory; // sub-projects documents and contacts are set in the project // via the addXXX\setXXX apis. this.projects = new Vector<Project>(0); this.documents = new Vector<Document>(0); }
javax.swing.JLabel closeJLabel = new JLabel(ImageIOUtil.readIcon("BrowserTitle_Close.png"));
javax.swing.JLabel closeJLabel = new JLabel(CLOSE_ICON);
private JLabel getCloseButton() { javax.swing.JLabel closeJLabel = new JLabel(ImageIOUtil.readIcon("BrowserTitle_Close.png")); closeJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { closeJLabelMouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { closeJLabelMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { closeJLabelMouseExited(evt); } }); return closeJLabel; }
private JLabel getMaximizeButton() { javax.swing.JLabel maximizeJLabel = new JLabel(ImageIOUtil.readIcon("BrowserTitle_Maximize.png"));
private JLabel getMaximizeButton(final Boolean maximized) { javax.swing.JLabel maximizeJLabel = new JLabel(); if (maximized) { maximizeJLabel.setIcon(UNMAXIMIZE_ICON); } else { maximizeJLabel.setIcon(MAXIMIZE_ICON); }
private JLabel getMaximizeButton() { javax.swing.JLabel maximizeJLabel = new JLabel(ImageIOUtil.readIcon("BrowserTitle_Maximize.png")); maximizeJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { maximizeJLabelMouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { maximizeJLabelMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { maximizeJLabelMouseExited(evt); } }); return maximizeJLabel; }
closeJLabelMouseClicked(evt);
maximizeJLabelMouseClicked(evt);
public void mouseClicked(java.awt.event.MouseEvent evt) { closeJLabelMouseClicked(evt); }
closeJLabelMouseEntered(evt);
maximizeJLabelMouseEntered(evt);
public void mouseEntered(java.awt.event.MouseEvent evt) { closeJLabelMouseEntered(evt); }
closeJLabelMouseExited(evt);
maximizeJLabelMouseExited(evt);
public void mouseExited(java.awt.event.MouseEvent evt) { closeJLabelMouseExited(evt); }
javax.swing.JLabel minimizeJLabel = new JLabel(ImageIOUtil.readIcon("BrowserTitle_Minimize.png"));
javax.swing.JLabel minimizeJLabel = new JLabel(MINIMIZE_ICON);
private JLabel getMinimizeButton() { javax.swing.JLabel minimizeJLabel = new JLabel(ImageIOUtil.readIcon("BrowserTitle_Minimize.png")); minimizeJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { minimizeJLabelMouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { minimizeJLabelMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { minimizeJLabelMouseExited(evt); } }); return minimizeJLabel; }
maximizeJLabelMouseClicked(evt);
minimizeJLabelMouseClicked(evt);
public void mouseClicked(java.awt.event.MouseEvent evt) { maximizeJLabelMouseClicked(evt); }
maximizeJLabelMouseEntered(evt);
minimizeJLabelMouseEntered(evt);
public void mouseEntered(java.awt.event.MouseEvent evt) { maximizeJLabelMouseEntered(evt); }
maximizeJLabelMouseExited(evt);
minimizeJLabelMouseExited(evt);
public void mouseExited(java.awt.event.MouseEvent evt) { maximizeJLabelMouseExited(evt); }
public void mouseClicked(java.awt.event.MouseEvent evt) { minimizeJLabelMouseClicked(evt);
public void mouseClicked(final MouseEvent e) { browser.runProfileSignUp();
public void mouseClicked(java.awt.event.MouseEvent evt) { minimizeJLabelMouseClicked(evt); }
public void mouseEntered(java.awt.event.MouseEvent evt) { minimizeJLabelMouseEntered(evt);
public void mouseEntered(MouseEvent e) { final String text = signUpJLabel.getText(); signUpJLabel.setText(MessageFormat.format("<html><u>{0}</u></html>", text));
public void mouseEntered(java.awt.event.MouseEvent evt) { minimizeJLabelMouseEntered(evt); }
public void mouseExited(java.awt.event.MouseEvent evt) { minimizeJLabelMouseExited(evt);
public void mouseExited(final MouseEvent e) { signUpJLabel.setText(MessageFormat.format("<html>{0}</html>", originalText));
public void mouseExited(java.awt.event.MouseEvent evt) { minimizeJLabelMouseExited(evt); }
((JLabel) evt.getSource()).setIcon(MAX_ROLLOVER_ICON);
if (browser.isBrowserWindowMaximized()) { ((JLabel) evt.getSource()).setIcon(UNMAXIMIZE_ROLLOVER_ICON); } else { ((JLabel) evt.getSource()).setIcon(MAXIMIZE_ROLLOVER_ICON); }
private void maximizeJLabelMouseEntered(java.awt.event.MouseEvent evt) { ((JLabel) evt.getSource()).setIcon(MAX_ROLLOVER_ICON); }
((JLabel) evt.getSource()).setIcon(MAX_ICON);
if (browser.isBrowserWindowMaximized()) { ((JLabel) evt.getSource()).setIcon(UNMAXIMIZE_ICON); } else { ((JLabel) evt.getSource()).setIcon(MAXIMIZE_ICON); }
private void maximizeJLabelMouseExited(java.awt.event.MouseEvent evt) { ((JLabel) evt.getSource()).setIcon(MAX_ICON); }
((JLabel) evt.getSource()).setIcon(MIN_ROLLOVER_ICON);
((JLabel) evt.getSource()).setIcon(MINIMIZE_ROLLOVER_ICON);
private void minimizeJLabelMouseEntered(java.awt.event.MouseEvent evt) { ((JLabel) evt.getSource()).setIcon(MIN_ROLLOVER_ICON); }