Package org.apache.ace.webui.vaadin.UploadHelper

Examples of org.apache.ace.webui.vaadin.UploadHelper.GenericUploadHandler


            if (auth.hasRole(role)) {
                count++;
            }
        }

        final GenericUploadHandler uploadHandler = new GenericUploadHandler(m_sessionDir) {
            @Override
            public void updateProgress(long readBytes, long contentLength) {
                Float percentage = new Float(readBytes / (float) contentLength);
                m_progress.setValue(percentage);
            }
View Full Code Here


        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() {
View Full Code Here

TOP

Related Classes of org.apache.ace.webui.vaadin.UploadHelper.GenericUploadHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.