Package org.rhq.coregui.client.components.upload

Examples of org.rhq.coregui.client.components.upload.TextFileRetrieverForm


        final CanvasItem upload = new CanvasItem("recipeUploadCanvas");
        upload.setShowTitle(false);
        upload.setVisible(false);

        final TextFileRetrieverForm textFileRetrieverForm = new TextFileRetrieverForm();
        upload.setCanvas(textFileRetrieverForm);

        showUpload.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                showUpload.hide();
                upload.show();
                recipeForm.markForRedraw();
            }
        });

        final TextAreaItem recipe = new TextAreaItem("recipeText");
        recipe.setShowTitle(false);
        recipe.setRequired(false);
        recipe.setColSpan(4);
        recipe.setWidth(400);
        recipe.setHeight(150);

        textFileRetrieverForm.addFormHandler(new DynamicFormHandler() {
            /*
             * Helper method to unescape a string which has been escaped for inclusion in HTML tags
             */
            public String htmlUnescape(String escapedHtml) {
                Element e = Document.get().createDivElement();
                e.setInnerHTML(escapedHtml);
                return e.getInnerText();
            }

            @Override
            public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) {
                wizard.setRecipe(htmlUnescape(event.getResults()));
                recipe.setValue(htmlUnescape(event.getResults()));
                textFileRetrieverForm.retrievalStatus(true);
                showUpload.show();
                upload.hide();
                recipeForm.markForRedraw();
            }
        });
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.components.upload.TextFileRetrieverForm

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.