uploadedArtifacts.setSelectable(false);
uploadedArtifacts.setMultiSelect(false);
uploadedArtifacts.setImmediate(true);
uploadedArtifacts.setHeight("15em");
final GenericUploadHandler uploadHandler = new GenericUploadHandler(m_sessionDir) {
@Override
public void updateProgress(long readBytes, long contentLength) {
// TODO Auto-generated method stub
}
@Override
protected void artifactsUploaded(List<UploadHandle> uploads) {
for (UploadHandle handle : uploads) {
try {
URL artifact = handle.getFile().toURI().toURL();
Item item = uploadedArtifacts.addItem(artifact);
item.getItemProperty(PROPERTY_SYMBOLIC_NAME).setValue(handle.getFilename());
item.getItemProperty(PROPERTY_VERSION).setValue("");
m_uploadedArtifacts.add(handle.getFile());
}
catch (MalformedURLException e) {
showErrorNotification("Upload artifact processing failed", "<br />Reason: " + e.getMessage());
logError("Processing of " + handle.getFilename() + " failed.", e);
}
}
}
};
final Upload uploadArtifact = new Upload();
uploadArtifact.setCaption("Upload Artifact");
uploadHandler.install(uploadArtifact);
final DragAndDropWrapper finalUploadedArtifacts = new DragAndDropWrapper(uploadedArtifacts);
finalUploadedArtifacts.setDropHandler(new ArtifactDropHandler(uploadHandler));
addListener(new Window.CloseListener() {